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

554 Commits

Author SHA1 Message Date
OldLiu
01f5ba3cf6 vbs: finish step2 2024-08-15 09:15:44 -05:00
OldLiu
f1a92861b5 vbs: fix hashtable, string, error handle 2024-08-15 09:15:44 -05:00
OldLiu
fb18d41e3e vbs: add extra code data detect 2024-08-15 09:15:44 -05:00
OldLiu
4e3bfa14e2 vbs: add error handling,macros, string, boolean, null 2024-08-15 09:15:44 -05:00
OldLiu
e0cb478dea vbs: vbs step 0&1 2024-08-15 09:15:44 -05:00
OldLiu
72ff664c6d vbs: batch impl init 2024-08-15 09:15:44 -05:00
Joel Martin
0d32585d6b python.2: fix self-host by adding fn?, macro?.
Also add number? and string? which aren't technically required for
self-host but are easy to implement.
2024-08-14 13:24:37 -05:00
Joel Martin
c4ab84b116 tests/stepA: fn?, macro? required for self-host.
- fn? required here: 3f6a40f708
- macro? required here: af2279d18d
2024-08-14 13:24:37 -05:00
Joel Martin
99d3ce5464 haxe: fix core readline function: print prompt
Use the prompt provided as a parameter and not just "user> ".
2024-08-13 14:59:18 -05:00
Joel Martin
d1afe8ddb5 awk: fix regex warnings (extraneous escaping) 2024-08-13 14:59:18 -05:00
Joel Martin
e62567fb8f awk: disable env/types debug to fix self-host tests 2024-08-13 14:59:18 -05:00
Joel Martin
c76aa8c34b tests/step1: add list within list quasiquote test. 2024-08-13 10:00:18 -05:00
Garklein
82b5f367a2
Add expected result for fn/hash-map interaction test 2024-08-09 16:29:50 -07:00
Adam Gashlin
e8179fbb8f
Fixes for guide text (#611)
* Fixes for typos and grammar

* Remove -rp from diff command line. These flags don't make sense on single pseudocode text files.
2024-08-09 16:02:38 -07:00
Jordi Iñigo
47395d754d pprint properly prints hash-maps 2024-08-09 17:40:29 -05:00
Nicolas Boulenguez
205cf51a7d latex3: require ubuntu:24.04 in the Dockerfile 2024-08-08 15:40:26 -05:00
Nicolas Boulenguez
6b8424bf92 latex3: add non-interactive apt-get option to Dockerfile 2024-08-08 15:40:26 -05:00
Nicolas Boulenguez
e28b72752e latex3: fix time-ms from seconds to milliseconds, register in IMPLS.yml 2024-08-08 15:40:26 -05:00
Nicolas Boulenguez
00d168fdca latex3: new implementation
Self hosting fails at step4 because of exceeded TeX capacity.
2024-08-08 15:40:26 -05:00
Nicolas Boulenguez
5808977f9f tests: improve consistency with the key not found error message
Never require quotes around the symbol.
2024-08-08 15:40:26 -05:00
Nicolas Boulenguez
24d82e4fcf wasm: prevent macros from mutating functions 2024-08-08 14:05:01 -05:00
Nicolas Boulenguez
91f9877935 wasm: backport recent changes to steps0-9 2024-08-08 14:05:01 -05:00
Nicolas Boulenguez
0125507b0f wasm: merge EVAL_AST into EVAL
EVAL_AST is kept but only applies to sequences
2024-08-08 14:05:01 -05:00
Nicolas Boulenguez
d27d374834 wasm: implement DEBUG-EVAL 2024-08-08 14:05:01 -05:00
Nicolas Boulenguez
fd686fc9f2 wasm: simplify EVAL_AST without br_table 2024-08-08 14:05:01 -05:00
Nicolas Boulenguez
1c4a08efbd wasm: simplify some conditionals, remove duplicate assignments 2024-08-08 14:05:01 -05:00
Nicolas Boulenguez
c9970d7077 wasm: style changes in Makefile and Dockerfile 2024-08-08 14:05:01 -05:00
Joel Martin
9773dba75f wasm: downgrade node from 18 to 16 since ffi builds there
With node 18, building ffi module fails.
2024-08-08 11:26:53 -05:00
Joel Martin
f1d24730eb wasm: update image to Ubuntu 20.04. Update runtimes
- node 10 -> node 18
- wasmtime v0.8.0-ish -> wasmtime v3.0.0
- wasmer 0.12.0-ish -> wasmer 2.0.0

Also, update ffi-napi to 4.0.3.

Comment out wac/wax/wace build since these don't currently work.
2024-08-08 10:52:27 -05:00
Joel Martin
dff0977d3d wasm: lucet no longer exists (merged into wasmtime). 2024-08-08 10:52:27 -05:00
Nicolas Boulenguez
37f62250a4 python: various simplifications
Use raw or multiline string litterals to make some hard-coded strings
more readable.

Replace some lambda constructs with more idiomatic generator
expressions, removing several temporary sequences (conversions,
contatenations, slices, arguments).

Replace definitions with assignments when possible.

Replace most python2/3 wrappers with code compatible with both
versions.  Use a non-printable ASCII characters instead of Unicode
characters (in order to avoid unicode in python2).

core:
Close file open by 'slurp' after reading.
coll_Q: remove as obsolete.
conj: do not preserve metadata.

env:
Replace find with an optional argument to get.
Search in outer environments with a loop instead of a recursion.
(python is not intended for large recursions).

readline:
Copy the example from the docs.
Write the history once.

mal_types:
clone: copy.copy() everything except callables.
functions: construct fn* functions in steps, where they are used
  (there was no encapsulation anyway)
Derive List and Vector from tuple, which is more efficient than list
for immutable structures.  Remove the need for __getitem__ stuff.
maps: provide an asPairs iterator.

printer:
Introduce a pr_list helper like many other implementations.

steps:
Remove obviously backported stuff from first steps.
Port forward the limitation of the exception backtrace size from step5
to later steps, so that REGRESS=1 does not crash stepA tests.
Fix the detection of special forms (strings were accepted as well as
symbols).
Let try* benefit from TCO.
2024-08-08 10:10:13 -05:00
Nicolas Boulenguez
c64f6f2357 make: trivial 2024-08-08 09:15:01 -05:00
Nicolas Boulenguez
446964e734 make: improve efficiency and encapsulation
Readability
* Use implicit parameter transmission ($(_list?) instead of $(call
  _list?,$1),
  first/lastword instead of word 1/words,
  $1 instead of $(1).
* Use an undefined $(rem) macro and some automatic stripping (if,
  foreach) to indent code with less calls to `strip` functions.
* Name the Make macro implementing a MAL core function exactly like the
  function (modulo the encoding above) and simplify core_ns accordingly.
* Replace empty results representing `nil` with explicit MAL values.
* Implement large conditionals with a computed variable name, as already
  done in printer.mk.  For QUASIQUOTE and EVAL, this reduces a lot the
  diff between steps.
* Represent the reader state as an explicit global variable instead of
  passing the same name as argument again and again.
* Merge read-atom into read-form so that the switch on first character
  is more visible.

Encapsulation
* Hide most representations into types.mk.
* Implement the type as a suffix in order to avoid a conditional in
  _obj_type.
* Implement _error with throw.
* Create distinct types for keywords and macros.
* Move most metadata and atom stuff from core.mk to types.mk.
* Move parameter association from env to types because it hides more
  about the representation of functions.

Representation
* Encode Make special characters in all strings/keywords/symbols, so
  they can be used directly as spaced words and/or variable names for
  map keys. (The encoding adding separating characters is kept for
  read-string and seq).
* Change representation of numbers/strings/keywords/symbols, reducing
  the number of Make variables.

Various
* Allow keyword argument for keyword core function.
* Shorten time-mes,slurp,readline...
* Remove obsolete stuff:
  * `get` and `contains?` for vectors
  * `count` for hash-maps
  * `_join` from util.mk.
  * `type` from core.mk.
* Add a function listing env_keys for DEBUG-EVAL.
* Fix some includes.
2024-08-08 09:15:01 -05:00
Nicolas Boulenguez
3f6a40f708 mal impl: report more errors in step files 2024-08-07 13:25:02 -05:00
Nicolas Boulenguez
2304fea342 mal impl: stop returning a value from env-set
This improves readability because the return value was only a trick to
shorten `def!` and `defmacro!` and was ignored everywhere else.

As a side effect, this probably improves efficiency, as `let*` is the
most frequent caller.
2024-08-07 13:25:02 -05:00
Nicolas Boulenguez
af2279d18d mal impl: use native macro? core function
This change requires that the apply core function accepts macros and
functions indifferently, update guide and tests accordingly.
2024-08-07 13:25:02 -05:00
Nicolas Boulenguez
79458ba641 vimscript: allow macro argument for apply core function 2024-08-07 13:25:02 -05:00
Nicolas Boulenguez
9307c5a8ce sml: allow macro argument for apply core function 2024-08-07 13:25:02 -05:00
Nicolas Boulenguez
c324a4ea52 prolog: allow macro argument for apply core function 2024-08-07 13:25:02 -05:00
Nicolas Boulenguez
9a5a94cf27 nasm: allow macro argument for apply core function 2024-08-07 13:25:02 -05:00
Nicolas Boulenguez
4aa2c7edf7 haskell: allow macro argument for apply core function 2024-08-07 13:25:02 -05:00
Nicolas Boulenguez
e942621048 fsharp: allow macro argument for apply core function 2024-08-07 13:25:02 -05:00
Nicolas Boulenguez
140dcb0987 erlang: allow macro argument for apply core function 2024-08-07 13:25:02 -05:00
Nicolas Boulenguez
a734ce082b ada.2: allow macro argument for apply core function 2024-08-07 13:25:02 -05:00
Nicolas Boulenguez
253cdf1ae5 rust: update and merge eval-ast
Remove unneeded intermediate executable files.
Remove Cargo.lock from version control system.
Update dependency versions.
Update Dockerfile (converge to update-some-dockerfiles branch).
Apply changes suggested by rustfmt and clippy, or enforced by rustc.
Remove several unneeded clone().
Merge eval and eval-ast, remove quasiquoteexpand and macroexpand.
Report more errors during startup.
2024-08-07 12:55:39 -05:00
Søren Sjørup
ec15d215c1 Javascript: parseFloat does not take a base parameter 2024-08-06 15:46:24 -05:00
Christoffer Ekeroth
b50380f040 Remove package-lock.json from .gitignore files
The package-lock.json file is intended to be checked in to source
control in order to make builds reproducible; without
a package-lock.json file `npm install` becomes non-deterministic.

See e.g.
https://docs.npmjs.com/cli/v8/configuring-npm/package-lock-json:

> package-lock.json is automatically generated for any operations where
> npm modifies either the node_modules tree, or package.json. It describes
> the exact tree that was generated, such that subsequent installs are
> able to generate identical trees, regardless of intermediate dependency
> updates.
>
> This file is intended to be committed into source repositories, and
> serves various purposes:
2024-08-06 15:28:00 -05:00
François Lamboley
69db481767 Update README.md
Fix Xcode capitalization
2024-08-06 14:57:50 -05:00
jero98772
e2d25044d5 solve issue Floats don't work in the python implementation. #646 2024-08-06 12:49:06 -05:00
Joel Martin
062fb6f66e common-lisp: fix build with sbcl 2.0.1.debian
The update from ubuntu:vivid to ubuntu:20.04 update the version of sbcl
from 1.2.4.debian to 2.0.1.debian. This resulted in the cl-launch based
build process no longer working: dependencies were not resolved (but
running it several times would eventually resolve them. So use an sbcl
build command directly when building for sbcl.

Note: updating the image to ubuntu:24.04 upgrades the version of sbcl to
2.2.9.debian. Something about that version breaks how we do hash-maps.
They become temperamental: hash-map creation often results in a nil
object returned and doing (get hm key) usually results in nil returned
even if the key shows as being present.
2024-08-06 12:08:31 -05:00
Nicolas Boulenguez
448d26aab6 ruby.2: fix (rest (list 6)) 2024-08-06 10:50:31 -05:00
Joel Martin
2253ce6b57 ruby: update Dockerfile to 24.04 2024-08-06 09:51:31 -05:00
Nicolas Boulenguez
bebd906a3e ruby: use pattern matching, remove double negations, simplify try* 2024-08-06 09:50:13 -05:00
Nicolas Boulenguez
9e1d457dc4 ruby: let varargs functions pass a mal list instead of a ruby array
Fixes some tests like
((fn* (& more) (list? more)) 1 2 3)
2024-08-06 09:50:06 -05:00
Joel Martin
b423d350b7 elm: fix Makefile SOURCES list. 2024-08-06 09:05:52 -05:00
Joel Martin
f172407be6 elm: update Dockerfile to ubuntu:24.04.
Add DEBIAN_FRONTEND=noninteractive to bypass tzdata interactive query.
2024-08-06 08:40:59 -05:00
Nicolas Boulenguez
e984ed8801 elm: merge more ideas from #450
Various trivial changes reducing the diff to #450.

Dockerfile: npm already depends on nodejs

Core.elm: change profile of deepEquals instead of uncurrying before
each call.
2024-08-06 08:24:09 -05:00
Nicolas Boulenguez
0068653bf9 elm: merge ideas from #450
It was necessary to rename some ambiguous variables. Some more names
could probably be changed in order to reduce the diff with #450 (my
names were choosen in order to reduce the diff with master...)

Peek ideas from #450:
- sort imports
- skip a line between '->' or before 'else'
- no indentation after 'in'
- fix indentation when it was only intended to reduce diff
- remove some unneeded parenthesis
and
- if .. return True else False -> ...
2024-08-06 08:24:09 -05:00
Nicolas Boulenguez
925c51cdde elm: trivial improvements
Remove obsolete comment.

Fix a typo and avoid an unneeded function mapping.
2024-08-06 08:24:09 -05:00
Nicolas Boulenguez
51e7e9e995 elm: merge eval-ast into eval (part of #592) 2024-08-06 08:24:09 -05:00
Nicolas Boulenguez
97d06eb6de elm: add metadata to containers 2024-08-06 08:23:54 -05:00
Nicolas Boulenguez
77be585bb8 elm: allow keyword argument for keyword core function 2024-08-06 08:23:54 -05:00
Nicolas Boulenguez
10708752f6 elm: update to elm 0.19.1
Most changes are variable renamings because elm does not allow masking
a visible name anymore.

Deal with changes in the standard library, especially in the Parser
interface.

Source files must now start with a capital letter.

Dockerfile: remove unneeded dependencies, install nodejs from debs.

Remove the redundant Maybe from the return value of readstring.

Stop embedding the colon in keyword represenation.
2024-08-06 08:23:54 -05:00
Joel Martin
4580081aef objpascal: fix EAccessError by removing CMem import. 2024-08-06 08:09:46 -05:00
Joel Martin
61323306c2 go: update to ubuntu:24.04 and convert to go.mod style 2024-08-05 17:17:22 -05:00
Joel Martin
f09e16dd76 Update JS impls to ubuntu 24.04, ffi-napi to 4.0.3 2024-08-05 17:02:38 -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
7f45725c19 docker: update some dockerfiles
The modified implementations have been tested on Debian bullseye.

* prefer later Ubuntu image, hopefully reducing the image count

* for Ubuntu versions, prefer numerical versions to unsorted codenames

* prefer packaged build systems to local rebuilds

* prefer the current default version of each build system

* delegate resolution of indirect dependencies to apt

* xslt: remove intermediate run script. The initial motivation is to
    provide an explicit path to the python3 interpreter, as the
    versioned executable is not always in PATH.

* Add DEBIAN_FRONTEND=noninteractive to some Dockerfiles. This is to
  workaround tzdata which prompts interactively by default.

* Debian/Ubuntu do not ship a python->python2 link by default.

* With the improved logo implementation in another branch, there is no
  need anymore to tweat the garbage collector settings.

* logo: use upstream brandy compiler (instead of building).

* guile: adjust deb-src mechanism to build ucblogo and workaround doc
  build bug.
2024-08-05 17:00:24 -05:00
Joel Martin
a0fe8e4355 c.2,make,perl6,ocaml,objpascal: update to ubuntu:24.04
c.2:
    By updating to 24.04 we get around an error with declarations after
    labels which is allowed in more recent compiler versions.

make:
    With older make, the newer make code results in this error:
    ../make/readline.mk:13: *** unterminated call to function 'eval': missing ')'.  Stop.

    Newer versions of make work fine.

perl6:
    With older rakudo, this error occurs:
        user> (let* (DEBUG-EVAL false) (- 3 1))
        Cannot resolve caller Numeric(types::MalFalse: ); none of these signatures match:

ocaml:
    Fixes build error that happens with older versions of ocaml:
        ocamlopt -a types.ml reader.ml printer.ml env.ml core.ml -o mal_lib.cmxa
        File "env.ml", line 15, characters 8-21:
        Error: Unbound value Data.find_opt

objpascal:
    With older compiler, the following error occurs:
        user> (apply str (seq "this is a test"))
        *** Error in `../objpascal/stepA_mal': corrupted size vs. prev_size: 0x000000000246c360 ***
2024-08-05 11:55:55 -05:00
Nicolas Boulenguez
a60581e0a2 test: check that a: is a valid symbol.
This is required by the current mal implementation of DBG-EVAL.

Fix resulting errors in powershell, prolog, swift5
2024-08-05 11:54:37 -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
cb333f1387 ruby.2: backport a fix for step6 tests from stepA source to step9 source 2024-08-03 11:32:58 -05:00
Nicolas Boulenguez
6a6bc8cb73 python.2: fix argv in step9 2024-08-03 11:32:58 -05:00
Nicolas Boulenguez
10e8854c04 python.2: add with-meta reader macro 2024-08-03 11:32:58 -05:00
Nicolas Boulenguez
d0375ec9f8 vb: allow keyword argument to keyword function 2024-08-03 11:32:58 -05:00
Nicolas Boulenguez
3233e7821a make: fix enconding of hash and dollar signs
Some tests were failing with Make 4.3.
2024-08-03 11:32:58 -05:00
Nicolas Boulenguez
3bd752c979 make: prevent defmacro! from mutating functions 2024-08-03 11:32:58 -05:00
Nicolas Boulenguez
b4843b602c make: allow keyword argument to keyword functions 2024-08-03 11:32:58 -05:00
Joel Martin
6bf89ea118 miniMAL: update to miniMAL-1.2.2
- Update to ubuntu 24.04 Dockerfile and add labels.
- update to working version of ffi-napi
- Remove from miniMAL-core.json the things that overlap with the builtin
  core functionality that miniMAL now provides in 1.2.2.
- Update ARGS variable to argv to align with how 1.2.2 now does command
  line parameters.
2024-08-03 11:06:43 -05:00
Joel Martin
e6ec37a468 ruby: fix stackoverflow printing in steps 6-A 2024-08-02 11:10:48 -05:00
Joel Martin
f63d2e4672 ruby: update vivid->xenial 2024-08-02 11:10:48 -05:00
Joel Martin
b3759ab63b php: update vivid->xenial and php5 -> php7.0 2024-08-02 11:10:48 -05:00
Joel Martin
a1a784c572 groovy,kotlin: vivid->xenial and jdk-7->jdk-8 2024-08-02 11:10:48 -05:00
Joel Martin
714b718bd0 Update VB/c#/f# from vivid to xenial and add tzdata. 2024-08-02 11:10:48 -05:00
Joel Martin
7d49797697 ada: Dockerfile labels for repo linkage/visibility 2024-08-02 11:10:12 -05:00
Joel Martin
7a2bc6f066 Update Dockerfiles using ubuntu:vivid to xenial.
vivid packages are no longer available.

There are still implementations that use vivid because updating to
xenial was not sufficient to get them working again.
2024-08-02 11:10:12 -05:00
Joel Martin
1e8a122ddd wasm: fix odd WASI readline behavior.
Most of the time, the WASI fd_read call returns the whole line including
the newline. Other times, it returns everything except the newline. So
before stompiing the newline, check for that condition. This fixes the
WASI based wasm implementations (wasmtime, wasmer, lucet).
2021-12-20 12:17:19 -06:00
mrsekut
58a6054e51 PureScript: fix cmpOp supports MalTime and MalInt operations 2021-12-17 16:26:03 -06:00
mrsekut
4a3f6a1837 PureScript: fix MalTime mathematical operations 2021-12-17 16:24:26 -06:00
mrsekut
6ebb4d87ca PureScript: fix Makefile order of variable definitions 2021-12-17 16:24:26 -06:00
mrsekut
73aa01d9b3 PureScript: fix MalTime Type 2021-12-17 16:24:26 -06:00
mrsekut
d0814988e8 PureScript: exiting with Ctrl-D 2021-12-17 16:24:26 -06:00
mrsekut
55a032b4c9 PureScript: fix repl newline 2021-12-17 16:24:26 -06:00
mrsekut
cb9e238c1e PureScript: fix time-ms 2021-12-17 16:24:26 -06:00
mrsekut
e501e63262 PureScript: fix Makefile 2021-12-17 16:24:26 -06:00
mrsekut
a33b150fad PureScript: fix step2 without Env 2021-12-17 16:24:26 -06:00
mrsekut
d00e383dd4 PureScript: fix README, Dockerfile and Makefile 2021-12-17 16:24:22 -06:00
mrsekut
8387b34389 feat: add Dockerfile 2021-12-17 16:23:48 -06:00
mrsekut
d575e91ee1 feat: puresciprt stepA 2021-12-17 16:23:47 -06:00
mrsekut
992df8f2c2 fix: readStr 2021-12-17 16:23:47 -06:00
mrsekut
59c32afa55 feat: purescript step9 2021-12-17 16:23:47 -06:00
mrsekut
eac997e1ca feat: purescript step8 2021-12-17 16:23:47 -06:00
mrsekut
16ca69b275 feat: purescript step7 2021-12-17 16:23:47 -06:00
mrsekut
af80bc1e6a feat: purescript step6 2021-12-17 16:23:47 -06:00
mrsekut
511e0febaf feat: purescript step5 2021-12-17 16:23:47 -06:00
mrsekut
adf25c9cf7 feat: purescript step4 2021-12-17 16:23:47 -06:00
mrsekut
d35a9e839d feat: purescript step3 2021-12-17 16:23:47 -06:00
mrsekut
5023400b94 feat: purescript step2 2021-12-17 16:23:47 -06:00
mrsekut
0e5c8a3f11 feat: purescript step1 2021-12-17 16:23:47 -06:00
mrsekut
fc59ff9e49 feat: purscript step0 2021-12-17 16:23:41 -06:00
Ryan Cook
6896b0ab18 add makefile and dockerfile for mal CI for ruby.2 2021-12-13 18:18:16 -06:00
Ryan Cook
f1be2c471f ruby.2 step A; functional self-hosting of mal on mal; refactor if internal mal fn arg passing; 2021-12-13 18:18:16 -06:00
Ryan Cook
77683d92fd ruby.2 step 9 2021-12-13 18:18:16 -06:00
Ryan Cook
37008594bb ruby.2 step 8 2021-12-13 18:18:16 -06:00
Ryan Cook
8624da0aa3 ruby.2 step 7 2021-12-13 18:18:16 -06:00
Ryan Cook
516e56a6d7 ruby.2 step 6 (and fixes for comments and fn creation) 2021-12-13 18:18:16 -06:00
Ryan Cook
b76c04aacd ruby.2 step 4 & 5 2021-12-13 18:18:16 -06:00
Ryan Cook
229f30fdf1 ruby.2 step 3 2021-12-13 18:18:16 -06:00
Ryan Cook
918f370924 ruby.2 step 2 2021-12-13 18:18:16 -06:00
Ryan Cook
c318f495b9 ruby.2 step 1 2021-12-13 18:18:16 -06:00
Joel Martin
23dddd9e93 scheme/Dockerfile: gcc needed before chicken r7rs install 2021-12-11 15:20:31 -06:00
Vasilij Schneidermann
b2f74ac003 Update other Scheme implementations 2021-12-11 15:19:35 -06:00
Vasilij Schneidermann
3d34e31ca9 Update to CHICKEN 5 2021-12-11 15:19:35 -06:00
Vasilij Schneidermann
7d72c1293c Remove unused Gauche code 2021-12-11 15:19:35 -06:00
Nicolas Boulenguez
c1963a43aa Reduce core_ns in self hosting to a list of symbols
This simplifies a bit previous steps and prepares a future merge
request removing the macro? exception.
2021-12-11 10:08:59 -06:00
Nicolas Boulenguez
770aae175f ada.2: stop supporting metadata for atoms
This is not required anymore.
2021-12-11 10:06:52 -06:00
Nicolas Boulenguez
5140bf269f skew: prevent defmacro from mutating functions 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
8807a988ae skew: allow keyword argument for keyword core function 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
1580db1a53 cs: prevent defmacro from mutating functions 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
c5b50dbbbe d: allow keyword argument for keyword core function 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
13a84ba0aa d: prevent defmacro from mutating functions 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
e3c376ebd5 factor: prevent defmacro from mutating functions 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
7c5d341849 factor: allow keyword argument for keyword core function 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
c76f5a4be9 r: allow keyword argument for keyword core function 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
66d24858d6 cpp: allow keyword argument for keyword core function 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
b887786c81 miniMAL: allow keyword argument for keyword core function 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
d3affc0ba8 groovy: prevent defmacro from mutating functions 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
75b591effd coffeescript: prevent defmacro from mutating functions 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
2a2fb068fa guile: prevent defmacro from mutating functions 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
803d37f9f0 guile: fix build failure in map evaluation 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
071ab001c1 php: revent defmacro from mutating functions 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
8efef038f0 php: allow keyword argument for keyword core function 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
c937e2a7a9 perl6: prevent defmacro from mutating functions 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
5452aa2782 nim: prevent defmacro from mutating functions 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
ed9c6187b4 nim: fix string? core function for the empty string 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
8ae10b10f3 nim: allow keyword argument for keyword core function 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
5047a2cee3 nasm: allow keyword argument for keyword core function 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
b402dbced7 picolisp: prevent defmacro from mutating functions 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
b74ca280ff objpascal: prevent defmacro from mutating functions 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
28ba74b73e ps: pass NOSAFER option to ghostscript in order to allow slurp
Some ghostscript versions default to SAFER.
2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
cd09dfbac5 ps: prevent defmacro! from mutating functions 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
1bbf5a027d ps: allow keyword argument for keyword core function 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
f47ef5eddd gnu-smalltalk: prevent defmacro from mutating functions 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
085e35144f awk: prevent defmacro from mutating functions 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
e3c98eeb3a ada: allow keyword argument for keyword core function 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
de68c38029 ada: prevent defmacro from mutating functions 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
b204bb1f02 ada: let macros use a closure instead of current env 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
022e4f0b51 ocaml: allow keyword argument for keyword core function 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
e1b778481c java: prevent defmacro from mutating functions 2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
d4abb633b5 elisp: prevent defmacro from mutating functions
Also remove unused parameters from function constructor.
2021-12-11 09:52:02 -06:00
Nicolas Boulenguez
7955817510 bash: prevent defmacro from mutating functions 2021-12-11 09:52:02 -06: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
Nicolas Boulenguez
6d58903539 mal impl: spare an environment in implementation of do 2021-12-11 09:38:47 -06:00
Nicolas Boulenguez
e4109e6795 mal impl: (style) replace (list) with () 2021-12-11 09:38:47 -06:00
Nicolas Boulenguez
85153c6f68 env.mal: add comments 2021-12-11 09:38:47 -06:00
Garklein
1c76e857f8 additional test 2021-08-04 12:58:52 -05:00
Garklein
af78ff6e50 fixed mal implementation debugging comments 2021-07-16 13:16:44 -04:00
Joel Martin
36f758df05 julia: increase non-TCO step5 test.
The stack size on systems with higher ulimits (Github Actions) allows
this to complete and thus fail the test. Try with larger loop size to
try and trigger the problem even on those systems.
2021-07-12 17:53:01 -05:00
Joel Martin
1279811bbe [ts] update to node-12, ts-4.3.5, ffi-napi-4.0.4
Current versions were breaking during package dep install.
2021-07-11 19:08:14 -05:00
mmcgill
8d875b00b0 [java-truffle] don't exclude graal-sdk dependency
I added the exclusion as a hack to work around classpath
issues after importing the project into Eclipse, but this
isn't the right thing to do.

It prevents compilation on JDKs other than Graal, which was
not my intent.
2021-07-11 17:52:32 -06:00
mmcgill
13bb041072 [java-truffle] mention native images in README 2021-07-11 17:52:32 -06:00
mmcgill
20b6677551 [java-truffle] tweaks for native image compilation
GraalVM native image compilation wasn't working due to
some missing @TruffleBoundary annotations, and calls
from partially evaluated code into methods that are
black-listed for runtime compilation.

With these changes, a GraalVM native image should be
producable from every Mal step.
2021-07-11 17:52:32 -06:00
mmcgill
593290d601 [java-truffle] update to GraalVM 21.1.0 2021-07-11 17:52:32 -06:00
Nicolas Boulenguez
4807c1b65f Print a stack trace for uncaught exceptions in self-hosting
An uncaught exception in the self-hosting implementation causes the
interpreter to display the EVALed ast for each EVAL level until the
exception, something similare to a stack trace.  This does not cost
much and may help a lot debugging the self-hosting step.

On the other hand, remove try* from step0 where it serves no useful
purpose.

Because of indentation level, this diff is better viewed with the git
-b command line option.
2021-07-11 17:48:13 -06:00
Nicolas Boulenguez
931971e047 Move step9 test of map as exceptions from deferrable to optional
Self-hosting is not requiring this anymore.
2021-07-11 17:40:43 -06:00
Nicolas Boulenguez
7a45dc5851 Add intermediate test for env/fn interaction
It should pass on existing implementations because it is a
prerequisite for an existing test, but small independent tests are
easyer to debug on new implementations.
2021-07-11 17:38:14 -06:00
Nicolas Boulenguez
894b24d892 haskell: fix and optional-test order of assignments in let* 2021-07-11 17:38:14 -06:00
Nicolas Boulenguez
c9c504ac20 haskell: make grammar readable as reference, misc
Split user functions and macros, merge user functions and core functions.

Add a flag triggering debugging info in EVAL.

Reserve mutable environments for REPL and let*.
Move env type declaration from Types to Env.
Check let* arguments only once.

Share more code between map constructions and key type checks.

Stop copying metadata when evaluating collections.

The strict variant of Data.Map.Strict is recommended for general use.

simplify printer.
2021-07-11 17:38:14 -06:00
Nicolas Boulenguez
003947b30f haskell: clarify reader
The grammar is not fully equivalent to the one in the process, but it
passes all tests.

I suggest that it becomes a formal/testable reference (are tabs
allowed as spaces? is "a~" valid? is "' a" valid?...).

As it is formuled here, it can directly be translated either to
another language with high-level parsers, or to a low-level language
as each production only switches after a look at the next input
character.

Another suggestion to simplify step1 is to make '{' a reader macro,
parsing "{a1 a2..}" into (hash-map a1 a2..).

The step1 tests should then accept both "(hash-map ..)" and "{a1..}",
but the process should in my opinion suggest the former as it moves
the complexity related to maps (language-dependent constructor,
argument count and type checking, reporting of such errors) form
reader.qx/step1 to core.qx/hash-map, where it has to be done later
anyway.
2021-07-11 17:38:14 -06:00
mmcgill
068512559e [java-truffle] propagate step B code thru C-E 2021-05-31 10:28:04 -05:00
mmcgill
66144016ee [java-truffle] fix compiler bailouts, finish README
Turns out I was missing the @ExplodeLoop annotation on the
execute methods of VectorNode and MapNode. These annotations
trigger loop unrolling. I had thought they were simply for
performance, but in fact they are necessary to ensure that
the correct specializations get selected for each of the
child nodes. Without them, we get compiler bailouts for
functions that include vector and map literals.
2021-05-31 10:28:04 -05:00
mmcgill
a54987cde7 [java-truffle] benchmarking and write-up 2021-05-31 10:28:04 -05:00
mmcgill
4f500ca996 [java-truffle] step E: inlining macros 2021-05-31 10:28:04 -05:00
mmcgill
22a18d3d7a [java-truffle] step D: cache symbol lookups 2021-05-31 10:28:04 -05:00
mmcgill
495e62e86d [java-truffle] step C: specialize symbol lookups 2021-05-31 10:28:04 -05:00
mmcgill
df22cf3b17 [java-truffle] step B: specialize function calls 2021-05-31 10:28:04 -05:00
mmcgill
d2069e9d7d [java-truffle] step A! 2021-05-31 10:28:04 -05:00
mmcgill
26d9e6e465 [java-truffle] step 9 2021-05-31 10:28:04 -05:00
mmcgill
146ecc8230 [java-truffle] step 8 2021-05-31 10:28:04 -05:00
mmcgill
0cde9e9c74 [java-truffle] step 7 2021-05-31 10:28:04 -05:00
mmcgill
32e57779cd [java-truffle] step 6 2021-05-31 10:28:04 -05:00
mmcgill
de183d6a16 [java-truffle] step 5 2021-05-31 10:28:04 -05:00
mmcgill
1c48eda8e1 [java-truffle] step 4 2021-05-31 10:28:04 -05:00
mmcgill
d6093cd075 [java-truffle] step 3 2021-05-31 10:28:04 -05:00
mmcgill
17890c2ac8 [java-truffle] step 2 2021-05-31 10:28:04 -05:00
mmcgill
03b4694231 [java-truffle] step 1 2021-05-31 10:28:04 -05:00
mmcgill
1f58e1123a [java-truffle] step 0 2021-05-31 10:28:04 -05:00
Duncan Watts
87c86cbb4d tweaks for publication 2021-05-12 09:32:29 -05:00
Duncan Watts
fe6c42e303 renamed to c.2 and rebased onto latest master 2021-05-12 09:32:29 -05:00
Fabian
7e015062a9 SML CI: add mosml, mlton, setup GitHub workflow 2021-05-02 17:35:40 -05:00