Skip to content
frendsickPublic

Repository files navigation

Casa

Casa is a statically typed, stack-based programming language for Linux.

"Hello, world!\n" print

Requirements

  • 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-essential package.

Install

Clone the repository and download the compiler and formatter:

git clone https://github.com/frendsick/casa.git
cd casa
./install.sh

To 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 | sh

Run a program

Compile and run the hello-world example:

./casac examples/hello_world.casa -r

Compile without running:

./casac examples/fibonacci.casa -o fib
./fib

Common 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.

Learn Casa

Start with the Casa guide. The examples contain runnable programs ordered from introductory to advanced.

Language

Libraries

Tooling

Build from source

Casa is self-hosted. Build the compiler with an existing casac:

./casac casa.casa -o casac -L lib

Run 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

Releases

Used by

Contributors

Languages