Creating A Language Using Only Assembly Language
Creating A Language Using Only Assembly Language
using only
assembly language.
Kernel/VM Tanken-tai #11
Koichi Nakamura
Codes
https://github.com/nineties/amber
Profile
Koichi Nakamura
twitter: @9_ties
libc etc.
flex/bison etc.
StrategyBootstrapping
Write language 1 by assembly language
Write a little bit high-level language 2 by language 1
here now
code generation
Wrote eval
No memory management
mmap and munmap is the only function
malloc, free
macros
An application of meta-programming
The table of instructions of the VM
vm_instructions
Disassembler
Linker
Exception handling
Delimited Continuation
Wrote an assembler
The former assembler
assembles codes ahead of
time and run on rlci
This assembler assembles
codes just in time and run
on rlvm
fills addresses by
backpatching
object system
VM
resource management
Wrote closure-conversion
Wrote parsers
compiles parsers at run-time
each parser is a usual Amber object (closure)
parsers
compile
compiler
pattern-matching engine
object system
VM
0x40091eb851eb851f
strtod, sprintf
Summary
I could reach relatively high-level language. Feel satisfied.
lang. for
writing VM
compiler
impl.
as
language
tool
rowl0
rlc
impl.
rlvm
rowl-core
rlci
rowl1
Amber
compiler
interpreter
self-extension
linker
disassembler
run