aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-10-08 10:25:59 +0200
committerBad Diode <bd@badd10de.dev>2021-10-08 10:25:59 +0200
commit96d27c2a3e1a0fa0878beb3f9cd02f4b4ed8fdbb (patch)
tree9ec40c0c37630d1b6a7546cc8c9f09fe65809861 /README.md
downloadbdl-96d27c2a3e1a0fa0878beb3f9cd02f4b4ed8fdbb.tar.gz
bdl-96d27c2a3e1a0fa0878beb3f9cd02f4b4ed8fdbb.zip
Initial commit w/ small readline echo function
Diffstat (limited to 'README.md')
-rwxr-xr-xREADME.md53
1 files changed, 53 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100755
index 0000000..4caf1c3
--- /dev/null
+++ b/README.md
@@ -0,0 +1,53 @@
1# Bad Diode's Lisp
2
3For some time I've been meaning to learn more about compilers and programming
4language theory. And so I found myself again delving into a rabbit hole of
5wheel-reinvention for the purpose of fun and learning.
6
7The goals for this project are to build a programming language that can be
8interpreted directly from a VM and with support for compilation to assembly
9(`x86_64` and/or `ARM (thumb or aarch64)`). It could make sense to output
10bytecode for LLVM to take advantage of the built in optimizations, but let's
11just go one step at a time. At the time I know some ARM assembly, but I'm not so
12versed in `x86_64` and know nothing of LLVM bytecode.
13
14I've chosen to implement a Lisp, perhaps a subset of Scheme. The syntax is not
15so important for now, maybe in the future the compiler will take a different
16home-brew language, but hopefully this helps setting the fundamentals for
17a minimal working compiler. In principle, we could keep the internal
18representation and language working as a lisp, but with a different external
19syntax.
20
21The language should have built-in structures for dynamic arrays, hash tables,
22strings (and string views). It should be suitable for use in embedded systems
23and be linked seamlessly with other compiled objects.
24
25Accessing system resources, such as stdio or graphics could be done via function
26calls to the give APIs. This should help decouple the CPU logic from hardware,
27hopefully facilitating porting programs to different platforms (GBA, Rasberry
28Pi, etc.).
29
30The current plan is to build a bootstrap interpreter in C that can be used to
31generate the self-hosted version of itself. I'll try to document the process
32here as best as I can.
33
34The bootstrap implementation should be kept simple, since we can focus on
35optimization once we have a self-hosting compiler.
36
37# Resources
38
39- [Structure and Interpretation of Computer Programs][sicp]
40- [Crafting Interpreters][crafting-interpreters]
41- [Building a Scheme from scratch][scheme-from-scratch]
42- [Compiling a Lisp][compiling-a-lisp]
43- [An Incremental Approach to Compiler Construction][ghuloum11]
44- [Make-A-Lisp Guide][mal]
45- [An Introduction to Scheme and its Implementation][intro-to-scheme-and-imp]
46
47[sicp]: https://mitpress.mit.edu/sites/default/files/sicp/index.html
48[crafting-interpreters]: https://craftinginterpreters.com/
49[scheme-from-scratch]: http://peter.michaux.ca/articles/scheme-from-scratch-introduction
50[compiling-a-lisp]: https://bernsteinbear.com/blog/compiling-a-lisp-0/
51[ghuloum11]: http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf
52[mal]: https://github.com/kanaka/mal/blob/master/process/guide.md
53[intro-to-scheme-and-imp]: https://www.cs.utexas.edu/ftp/garbage/cs345/schintro-v14/schintro_toc.html#SEC271