1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-11 13:55:55 +03:00
mal/impls/nasm
Joel Martin 8a19f60386 Move implementations into impls/ dir
- Reorder README to have implementation list after "learning tool"
  bullet.

- This also moves tests/ and libs/ into impls. It would be preferrable
  to have these directories at the top level.  However, this causes
  difficulties with the wasm implementations which need pre-open
  directories and have trouble with paths starting with "../../". So
  in lieu of that, symlink those directories to the top-level.

- Move the run_argv_test.sh script into the tests directory for
  general hygiene.
2020-02-10 23:50:16 -06:00
..
core.asm Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
Dockerfile Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
env.asm Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
exceptions.asm Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
macros.mac Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
Makefile Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
printer.asm Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
reader.asm Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
README.md Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
run Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step0_repl.asm Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step1_read_print.asm Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step2_eval.asm Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step3_env.asm Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step4_if_fn_do.asm Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step5_tco.asm Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step6_file.asm Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step7_quote.asm Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step8_macros.asm Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
step9_try.asm Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
stepA_mal.asm Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
system.asm Move implementations into impls/ dir 2020-02-10 23:50:16 -06:00
types.asm Move implementations into impls/ dir 2020-02-10 23:50:16 -06: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.