Leviathan is a Lisp-inspired programming language. It is a toy project and not meant for serious use cases.
Leviathan compiles to bytecode for Urban engine.
The language currently only supports an assembler dialect but will also support a more comfortable dialect with variables etc. in the future.
; main.lvt
(mod assembly)
(static message "Hello world!\n")
(-label main (do
(mov r0 1u) ; move 1 into r0 (file descriptor)
(ref r1 message) ; load address of message into r1
(ldr r2 r1 -8) ; load the length of the string into r2
(int 1u) ; write interrupt
(halt) ; halt the process
))
A project consists of:
- A
build.lvt.toml
file with the build configuration - A
src
directory with the source files - The
main.lvt
source file in thesrc
directory with amain
function - Other source files in the
src
directory
The build configuration looks like this:
[package]
name = "my-package"
version = "1.0.0"
To build the project run
lvt build
in the project directory.
The binary will be placed in out/project-name.bin
with project-name
getting replaced with the name in your build configuration.
To run the compiled binary run
urban run path/to/binary
with the path to the binary.