Skip to content

Repository files navigation

Casa

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

"Hello, world!\n" print

Requirements

  • Linux on x86-64
  • GNU assembler (as) and a C compiler driver (cc)
    • For example, on Ubuntu, install the binutils and build-essential packages.

Install

Clone the repository and download the compiler and formatter:

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

You can also run the installer directly:

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
-o, --output Set the output binary name
-L, --library-path Add a module search directory
-l, --link-library Link a native library
-r, --run Run the program after compilation
--keep-asm Keep the generated assembly file
-v, --version Print the compiler version
--verbose Print compiler progress

Learn Casa

Start with the Casa guide.

Use the topic references when you need exact behavior:

Topic Reference
Values and types Types and Literals
Stack evaluation and operators Operators
Bindings, functions, and lambdas Functions and Lambdas
Branches, loops, and matching Control Flow
Structs and methods Structs and Methods
Enums and patterns Enums
Generics and traits Traits
Imports Modules
Compiler operations Built-in Intrinsics

Library references:

Topic Reference
Optional values and errors Optional Values and Errors
Collections and iterators Collections
Text, characters, and output Text and Characters
Files, directories, environment, and processes Operating-System APIs
Logging, timing, arguments, JSON, and parsing Specialist Libraries
Parser building blocks Parser Library

Tooling:

See the curated examples for runnable programs ordered from introductory to advanced.

Build from source

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

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

Releases

Used by

Contributors

Languages