¶Mesche Progress Update
Last week I detailed my plans for creating a compiler toolchain for a new Lisp called Mesche. Today I’ll show some early progress on it and explain a bit of what I had to do to get this far!
You can check out the code on Sourcehut: https://git.sr.ht/~mesche/compiler
¶Areas
- Linker
- Assembler
- Basic program execution
¶Challenges
- Understanding the ELF format and generating it correctly
- x86 instruction encoding
401000: b8 01 00 00 00 mov $0x1,%eax 401005: 48 8b 1c 25 00 20 40 mov 0x402000,%rbx
¶Next steps
- Encoding (and decoding) more instructions
- Detecting instructions that use memory addresses, updating them
- Writing functions in assembly and calling them
¶Resources
- x86 Opcode Reference (coder64-abc, geek64-abc)
- x86-64 Instruction Encoding on osdev.org Wiki
- x86-64 SysV ABI Reference
- ELF-64 Object File Format Reference
- Understanding Intel Instruction Sizes (doesn’t mention 64-bit though)
¶Lisp Live Hacking
Let’s hack on a Lisp project! To make things interesting, I’ll let you choose:
- Gemini Exporter for Org Mode
- Mesche Compiler
- Music Player in Guile Scheme
Cast your vote here: https://fast-poll.com/poll/1387af43
We ended up working on the Gemini exporter, you can find the code here: