fbfe6784d2
- Add a `vec` built-in function in step7 so that `quasiquote` does not require `apply` from step9. - Introduce quasiquoteexpand special in order to help debugging step7. This may also prepare newcomers to understand step8. - Add soft tests. - Do not quote numbers, strings and so on. Should ideally have been in separate commits: - elisp: simplify and fix (keyword :k) - factor: fix copy/paste error in let*/step7, simplify eval-ast. - guile: improve list/vector types - haskell: revert evaluation during quasiquote - logo, make: cosmetic issues |
||
---|---|---|
.. | ||
core.asm | ||
Dockerfile | ||
env.asm | ||
exceptions.asm | ||
macros.mac | ||
Makefile | ||
printer.asm | ||
reader.asm | ||
README.md | ||
run | ||
step0_repl.asm | ||
step1_read_print.asm | ||
step2_eval.asm | ||
step3_env.asm | ||
step4_if_fn_do.asm | ||
step5_tco.asm | ||
step6_file.asm | ||
step7_quote.asm | ||
step8_macros.asm | ||
step9_try.asm | ||
stepA_mal.asm | ||
system.asm | ||
types.asm |
x86_64 NASM implementation
Notes and known issues:
-
No library dependencies, only Linux system calls
-
Simple readline implemented, just supporting backspace for editing
-
Reference counting used for memory management. No attempt is made to find circular references, so leaks are possible. In particular defining a function with def! creates a circular reference loop.
-
The exception/error handling just resets the stack and jumps to a handler, so does not release memory
-
Memory is allocated by two fixed-size allocators (
Cons
andArray
objects) which have limits specified in types.asm. If more memory is needed then this must currently be done at compile-time, but adding sys_brk calls could be done. -
The hash map implementation is just a list of key-value pairs. Moving symbols around in the core environment makes a significant difference (20-30%) to the performance test. A simple optimisation could be to move items when found to the start of the list so that frequently searched keys are nearer the front.
-
conj
function not yet implemented -
*env*
symbol evaluates to current Environment.