1
1
mirror of https://github.com/kanaka/mal.git synced 2024-10-27 06:40:14 +03:00
Commit Graph

6 Commits

Author SHA1 Message Date
Joel Martin
1c5ac14e05 zig: move zig unpack path from /mal to /opt 2024-09-19 14:48:19 -04:00
Nicolas Boulenguez
0a24696ae1 zig: simplify the reader, fix a memory leak 2024-09-19 14:48:19 -04:00
Nicolas Boulenguez
8c7d495eea zig: build with 0.13.0, merge eval_ast, fix remaining issues
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).
2024-09-19 14:48:19 -04:00
Joel Martin
a2973ab0b8 xslt, c, zig: test for, fix seq parsing EOF errors
xslt:
- The reader was returning the an odd args error when a hash-map literal
  was not closed. This was because the the parsing error happened and
  then the odd args test happened after and overwrote the parsing error.
- Also, fix the read-string function so that if an error is set by the
  reader, this is converted to a full error that bubbles up.

c:
- read_list errors were not being detected/propagated in read_hash_map
  after calling read_list.

zig:
- reader errors were not being caught in the rep loop until step 8, so
  those errors in step6 and step7 were causing the REPL to exit.
2024-08-22 14:59:33 -05:00
Nicolas Boulenguez
fbfe6784d2 Change quasiquote algorithm
- 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
2020-08-11 01:01:56 +02:00
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