Casa is a statically typed, stack-based programming language for Linux.
"Hello, world!\n" print
- Linux on x86-64
- A C compiler driver at
/usr/bin/cc, with GNU assembler and linker tools- For example, on Ubuntu, install the
build-essentialpackage.
- For example, on Ubuntu, install the
Clone the repository and download the compiler and formatter:
git clone https://github.com/frendsick/casa.git
cd casa
./install.shTo download only casac and casafmt into the current directory, run the
installer directly. This does not download the standard library or examples:
curl -sSL https://raw.githubusercontent.com/frendsick/casa/main/install.sh | shCompile and run the hello-world example:
./casac examples/hello_world.casa -rCompile without running:
./casac examples/fibonacci.casa -o fib
./fibCommon compiler options:
| Option | Purpose |
|---|---|
--keep-asm |
Keep the generated assembly file |
-L, --library-path |
Add a module search directory |
-l, --link-library |
Link a native library |
-o, --output |
Set the output binary name |
-r, --run |
Run the program after compilation |
-v, --verbose |
Print compiler stages and elapsed time to stderr |
--version |
Print the compiler version |
Verbose output reports source reading, lexing, parsing and import resolution, type and ownership checks, specialization, assembly generation, and native assembly and linking. Each timestamp is elapsed time since compilation started.
Start with the Casa guide. The examples contain runnable programs ordered from introductory to advanced.
- Control flow
- Enums and patterns
- Functions and lambdas
- Intrinsics
- Modules
- Operators
- Ownership and borrows
- Reference notation
- Structs and methods
- Traits
- Types and literals
- Collections and iterators
- JSON
- List
- Operating-system APIs
- Optional values and errors
- Parser library
- Specialist libraries: logging, timing, arguments, JSON, and parsing
- Text and characters
- Casa style
- Compiler diagnostics
- Compiler request products
- Formatter usage and rules
- Language server
- Line counts with cloc
Casa is self-hosted. Build the compiler with an existing casac:
./casac casa.casa -o casac -L libRun the main test suite with tests/test_all.sh and Python 3. Native unwinding
checks run in a separate CI workflow. They require GDB and a compiler built
from the branch:
python3 tests/test_native_unwinding.py ./casac