mntmn 4f85691fef make the GUI kinda work on ARM hosted; readme update %!s(int64=6) %!d(string=hai) anos
..
legacy 5395a2c794 directory cleanup %!s(int64=9) %!d(string=hai) anos
os 4f85691fef make the GUI kinda work on ARM hosted; readme update %!s(int64=6) %!d(string=hai) anos
tests 2595d92211 fix broken nested parameter passing in functions; fix various demos %!s(int64=6) %!d(string=hai) anos
README.md 906ac43063 cleanup stage 1 for standalone sledge build %!s(int64=9) %!d(string=hai) anos
alloc.c d17b52de7c refactored signature/type system; support nested structs; refactor gfx lib to use surface and font structures; various fixes %!s(int64=9) %!d(string=hai) anos
alloc.h dcd180bc0f first working struct implementation %!s(int64=9) %!d(string=hai) anos
boot-os.l 7a05af33ab don't executed failed jitted code %!s(int64=6) %!d(string=hai) anos
build_arm.sh cc4b125491 build_arm.sh and some minor cleanup %!s(int64=6) %!d(string=hai) anos
build_arm_console.sh cc4b125491 build_arm.sh and some minor cleanup %!s(int64=6) %!d(string=hai) anos
build_win32.sh 129d568e4d first completely working x86 jit and working win32 compile target %!s(int64=9) %!d(string=hai) anos
build_x64.sh 02809f1beb build with -Wall without warnings; fix SDL scaling; finalize struct syntax; fix (let) related crash %!s(int64=9) %!d(string=hai) anos
build_x86.sh 567d5c69e4 sdl back in x86; simplify repl/editor spawn funcs %!s(int64=9) %!d(string=hai) anos
compiler_arm_hosted.c 4f85691fef make the GUI kinda work on ARM hosted; readme update %!s(int64=6) %!d(string=hai) anos
compiler_m68k.c 7a8db6744d working amiga demo %!s(int64=9) %!d(string=hai) anos
compiler_new.c 2595d92211 fix broken nested parameter passing in functions; fix various demos %!s(int64=6) %!d(string=hai) anos
compiler_new.h d17b52de7c refactored signature/type system; support nested structs; refactor gfx lib to use surface and font structures; various fixes %!s(int64=9) %!d(string=hai) anos
compiler_x64_hosted.c b1fa2aa5be Merge branch 'master' of https://github.com/mntmn/interim %!s(int64=9) %!d(string=hai) anos
compiler_x86.c 31e9af59d1 fixed x86 instructions; improved wm with clipping and focus follows mouse %!s(int64=9) %!d(string=hai) anos
jit_arm_raw.c 8d5c8de190 fix arm/rpi2 build %!s(int64=9) %!d(string=hai) anos
jit_m68k.c fe0907c1f7 fix x64 hosted stack alignment %!s(int64=9) %!d(string=hai) anos
jit_x64.c d17b52de7c refactored signature/type system; support nested structs; refactor gfx lib to use surface and font structures; various fixes %!s(int64=9) %!d(string=hai) anos
jit_x86.c 31e9af59d1 fixed x86 instructions; improved wm with clipping and focus follows mouse %!s(int64=9) %!d(string=hai) anos
minilisp.h dcd180bc0f first working struct implementation %!s(int64=9) %!d(string=hai) anos
reader.c 02809f1beb build with -Wall without warnings; fix SDL scaling; finalize struct syntax; fix (let) related crash %!s(int64=9) %!d(string=hai) anos
reader.h 18b31b47a7 move stack; cleanup; new mmu init; performance boost; stable on-screen REPL :3 %!s(int64=9) %!d(string=hai) anos
sledge.c 093ea1f0d8 Print final newline before exit %!s(int64=8) %!d(string=hai) anos
stream.c d17b52de7c refactored signature/type system; support nested structs; refactor gfx lib to use surface and font structures; various fixes %!s(int64=9) %!d(string=hai) anos
stream.h 3601120260 i386 tests %!s(int64=9) %!d(string=hai) anos
strmap.c 2eef008a16 merge and finalize mac os x fixes %!s(int64=9) %!d(string=hai) anos
strmap.h 906ac43063 cleanup stage 1 for standalone sledge build %!s(int64=9) %!d(string=hai) anos
unifont.bin 32524f7b0f fix string writer bug; fix editor exit crash; more compact font file; various fixes %!s(int64=9) %!d(string=hai) anos
unifont.png 5395a2c794 directory cleanup %!s(int64=9) %!d(string=hai) anos
utf8.c 906ac43063 cleanup stage 1 for standalone sledge build %!s(int64=9) %!d(string=hai) anos
utf8.h 906ac43063 cleanup stage 1 for standalone sledge build %!s(int64=9) %!d(string=hai) anos
writer.c 9eb4ab8d9a fix a bit of arm hosted stuff %!s(int64=6) %!d(string=hai) anos
writer.h 906ac43063 cleanup stage 1 for standalone sledge build %!s(int64=9) %!d(string=hai) anos

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