Home of the Acris programming language. Named after the genus Acris which is the name of cricket frogs.
Acris syntax is somewhat inspired by Swift, Golang and Rust. But in Acris expressions are not statements. This allows us to write code without any need for semicolons. As well as prevents your coworkes from writing hard to read expressions like:
let var = if(...) {
// ...
} else {
// ...
}The main goal of the programming language is providing seamless interop with multiple programming languages. Besides being able to select which backend you want to use for code generation:
- LLVM (Half broken).
- C++ (Generated from the AST).
- C (not yet implemented)
It is also possible to select for which language you want your functions to be exported to:
- Python (Works for C++ backend uses
pybind11) - Lua (not yet implemented)
- JavaScript (not yet implemented)
Here is a simple sample program.
module main
// Standard library includes:
#include_once <core/core.ac> // <> are reserved for standard library.
// Comments like in C/C++.
/*
* Multiline comments as in C/C++.
*/
func main() -> int {
defer {
println("Defer!")
}
println("Hello World!")
return 0
}Which can be compiled using:
acris --backend cpp --interop python samples/hello.acWhich will create an importable Python DLL.
Note that the project is not yet stable at all.
There are a list of language features implemented and its best to read through the samples/, for what is implemented.
In order to compile the project you will need to following dependencies:
- C++ compiler with support for C++23.
- Invoke (Used to invoke CMake and scripts)
- Cmake (Main buildsysstem)
- CLI11 (CLI option parsing library)
- rang (cross platform terminal coloring library)
- tabulate (Text table library)
- Boost (Utility libraries for C++)
- LLVM (LLVM is used for code generation and optimization)
- cereal (Serialization library used for the AST)
- libassert (Modern assertion library for compile and runtime assertion checking)
- pybind11 (Used to generate C++ to Python bindings.)
In order to compile the project you will need a couple of dependencies. First we use invoke to invoke different python scripts, to orchestrate building the project. In order to install invoke it is best to use pipx. Which is installed using:
apt install -y pipxIn order to make use of invoke you should install it through pipx.
pipx install invokeThe you can invoke the appropriate setup script for your OS by running:
inv setupIf your OS is not supported it is best to checkout tools/setup and figure out what dependencies you require.
After installing the necessary dependencies you can build the compiler by running:
inv build --parallel
To compile and run the tests compile the following:
inv build --mode=test-build --parallel
./test-build/acris-tests
assets/: Non code related assets like images.cmake/: Cmake sources that are needed to build the project.src/: Sources of the Acris project.tests/: Unit tests of the Acris project.samples/: Acris source samples to learn and play around with.tools/: Collection of tools and scripts, that aid development.