SLVmVersion.sleela
lib/vm/src/sleela/SLVmVersion.sleela · 161 line(s) · sleela
<< lib/vm/src/sleela/SLVmVersion.sleela
SLeeLa Standard Library Definition.
Definition: Defines SLVmVersion — the base manifest a selectable VM version
(001..010) extends. A manifest is the loadable record that DESCRIBES one
versioned VM: its id and label, which hardening units it composes (the
additive 001->010 progression), its default configuration profile, and the
native entry it maps to (the C/C++ main the native loader builds and boots
when a user selects this VM). On system start or a user conference, the
native VM loads these .sleela into memory, lets the user pick one, then
loads that version's native main.
Each concrete SLVmVersionNNN (in virtual-machine/vm-version/NNN) sets the id,
label, the composed-unit flags, the config profile, and the native source
list, then build() returns a configured SLVmRuntime.
Family: vm. Composes SLVmConfig, SLVmRuntime, SLVmSource.
[VERSION NOTE 2026-11-05] This unit retains #sleela 2.5 because its
material; document marker requires that feature gate. The current normative
language edition is Syntax 3.0 and the shared frontend accepts 1.0..3.0.
The source pragma is intentionally not relabelled merely to match the current
edition; feature gates and source-version history remain authoritative. >>
#sleela 2.5
material;
class SLVmVersion {
< ---- Descriptive metadata (version 1.11 nested-friendly accessors) ---- >
<< Eleven catalogued attributes with getter/setter pairs, so a GUI, loader,
or catalog can read and (where appropriate) override this record.
Values are faithful to the subject's real origin where publicly known. >>
String metaVersion = "1.0.0";
int metaId = 11294;
String metaAuthor = "unknown";
String metaDate = "2026-10-16";
String metaCopyright = "SLeeLa project";
String metaTrademark = "none";
String metaCorporation = "none";
< metaOrigin: National | <nation> | International | Galactic >
String metaOrigin = "International";
String metaBirthDate = "unknown";
< metaScienceRating: maturity/robustness on a 1..10 scale >
int metaScienceRating = 9;
< metaNationalSchedule: a real, citable instrument or "none" >
String metaNationalSchedule = "none";
String getMetaVersion() { return metaVersion; }
void setMetaVersion(String v) { metaVersion = v; }
int getMetaId() { return metaId; }
void setMetaId(int v) { metaId = v; }
String getAuthor() { return metaAuthor; }
void setAuthor(String v) { metaAuthor = v; }
String getDate() { return metaDate; }
void setDate(String v) { metaDate = v; }
String getCopyright() { return metaCopyright; }
void setCopyright(String v) { metaCopyright = v; }
String getTrademark() { return metaTrademark; }
void setTrademark(String v) { metaTrademark = v; }
String getCorporation() { return metaCorporation; }
void setCorporation(String v) { metaCorporation = v; }
String getOrigin() { return metaOrigin; }
void setOrigin(String v) { metaOrigin = v; }
String getBirthDate() { return metaBirthDate; }
void setBirthDate(String v) { metaBirthDate = v; }
int getScienceRating() { return metaScienceRating; }
void setScienceRating(int v) { metaScienceRating = v; }
String getNationalSchedule() { return metaNationalSchedule; }
void setNationalSchedule(String v) { metaNationalSchedule = v; }
< e.g. "idea-vm-001" >
String id;
< e.g. "ground floor" >
String label;
< 1..10 >
int number;
< e.g. "virtual-machine/vm-version/001" >
String nativeDir;
< the C/C++ entry (e.g. "vm_ground_test" / "vm_runtime") >
String nativeMain;
< Which hardening units this version composes (additive 001..010). >
< 001 >
int hasConfig; int hasReport; int hasStatus;
< big integer series: SLeeLa fixed-width int32..int16777216 (signed) and >
< uint32..uint16777216 (unsigned), power-of-two widths 2^5..2^24. A >
< foundational language number capability, present from v001 in every >
< think-tank version (parallels the premium VMs admitting the same series). >
int hasBigIntSeries;
< 002 >
int hasMemory;
< 003 >
int hasResult;
< 004 >
int hasTelemetry;
< 005 >
int hasGc;
< 006 >
int hasProfile;
< 007 >
int hasCapability;
< 008 >
int hasPlatform;
< 009 >
int hasAudit;
< 010 >
int hasRuntime;
< the default configuration a user starts from >
SLVmConfig profile;
< Subclasses call base() then set their specifics. >
void base(int n, String identifier, String lbl, String dir, String mainEntry) {
number = n; id = identifier; label = lbl; nativeDir = dir; nativeMain = mainEntry;
< ground floor is present from 001. >
hasConfig = 1; hasReport = 1; hasStatus = 1;
< the fixed-width big integer series is a foundational language capability, >
< available in every version from 001 onward. >
hasBigIntSeries = 1;
hasMemory = 0; hasResult = 0; hasTelemetry = 0; hasGc = 0; hasProfile = 0;
hasCapability = 0; hasPlatform = 0; hasAudit = 0; hasRuntime = 0;
profile = new SLVmConfig();
profile.defaults();
}
< Enable every additive unit up to version `n` (the cumulative carry-forward). >
void composeThrough(int n) {
if (n >= 2) { hasMemory = 1; }
if (n >= 3) { hasResult = 1; }
if (n >= 4) { hasTelemetry = 1; }
if (n >= 5) { hasGc = 1; }
if (n >= 6) { hasProfile = 1; }
if (n >= 7) { hasCapability = 1; }
if (n >= 8) { hasPlatform = 1; }
if (n >= 9) { hasAudit = 1; }
if (n >= 10) { hasRuntime = 1; }
}
int unitCount() {
int c = hasConfig + hasReport + hasStatus + hasBigIntSeries + hasMemory
+ hasResult + hasTelemetry + hasGc + hasProfile + hasCapability
+ hasPlatform + hasAudit + hasRuntime;
return c;
}
< 1 iff this version supports the SLeeLa fixed-width big integer series >
< (int32..int16777216, uint32..uint16777216). True for every version. >
int supportsBigIntSeries() { return hasBigIntSeries; }
< Build a configured runtime for this version (what selection resolves to). >
SLVmRuntime build() {
SLVmRuntime rt = new SLVmRuntime();
rt.init(profile, id + " (" + label + ")");
return rt;
}
void describe() {
String bigint = " bigint=no";
if (hasBigIntSeries == 1) { bigint = " bigint=int32..int16777216,uint32..uint16777216"; }
print(id + " [" + label + "] units=" + unitCount()
+ bigint
+ " native=" + nativeDir + "/" + nativeMain);
}
}