A scheme to Arm64 compiler that keep simple for teaching purpose.
git submodule update --init
cd bdwgc
./autogen.sh
./configure
make -j 8
make install
raco exe -o scmc main.rkt
raco distribute dist scmc
scmc -e '(char=? #\c #\c)'
To learn more compiler options
scmc --help
The following problems are known in the current implementation and not going to fix!
- nested vector works badly(the root cause is first 64bits of vector layout stores length of vector, however, it be converted to pointer encoded value rather than length stored)
#(1 #(2))
produces#(2)
#(3 #(2 4))
produces#(2 #(2 #(2 ...
(a lots of#(2 ...)
here)
You're assume to familiar with arm64's assembly to contribute. A good start is:
- Arm64 Assembly Language Notes
- johannst/notes: Arm64
- Hello Silicon: How to program on Apple Silicon Macs
Compiler reference:
- An Incremental Approach to Compiler Construction
- Andy Keep - Writing a Nanopass Compiler
- Let's Build a Compiler series