A System Programming Language
- building from source
- flakes.nix
- download a pre-built binary
Required dependencies:
- gcc
- ld
- nasm
- make
Build options:
make compiler
- build the compiler. The compiler will appear inbuild/calias
.make altlib
- build the compiler and altlib. Public version of altlib will appear inbuild/altlib_ext
.make test
- build the compiler and altlib, run tests except performance tests.make perftest
- build the compiler and altlib, run performance tests.
For further usage preferably add a new environmental variable:
ALTLIB
- absolute path tobuild/altlib_ext
Required dependencies:
Enter the development shell for calias
:
nix develop github:ParfenovIgor/alias-c
Check that calias
is present:
calias
Check that ALTLIB
is set:
echo "$ALTLIB"
Note. Since the compiler is in the development process, writing even the simplest programs is not trivial. This purpose of this example is only a demonstration. Read the simple and working alias project on Alias Example Project.
include altlib."posix.al"
include altlib."stdio.al"
include altlib."test_allocator.al"
func ^._start() -> #V {
def allocator #TestAllocator
eval allocator&.init(1024)
defer eval allocator&.deinit()
def buffer := allocator&.alloc(256) as #1C
eval reads_(buffer)
eval puts_(buffer)
eval posix_exit(0)
}
Note. calias
can only compile, but not link (linking is very limited). You need to use ld
instead.
calias -c main.al -o main.o -i altlib $ALTLIB/include/
Contributing page on the wiki.