mntmn 1fb368a23b i386 jit baby steps 9 lat temu
..
legacy 5395a2c794 directory cleanup 9 lat temu
os d3bdbb459f new arg handling works on arm 9 lat temu
tests 7348d5286e some work on GTN 9 lat temu
README.md 906ac43063 cleanup stage 1 for standalone sledge build 9 lat temu
alloc.c 5f41241d1a first dumb repl on x86 9 lat temu
alloc.h e202295a57 merged master 9 lat temu
build_rpi.sh 3a1fa2124e raw tty keyboard device 9 lat temu
build_x64.sh a119388545 directory read in posixfs; terminal polishing; bitops tests 9 lat temu
compiler_arm_hosted.c 88a2590b49 sledge file input support 9 lat temu
compiler_new.c 1fb368a23b i386 jit baby steps 9 lat temu
compiler_new.h 46b1c33aa2 eval tracing WIP 9 lat temu
compiler_x64_hosted.c 29c4c1079f stabilization of editor; x64 fixes; some cleanup 9 lat temu
compiler_x86.c 1fb368a23b i386 jit baby steps 9 lat temu
jit_arm_raw.c c316487f41 hardening of some builtins 9 lat temu
jit_x64.c c316487f41 hardening of some builtins 9 lat temu
jit_x86.c 1fb368a23b i386 jit baby steps 9 lat temu
minilisp.h 4171a92937 fixed fatfs crashes, stable editor, bugfixes 9 lat temu
mksprite.sh 6db8a181bf mario experiments 9 lat temu
reader.c bfcc7b8b0a el cheapo type inference for let 9 lat temu
reader.h 18b31b47a7 move stack; cleanup; new mmu init; performance boost; stable on-screen REPL :3 9 lat temu
sledge.c 1fb368a23b i386 jit baby steps 9 lat temu
stream.c 3a1fa2124e raw tty keyboard device 9 lat temu
stream.h 3601120260 i386 tests 9 lat temu
strmap.c 906ac43063 cleanup stage 1 for standalone sledge build 9 lat temu
strmap.h 906ac43063 cleanup stage 1 for standalone sledge build 9 lat temu
unifont.bin 32524f7b0f fix string writer bug; fix editor exit crash; more compact font file; various fixes 9 lat temu
unifont.png 5395a2c794 directory cleanup 9 lat temu
utf8.c 906ac43063 cleanup stage 1 for standalone sledge build 9 lat temu
utf8.h 906ac43063 cleanup stage 1 for standalone sledge build 9 lat temu
writer.c 4171a92937 fixed fatfs crashes, stable editor, bugfixes 9 lat temu
writer.h 906ac43063 cleanup stage 1 for standalone sledge build 9 lat temu

README.md

mnt sledge

sledge JIT-compiles a minimal subset of LISP to a minimal subset of x64 or armv5 machine code.

dependencies

  • gcc (for building and for x64 JIT. not required for ARM JIT.)
  • optionally SDL or SDL2 for windowed framebuffer.

building (x64)

  1. Build using ./build.sh

building (rpi/ARM)

  1. Build using ./build_rpi.sh

usage

./sledge

sledge> (def my-function (fn a b (* a (+ a b))))

JIT ---------------------
push %rdi
jmp f1_0x7f6a0144ca98
f0_0x7f6a0144ca98:
push %rdi
movq %r12, %rdi
mov (%rdi), %rdi
movq %r13, %rsi
mov (%rsi), %rsi
addq %rsi, %rdi
movq %rdi, %rsi
pop %rdi
movq %r12, %rdi
mov (%rdi), %rdi
imulq %rsi, %rdi
mov $0x406f02, %rax
callq *%rax # alloc_int
ret
f1_0x7f6a0144ca98:
mov $0x7f6a0144ca98, %rax
movq %rax, %rsi
pop %rdi
movq %rax, %rsi
mov $0x7f6a0144c750, %rdi
mov $0x401b21, %rax
callq *%rax # insert_global_symbol
ret
-------------------------

sledge> (my-function 35 36)

JIT ---------------------
mov $0x7f6a0144cb28, %r12
mov $0x7f6a0144cb58, %r13
mov $0x7f6a16a8b003, %rax
callq *%rax # lambda
ret
-------------------------

2485