CSSL Language Overview
A programming language being developed for Apocky projects.
What is CSSL
CSSL stands for Conscious Substrate System Language. It is a programming language under development for Apocky projects. A programming language is a structured way to write instructions that a compiler can turn into software. The CSSL compiler is named csslc. It currently uses Rust libraries to produce native program files.
.csl may also contain compact technical specifications. Code, specifications, and future goals should be identified separately.Why a new language
The design goal is to make permission boundaries easier to express directly in program code. The proposed Σ-mask type checks are not yet a complete available language feature, so they are described below as planned. The permissions and data sharing guide explains the related design goals.
Sample · the smallest LoA program
This is Labyrinth of Apocalypse/main.cssl, the actual root module that csslc compiles into LoA.exe. Twelve lines of executable code. Every other tick of the engine is delegated to the loa-host staticlib, auto-linked by csslc's default-link mechanism.
module com.apocky.loa.main// § FFI declaration · engine entry-pointextern "C" fn __cssl_engine_run() -> i32 ;// § main · the pure-CSSL entry-pointfn main() -> i32 { let exit_code: i32 = __cssl_engine_run() ; exit_code}Sample · scene with FFI
A more representative file: a runtime-procgen city scene. Each extern "C" fn is a host-side staticlib symbol auto-linked at compile time.
module com.apocky.loa.scenes.city_central_hubextern "C" fn scene_open(player_id: u64, world_seed: u128, city_id: u32) -> u32 ;extern "C" fn scene_procgen_grid(handle: u32, biome_affinity: u32) -> u32 ;extern "C" fn scene_procgen_npc_population(handle: u32, target_count: u32) -> u32 ;fn on_scene_enter(player_id: u64, world_seed: u128) -> u32 { let city: u32 = 1 ; // NeverhomeRise let h: u32 = scene_open(player_id, world_seed, city) ; let _g: u32 = scene_procgen_grid(h, city) ; let _n: u32 = scene_procgen_npc_population(h, 4096) ; // ≥ 4096 NPCs @ 60fps h}Available today — available now
module <path>declarations · single-module compilefn name(args) -> Twith i8/i16/i32/i64/i128/u8/u16/u32/u64/u128/f32/f64/boolextern "C" fnfor FFI to the loa-host + cssl-rt staticlibsstruct,let mut, control flow, expressions- Cranelift object-file emission · auto-default-link for
cssl-rt+loa-host - Glyph-tolerant comments and docs (CSL3 dialect)
In progress and planned
Labyrinth of Apocalypse/systems/ and scenes/ are tracked in git but not yet ingested at compile time. The csslc build subcommand currently accepts one positional input. POD-4-D3 unlocks multi-module compile via --module-path or auto-discovery from a manifest. See /docs/cssl-modules.