1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-13 11:23:59 +03:00
mal/nasm
Joel Martin dd7a4f55f3 Test uncaught throw, catchless try* . Fix 46 impls.
Fixes made to: ada, c, chuck, clojure, coffee, common-lisp, cpp,
crystal, d, dart, elm, erlang, es6, factor, fsharp, gnu-smalltalk,
groovy, guile, haxe, hy, js, livescript, matlab, miniMAL, nasm, nim,
objc, objpascal, ocaml, perl, perl6, php, plsql, ps, python, r,
rpython, ruby, scheme, swift3, tcl, ts, vb, vimscript, wasm, yorick.

Catchless try* test is an optional test. Not all implementations
support catchless try* but a number were fixed so they at least don't
crash on catchless try*.
2018-12-12 14:18:26 -06:00
..
core.asm Moved macro-related functions to start of core Env 2017-12-27 23:34:30 +00:00
Dockerfile Dockerfile xenial and binutils install 2018-01-02 23:37:42 +00:00
env.asm Step 5: Tail call optimisation 2017-11-11 01:04:11 +00:00
exceptions.asm Moving error handler into exceptions.asm 2017-12-26 23:41:15 +00:00
macros.mac Adding map and throw functions 2017-12-08 08:19:57 +00:00
Makefile Add clean target 2018-01-03 15:43:22 +00:00
printer.asm Fix bug in rest and println 2017-12-14 23:06:19 +00:00
reader.asm lua, nasm, perl, rexx, vimscript: fix errors. 2018-11-30 14:57:46 -06:00
README.md Adding README.md file and Make all target 2017-12-27 23:33:03 +00:00
run Step0 (input/output) passes tests 2017-10-09 00:10:03 +01:00
step0_repl.asm Tidying, minimising differences between steps 2018-01-04 16:07:01 +00:00
step1_read_print.asm Tidying, minimising differences between steps 2018-01-04 16:07:01 +00:00
step2_eval.asm Tidying, minimising differences between steps 2018-01-04 16:07:01 +00:00
step3_env.asm Tidying, minimising differences between steps 2018-01-04 16:07:01 +00:00
step4_if_fn_do.asm Tidying, minimising differences between steps 2018-01-04 16:07:01 +00:00
step5_tco.asm Tidying, minimising differences between steps 2018-01-04 16:07:01 +00:00
step6_file.asm Tidying, minimising differences between steps 2018-01-04 16:07:01 +00:00
step7_quote.asm Tidying, minimising differences between steps 2018-01-04 16:07:01 +00:00
step8_macros.asm Tidying, minimising differences between steps 2018-01-04 16:07:01 +00:00
step9_try.asm Test uncaught throw, catchless try* . Fix 46 impls. 2018-12-12 14:18:26 -06:00
stepA_mal.asm Test uncaught throw, catchless try* . Fix 46 impls. 2018-12-12 14:18:26 -06:00
system.asm Add time-ms function 2017-12-15 23:11:20 +00:00
types.asm All tests pass 2017-12-27 17:32:01 +00:00

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 and Array 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.