Big changes:
ci/woodpecker/push/debian Pipeline was successful
ci/woodpecker/push/nix Pipeline was successful
ci/woodpecker/push/fedora Pipeline was successful
ci/woodpecker/push/publish Pipeline was successful

Compiler and VM are now working well enough to support larger programs.
A test program is included and executed immediately upon running
the executable.

A more feature complete read-eval-print loop is planned.
This commit is contained in:
2026-04-26 00:55:43 +03:00
parent 0925b44ef7
commit d846046c4a
10 changed files with 52 additions and 102 deletions
+8 -3
View File
@@ -3,15 +3,20 @@ let ( let* ) = Result.bind;;
(* Try to interpret some test source code. *)
let some_source = "(define (+ a b) b)
(print 1)";;
let some_source = "(define (print-three a b c)
(print a)
(print b)
(print c))
(print-three 'hello 'world 'there)";;
(* I don't have any built-in functions at all rn, so we just use a dummy function *)
let bruh =
let* vm = Compiler.Emit.compile_src some_source in
print_endline "=== PROGRAM DISASSEMBLY";
Vm.Types.print_instrs vm.instrs;
print_endline "=== PROGRAM OUTPUT";
Vm.interpret vm;
Ok (print_endline "hello")
Ok ()
let _ = match bruh with
| Ok _ -> ()