1
1
mirror of https://github.com/kanaka/mal.git synced 2024-08-17 09:40:21 +03:00
Commit Graph

83 Commits

Author SHA1 Message Date
Nicolas Boulenguez
9307c5a8ce sml: allow macro argument for apply core function 2024-08-07 13:25:02 -05:00
Nicolas Boulenguez
c9f7b5a1f8 dockerfiles: improve consistency, link python to python3
Explictly select python 3.  The `python2` and `python` packages will
be removed from Ubuntu.  Until each call site is fixed, install a
/usr/local/bin/python symbolic link as a non-intrusive work-around
(.deb packages do not interfer with /usr/local).

Add an explicit maintainer for bbc-basic.

Undo some cosmetic changes in order to reduce the global diff, this
merge request will probably be sqashed before acceptance.

Move lib{readline,edit}-dev out of the generic part.

Use existing .deb packages for GHDL and vim.
2024-08-05 17:02:34 -05:00
Nicolas Boulenguez
033892777a Merge eval-ast and macro expansion into EVAL, add DEBUG-EVAL
See issue #587.
* Merge eval-ast and eval into a single conditional.
* Expand macros during the apply phase, removing lots of duplicate
  tests, and increasing the overall consistency by allowing the macro
  to be computed instead of referenced by name (`((defmacro! cond
  (...)))` is currently illegal for example).
* Print "EVAL: $ast" at the top of EVAL if DEBUG-EVAL exists in the
  MAL environment.
* Remove macroexpand and quasiquoteexpand special forms.
* Use pattern-matching style in process/step*.txt.

Unresolved issues:
c.2: unable to reproduce with gcc 11.12.0.
elm: the directory is unchanged.
groovy: sometimes fail, but not on each rebuild.
nasm: fails some new soft tests, but the issue is unreproducible when
  running the interpreter manually.
objpascal: unreproducible with fpc 3.2.2.
ocaml: unreproducible with 4.11.1.
perl6: unreproducible with rakudo 2021.09.

Unrelated changes:
Reduce diff betweens steps.
Prevent defmacro! from mutating functions: c forth logo miniMAL vb.
dart: fix recent errors and warnings
ocaml: remove metadata from symbols.

Improve the logo implementation.
Encapsulate all representation in types.lg and env.lg, unwrap numbers.
Replace some manual iterations with logo control structures.
Reduce the diff between steps.
Use native iteration in env_get and env_map
Rewrite the reader with less temporary strings.
Reduce the number of temporary lists (for example, reverse iteration
with butlast requires O(n^2) allocations).
It seems possible to remove a few exceptions: GC settings
(Dockerfile), NO_SELF_HOSTING (IMPLS.yml) and step5_EXCLUDES
(Makefile.impls) .
2024-08-05 11:40:49 -05:00
Nicolas Boulenguez
03b6cfd45c Stop evaluating map keys
Neither keywords nor strings are modified by evaluation, so evaluating
map keys is a no-op.  Document this in the guide.
2021-12-11 09:46:35 -06:00
Fabian
7e015062a9 SML CI: add mosml, mlton, setup GitHub workflow 2021-05-02 17:35:40 -05:00
Fabian
9798302546 SML portability: use LargeInt for time-ms 2021-05-02 17:35:40 -05:00
Fabian
a2d6e66030 add SML README 2021-05-02 17:35:40 -05:00
Fabian
4594bff0e3 formatting 2021-05-02 17:35:40 -05:00
Fabian
f3e4237e8d remove unused function 2021-05-02 17:35:40 -05:00
Fabian
177940d90c Dockerize SML, make dist 2021-05-02 17:35:40 -05:00
Fabian
d000ac7398 SML: Step A 2021-05-02 17:35:40 -05:00
Fabian
c75c9ebda9 rename makeList etc. 2021-05-02 17:35:40 -05:00
Fabian
ff01165584 reorganize core.sml 2021-05-02 17:35:40 -05:00
Fabian
6a2ae42e5c fix defmacro behavior 2021-05-02 17:35:40 -05:00
Fabian
22937e5987 add metadata 2021-05-02 17:35:40 -05:00
Fabian
1ed1b35ed9 stubs for self hosting 2021-05-02 17:35:40 -05:00
Fabian
3edde8cc2e add reader macro ^ 2021-05-02 17:35:40 -05:00
Fabian
06894e6c8b add *host-language* and repl welcome 2021-05-02 17:35:40 -05:00
Fabian
9c6ae5d723 add core readline 2021-05-02 17:35:40 -05:00
Fabian
6b14be1285 step A scaffolding 2021-05-02 17:35:40 -05:00
Fabian
4cb61f5426 SML: Step 9 2021-05-02 17:35:40 -05:00
Fabian
f8faaec47f add core collection functions 2021-05-02 17:35:40 -05:00
Fabian
f2a37a3ae4 add core keyword, symbol and type predicates 2021-05-02 17:35:40 -05:00
Fabian
a8d4e41be6 make rep handle mal exceptions 2021-05-02 17:35:40 -05:00
Fabian
e9cd0923c2 add core nil?, true?, false?, symbol? 2021-05-02 17:35:40 -05:00
Fabian
b7cc870f89 fix eval bugs in bind 2021-05-02 17:35:40 -05:00
Fabian
bfaeb3bfe9 add core map,apply 2021-05-02 17:35:40 -05:00
Fabian
ce4940014c formatting 2021-05-02 17:35:40 -05:00
Fabian
4fe3a8d750 add throw, try*, catch* 2021-05-02 17:35:40 -05:00
Fabian
49f9904b05 step 9 scaffolding 2021-05-02 17:35:40 -05:00
Fabian
fb799bf8e3 split out special form evaluation 2021-05-02 17:35:40 -05:00
Fabian
e0d52cafec explicit error reporting in step8 2021-05-02 17:35:40 -05:00
Fabian
79962a1e17 refactor bindings 2021-05-02 17:35:40 -05:00
Fabian
e0925d559d SML: Step 8 2021-05-02 17:35:40 -05:00
Fabian
10f9022397 add core nth, first, rest 2021-05-02 17:35:40 -05:00
Fabian
aa6030040e step 8 scaffolding 2021-05-02 17:35:40 -05:00
Fabian
0c18399f52 fix strings in step 1 tests 2021-05-02 17:35:40 -05:00
Fabian
40f965a80e SML: Step 7 2021-05-02 17:35:40 -05:00
Fabian
238f9bd677 add core vec function 2021-05-02 17:35:40 -05:00
Fabian
fbcfb5962e add cons and concat 2021-05-02 17:35:40 -05:00
Fabian
f8400db56d step 7 scaffolding 2021-05-02 17:35:40 -05:00
Fabian
fcf6a20415 fix *ARGV* bug 2021-05-02 17:35:40 -05:00
Fabian
75814cb6f4 add & varargs and not 2021-05-02 17:35:40 -05:00
Fabian
c6a73d68f0 add keywords, vectors, maps 2021-05-02 17:35:40 -05:00
Fabian
4b3d031f4c cleanup closures after env changes 2021-05-02 17:35:40 -05:00
Fabian
9fc9f1c112 @ reader macro 2021-05-02 17:35:40 -05:00
Fabian
33da2f099c SML: Step 6 2021-05-02 17:35:40 -05:00
Fabian
2f046fbefd fix comment bug in reader 2021-05-02 17:35:40 -05:00
Fabian
e160b83391 make envs mutable 2021-05-02 17:35:40 -05:00
Fabian
3224c1b856 core atom functions 2021-05-02 17:35:40 -05:00