Compiler and Runtime Architecture
A source-linked map of the Solan repository and its lexer/compiler/bytecode/VM pipeline, optional JIT, memory core, and native modules.
Execution pipeline
From source text to execution
README describes one C entry file (solan.c) that includes .inc files into a single translation unit. Compiler files parse source and emit bytecode; the VM executes instructions and manages values, methods, and modules. An optional x86-64 JIT exists but is not required for interpreter operation.
| Component | Responsibility in the source tree |
|---|---|
src/compiler/ | Lexer, bytecode compiler, disassembler, syntax highlighting. |
src/vm/ | Virtual machine, value methods, and modules. |
src/core/ | Types, garbage collector, memory, and value-to-text conversion. |
src/jit/ | x86-64 JIT; enabled by default on Linux x86-64 per README and can be disabled. |
src/runtime/ | Runtime entry, REPL, fmt/LSP tools, built-in initialization. |
src/lib/ | Native libraries: files, network, JSON, regex, compression, SQLite, TLS, FFI, packages, time, and big integers. |
src/abi/ | C interface in capi.inc and public header include/solan.h. |
src/platform/ | POSIX and Windows differences. |
stdlib/ and editor/vscode/ | Solan-written standard modules and the VS Code extension. |
Build and features
Build-dependent features
- The JIT lives in
src/jit/; README says it is enabled by default only on Linux x86-64 and can be disabled with-DSOLAN_JIT=0at build time orSOLAN_JIT=0at runtime. - SQLite can be embedded when its source files are available; otherwise Solan attempts to load system
libsqlite3when the module is used. - gzip/zlib compression is bundled. OpenSSL is dynamically loaded for HTTPS/WSS/TLS servers; its absence does not prevent unencrypted HTTP/TCP.
- A C compiler is required to build.
gitis needed for package commands that access repositories, not for running an existing Solan executable.
These are README/source-tree facts, not performance measurements or a complete account of every optimization. No JIT thresholds or comparative performance are inferred here.
Development
Updating the embedded standard library
stdlib/*.سو are the readable sources of standard modules. README says to regenerate the embedded copy and build with install.sh --build-only after changing a standard module. See the standard-library page for the module index and links.
sh install.sh --build-onlySource files
Direct links pinned to the source snapshot used by this reference; the main branch may change later.
- README.md
- solan.c
- src/compiler/lexer.inc
- src/compiler/compiler.inc
- src/compiler/opcodes.inc
- src/vm/vm_core.inc
- src/vm/vm_run.inc
- src/vm/methods.inc
- src/core/types.inc
- src/core/gc.inc
- src/core/memory.inc
- src/jit/jit.inc
- src/jit/x64.inc
- src/runtime/main.inc
- src/runtime/repl.inc
- src/runtime/tools.inc
- src/platform/platform.inc