<< lib/operating-system/SLCompatSet.sleela SLeeLa Standard Library Definition. Definition: Defines SLCompatSet — the compatibility layer of an OS being constructed: the set of foreign-OS execution capabilities the built OS ships, so it can run guest executables (and their libraries) from other OS families. In the firmware -> boot -> kernel -> userspace -> desktop model this is a userspace capability node; SLOSModel composes one, and the OS Creator's SLCompatLoaderEmitter turns it into real OS components. The set is keyed by the OS's own shape (its host family) and records which guest families it supports running, each realised by an SLCompatLayer (binfmt_misc + Wine/QEMU/WSL/Rosetta/Darling + the guest libraries). A Linux variant that wants to run Windows .exe adds the "Windows" guest; forShape() seeds the common defaults for the host family. Family: operating-system. Composes SLCompatLayer (up to three guests). Pure design model for composition/validity; the layers' own load/unload cross the os* bridge. >> #sleela 2.5 material; class SLCompatSet { < ---- 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 = 11004; String metaAuthor = "Kiro Agent"; String metaDate = "2026-10-16"; String metaCopyright = "SLeeLa project"; String metaTrademark = "none"; String metaCorporation = "none"; < metaOrigin: National | | International | Galactic > String metaOrigin = "International"; String metaBirthDate = "2026-10-11"; < 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; } < the built OS's own family > String host; < Up to three guest layers (Linux/Windows/macOS). Fixed slots keep the model > < array-free; an unused slot has an empty guest. > SLCompatLayer linuxGuest; SLCompatLayer windowsGuest; SLCompatLayer macGuest; int hasLinux; int hasWindows; int hasMac; int configured; void configure(String hostFamily) { host = norm(hostFamily); hasLinux = 0; hasWindows = 0; hasMac = 0; configured = 1; } String norm(String s) { if (s == "Windows") { return "Windows"; } if (s == "macOS") { return "macOS"; } return "Linux"; } < Seed the common foreign-exec defaults for the host family. A Linux build > < ships Windows (Wine) + macOS (Darling) support; a Windows build ships Linux > < (WSL2); a macOS build ships Windows (Wine) + Linux (Lima). Refine with > < support()/drop() afterward. > void forShape(SLOSShape shape) { configure(shape.name()); if (host == "Linux") { support("Windows"); support("macOS"); return; } if (host == "Windows") { support("Linux"); return; } < macOS host > support("Windows"); support("Linux"); } < Add support for running a guest family's executables on this OS. > void support(String guestFamily) { String g = norm(guestFamily); < native; no layer needed > if (g == host) { return; } SLCompatLayer layer = new SLCompatLayer(); layer.configure(host, g); if (g == "Linux") { linuxGuest = layer; hasLinux = 1; return; } if (g == "Windows") { windowsGuest = layer; hasWindows = 1; return; } macGuest = layer; hasMac = 1; } < Remove a previously added guest. > void drop(String guestFamily) { String g = norm(guestFamily); if (g == "Linux") { hasLinux = 0; return; } if (g == "Windows") { hasWindows = 0; return; } hasMac = 0; } boolean supports(String guestFamily) { String g = norm(guestFamily); < native > if (g == host) { return true; } if (g == "Linux") { return hasLinux == 1; } if (g == "Windows") { return hasWindows == 1; } return hasMac == 1; } < The layer object for a guest family (null if not supported). Lets a caller > < load/unload/handle through it. > SLCompatLayer layerFor(String guestFamily) { String g = norm(guestFamily); if (g == "Linux" && hasLinux == 1) { return linuxGuest; } if (g == "Windows" && hasWindows == 1) { return windowsGuest; } if (g == "macOS" && hasMac == 1) { return macGuest; } return null; } int guestCount() { int n = 0; if (hasLinux == 1) { n = n + 1; } if (hasWindows == 1) { n = n + 1; } if (hasMac == 1) { n = n + 1; } return n; } boolean hasAny() { return guestCount() > 0; } String hostName() { return host; } < A newline manifest " runs via " per supported guest, > < for the generated config and for logs. > String compatManifest() { String m = ""; if (hasWindows == 1) { m = add(m, windowsGuest.summary()); } if (hasLinux == 1) { m = add(m, linuxGuest.summary()); } if (hasMac == 1) { m = add(m, macGuest.summary()); } return m; } String add(String acc, String line) { if (acc == "") { return line; } return acc + "\n" + line; } }