The small but powerfull Virtual machince.
LIVM stands for LISP Virtual Machine, as this VM is first intended to interpret a LISP langage.
DISCLAMER This is a project for fun, don't expect anything from it.
ASM examples can be found in the src/test/resources folder.
make
make run-nativeThis will create the livm native executable (see dependencies section) and run the
loop.lasm file. This show that the VM can execute the assembly langage.
make lasm-to-li
make run-liThis will compile the loop.lasm to src/test/resources/loop.li file and execute it.
This shows that the VM can execute binary li bytecode file.
The Virtual machine. It can ecexute li bytecode.
Assembly langage in a 'human-readable' format. Can be interpreted or compile to li by the virtual machine.
File extension: *.lasm
Disassembler
Bytecode representation of a programm for the livm. Can be executed by the virtual machine.
mvn clean packageWill build an executable jar.
Or using make:
make target/livm-0.0-SNAPSHOT.jarjava -jar target/livm-0.0-SNAPSHOT.jar --asm -f src/test/resources/loop.lasm
Will compile to a jar file and run it.
Or using make:
make run-asm [file=FILENAME]livm lasm and dilasm native executable can be compiled maven profiles:
mvn clean package -P livm
mvn clean package -P lasm
mvn clean package -P dilasm
Will compile to a native image (quite slow).
Or using make:
make livmYou can then run the livm executable
./livm --helpmake dilasmfirst compile from lasm to li, then back from li top lasm
./livm --asm -f src/test/resources/loop.lasm -o src/test/resources/loop.li
./dilasm src/test/resources/loop.li- Java 17
- Graalvm 22.2.0 (native-image)
The easiest way to get all dependecies required is to install GraalVM 22.2.0 JDK using sdkman:
sdk install java 22.2.r17-grl
Make sure your CLASSPATH environment variable does not contains any .character