Clara is an upcoming systems programming language. The compiler generates native code through an LLVM backend.
See the examples folder to see the language in action.
Use the following commands to compile an example:
$ cargo install --path .
$ clara ./path/to/example
The compiler will generate an object file and place it in the ./build
directory.
Afterwards in can be linked (such as with GCC) to produce an executable:
$ gcc -no-pie ./build/the_object.o ./lib/clara.c
$ ./a.out
Note: Cargo, Rust and LLVM 13 are required to compile the Clara compiler.
The language is still under heavily development and its future is yet unclear. That being said, the following features have already been implemented:
- Functions
- Extern functions
- Structs
- Transparent structs
- Opaque structs
- Struct literals
- Struct field access
- Pointers
- Pointer types
- Creating pointer values
- Dereferencing pointer values
- Values
- Strings
- Integers
- Bools
- Arrays
- Control flow
- If-else statements
- While loops
- For loops
- FFI
- Using C functions as extern functions
- Using opaque C structs
- Using transparent C structs
- ...
Licensed under the MIT License.