Original issue describing the change and converting the first set of
implementations: https://github.com/kanaka/mal/pull/592
Tracking issue for other implementations: https://github.com/kanaka/mal/issues/657
All normal tests pass, but REGRESS and self-hosting fail.
Steps:
display the results from jq without python
simplify/improve quasiquote
simplify replenv construction
Cosmetic:
Update the interpreter from latest Debian/Ubuntu.
move first core functions from steps4-A to core.jq
simplify interprocess communication between run and utils.jq
merge run and rts.py, simplify it
Update build system, syntax and library calls for zig 0.13.0.
Rewrite the build system so that the steps can build separately. Drop
intermediate symbolic links (unneeded complexity, confusing
timestamps).
Build with debugging options, this is a toy project full of memory
leaks.
Declare the allocators as global variables instead of passing and/or
storing always the same reference everywhere for no benefit.
Make apply_function a global variable instead of adding a reference to
EVAL in each function.
Pass arguments as a slice instead of using a different type for each
argument count.
There is no point in renaming default errors.
Remove a lot of reference counting and some indirection levels.
This fixes the current segmentation faults.
Create each object as soon as possible and use errdefer so that it is
deallocated if an exception occurs when computing its elemements.
Use a global variable to convey a MAL object alongside a thrown error.
Remove the unused logging_alloc module (but add a debug_alloc boolean
in types.zig).
In step4 the following fails to return 0:
```
(let* [b 0 f (fn* [] b)] (let* [b 1] (f)))
```
Just use the initEnv initializer in steps 3 and 4 (following the same
pattern used by step 5 on onwards).
This version is hopefully more readable.
It removes the specific exception for blank lines, which is not
required and obfuscates the repl loop for little benefit.
Remove unused dependencies.
Import explicit lists for clarity.
Avoid module::function prefixs, as some modules will be renamed
(critic: modules must be capitalized).
Add an explicit export list to core.pm, so that all symbols are not
exported by default.
Introduce a pr_list function, which is convenient and removes the need
to rename _pr_str (critic: a leading underscore means a private
function).
Uppercase core::ns (critic complains about lowercase exported
variables).
While at it, convert values to MAL functions on the fly.
Implement env->get with a loop instead of a recursion, for readability and efficiency.
Simplify mal_readline and avoid storing empty lines in the history.
Fix (false? 1) and (true? 0).
Change the type of the env.{find,get,set} key to a raw string.
Merge eval-ast into EVAL.
Implement DEBUG-EVAL.
Prevent defmacro! from mutating the original function.