Skip to content

Cappucina/ADAN

Repository files navigation

The ADAN Programming Language

image

A modern, memory safe programming language designed to be written like JavaScript and used like C for low-level programming.

ADAN has been continuously maintained from between February 4th, 2026 to Now.


Compiling the Compiler

Before compiling the compiler, you need to have XMake installed.

Note

Manual compilation is only required if you prefer not to use the pre-compiled binaries available in Releases.

$ xmake install       # Install remaining dependencies (Clang, LLVM, etc.)
$ xmake               # Build the ADAN compiler
$ xmake run           # Compile the default sample with the built compiler
$ ./samples/testing

If libcrypto or libsodium are installed outside the default search paths, set OPENSSL_ROOT_DIR or OPENSSL_LIB_DIR, and set LIBSODIUM_ROOT_DIR or LIBSODIUM_LIB_DIR, before running xmake or adan.

XMake Commands

$ xmake               # Build the ADAN compiler.
$ xmake run           # Run the compiler with the default sample arguments.
$ ./samples/testing   # Run the generated testing sample executable.
$ xmake format        # Format all source code using clang-format.
$ xmake install       # Install all required system dependencies.
$ xmake c             # Remove all build artifacts.
$ xmake f -a x64      # Configure for specific architecture (x64, arm64, etc.)

xmake run invokes the adan target with these default arguments:

$ ./build/linux/x86_64/release/adan -f samples/testing.adn -o samples/testing

This generates samples/testing on Linux and macOS or samples/testing.exe on Windows.

Compiler Arguments

ADAN's compiler provides flags to modify default compilation behaviors:

  • -f <file> / --file <file>: Source file to compile (.adn or .adan). This argument is required.
  • -o <path> / --output <path>: Specifies the output executable path. If <path> is a directory, the binary is placed inside it named after the source file. Defaults to the input source file name in the current directory if not provided.
  • -r / --rawir: Emits the LLVM IR (.ll file) instead of compiling into an executable binary.
  • -l <name> / --link-lib <name>: Adds a native library to the final linker invocation.
  • -L <path> / --link-search <path>: Adds a native library search path to the final linker invocation.
  • --link-arg <arg>: Passes a raw argument directly to the system linker.
  • -h / --help: Show the help message and exit.
$ ./adan -f main.adn -r    # Output 'main.ll' LLVM IR.
$ ./adan --file main.adn   # Outputs a 'main' executable.

Native Linking

ADAN now supports source-level native-linking metadata for FFI declarations and top-level linker directives:

link "m";
link_search "/usr/lib";

extern function puts(text: string): i32 link "puts" library "c" abi "c";

You can also export a definition from ADAN for the generated object code:

export function add(a: i32, b: i32): i32 {
  return a + b;
}

Star History Chart

About

A modern, memory safe programming language designed to be written like JavaScript and used like C for low-level programming.

Topics

Resources

Stars

Watchers

Forks

Contributors