Welcome to the Swalang Engine development guide. This resource explains how to configure, compile, test, and contribute to the core interpreter, standard library, and auxiliary tooling.
The Swalang parser and runtime are built using Go, while various performance-critical native extensions (such as SQLite, Mongoose, and SDL2) are cross-compiled using Zig.
The project workspace is organized logically into core packages, dynamic extension targets, and compiler automation scripts:
Main entry point for the standard Swalang CLI and REPL shell.
Converts source code characters into parsed streams of structured tokens.
Constructs the Abstract Syntax Tree (AST) from the token stream.
Core runtime engine that walks the AST to evaluate expressions and statements.
Follow these steps to compile the Swalang binary and standard shared libraries for local development:
git clone https://github.com/deniskipeles/swalang-beta.git
cd swalang-betaThis script will download the source files for extensions and compile them into platform-specific shared libraries under the bin/ folder.
./scripts/build-shared-libs.shThis script links all components, bundles the standard library, and generates the final executables inside the builds/ folder.
./scripts/build-interpreter.shVerify the integrity of changes by executing the suite of unit tests. Tests cover lexing, AST generation, and runtime evaluation:
go test ./tests/...If you are proposing additions to Swalang's syntax (such as introducing new keywords or tokens), update the pipeline in the following sequence:
internal/constants/lexer_en.go and lexer_sw.go.TokenType inside internal/lexer/token.go.internal/parser/parser.go to define prefix or infix parsing operations so the compiler understands the keyword's position in the AST tree.Review your code formatting, make sure all tests pass, and submit a pull request on GitHub.