https://github.com/lambdaclass/austral.rs
An implementation of the Austral language compiler in Rust
https://github.com/lambdaclass/austral.rs
Last synced: about 1 year ago
JSON representation
An implementation of the Austral language compiler in Rust
- Host: GitHub
- URL: https://github.com/lambdaclass/austral.rs
- Owner: lambdaclass
- License: apache-2.0
- Created: 2023-12-22T14:50:47.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-25T21:51:02.000Z (about 2 years ago)
- Last Synced: 2024-04-25T23:45:10.763Z (about 2 years ago)
- Language: Rust
- Size: 130 KB
- Stars: 14
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# austral
An implementation of the Austral language compiler in Rust.
Austral is a new systems programming language. It uses linear types to provide memory safety and capability-secure code.
## Requisites
- LLVM 17 with MLIR support.
## Building
First make sure you have a working installation of LLVM with MLIR support. If you are using a Mac
you can run:
```bash
brew install llvm@17
```
It will install all the required dependencies.
To compile the project you need to first export some environment variables.
Look at the [env-macos.sh script](env-macos.sh) to see what is needed. Then if you are in using Mac:
```bash
source env-macos.sh
```
After that, `cargo build --all` should work.
## Running the CLI
Run:
To compile an Austral file:
```bash
cd bin/austral_bin
cargo r --
```
```bash
cd bin/austral_bin
cargo r -- ../../programs/examples/hello_world.aum
./a.out
# prints Hello world!
```
You can also print the parsed AST and get the MLIR and LLVM representation of the program.
To see all the available options run:
```bash
cargo r -- --help
```
## Status
- [x] Lexer
- [x] Parser
- [ ] Compilation Passes
- [ ] Type checker
- [x] Code generation of simple programs
- [ ] Full code generation
## Docs
[OCaml code analysis](docs/ocaml_code_analysis.md)
## Resources
- https://austral-lang.org/
- https://borretti.me/article/introducing-austral
- https://borretti.me/article/type-systems-memory-safety
- https://borretti.me/article/how-capabilities-work-austral
- https://borretti.me/article/design-austral-compiler
- https://borretti.me/article/how-australs-linear-type-checker-works
- https://borretti.me/article/linear-types-exceptions
- https://borretti.me/article/linear-types-safety