Joel Martin [Tue, 7 May 2019 22:03:52 +0000 (15:03 -0700)]
Merge pull request #362 from bjh21/bjh21-concat-ps
ps: Fix result of (concat [1 2]), so it returns a list not a vector.
Joel Martin [Wed, 8 May 2019 04:53:40 +0000 (23:53 -0500)]
swift4: exit on EOF/Ctrl-D.
Joel Martin [Wed, 8 May 2019 04:38:07 +0000 (23:38 -0500)]
rpython,rust,swift4,ts: fix empty list handling.
In these implementations there is no empty list check before
macroexpansion and so empty lists from step8 onwards produce a crash
or other misbehavior.
Also, add a test to step8 to test empty list again (first time it's
tested is in step2).
Ben Harris [Tue, 7 May 2019 21:04:28 +0000 (22:04 +0100)]
ps: Fix result of (concat [1 2]), so it returns a list not a vector.
Joel Martin [Tue, 7 May 2019 16:12:23 +0000 (09:12 -0700)]
Merge pull request #360 from asarhaddon/convert-divergent-native-to-builtin
Convert divergent native functions to built-in functions.
Nicolas Boulenguez [Tue, 7 May 2019 09:31:47 +0000 (11:31 +0200)]
Livescript Convert `not` from native to built-in.
Nicolas Boulenguez [Tue, 7 May 2019 09:22:26 +0000 (11:22 +0200)]
Guile Convert `not` from native to built-in.
Nicolas Boulenguez [Tue, 7 May 2019 09:12:59 +0000 (11:12 +0200)]
Forth Convert `not` from native to built-in.
Nicolas Boulenguez [Tue, 7 May 2019 08:56:11 +0000 (10:56 +0200)]
C++ Convert `< > >= list` from native to built-in.
Converting `map` is less trivial.
Joel Martin [Mon, 6 May 2019 14:38:27 +0000 (07:38 -0700)]
Merge pull request #357 from bjh21/bjh21-minor-fixes
Another round of minor doc/test fixes
Ben Harris [Mon, 6 May 2019 11:25:52 +0000 (12:25 +0100)]
step 7 test: Correct a heading to match contents.
'first' and 'rest' applied to vectors are now tested in step 8, not step 7.
Ben Harris [Sun, 5 May 2019 22:57:12 +0000 (23:57 +0100)]
guide.md: Move description of 'sequential?' to a more logical place.
It's still a deferrable part of step 9, but now it's listed with the
other vector-related functions rather than after the hash-map-related
ones.
Ben Harris [Wed, 1 May 2019 11:16:11 +0000 (12:16 +0100)]
step9: Don't use vectors in a non-deferrable test.
According to the guide, vectors are deferrable until step A, so use
(nth () 1) in place of (nth [] 1) as a form that will generate an error.
Ben Harris [Wed, 1 May 2019 11:15:14 +0000 (12:15 +0100)]
step9: Make test of throwing a hash-map deferrable.
According to the guide, hash-maps are deferrable until step A.
Joel Martin [Sun, 5 May 2019 22:37:11 +0000 (15:37 -0700)]
Merge pull request #354 from asarhaddon/simplify-core-mal
Trivial simplifications in core.mal.
Joel Martin [Sun, 5 May 2019 22:27:18 +0000 (15:27 -0700)]
Merge pull request #356 from asarhaddon/swift4-duplicate-lines
swift4: remove duplicate definition of load-file
Nicolas Boulenguez [Sun, 5 May 2019 18:39:37 +0000 (20:39 +0200)]
swift4: remove duplicate definition of load-file
Nicolas Boulenguez [Wed, 24 Apr 2019 18:12:53 +0000 (20:12 +0200)]
Trivial simplifications in core.mal.
Replace many (= (count xs) 0) with (empty? x).
Stop definining 'not', 'or' and 'cond' in core.mal, they are defined
in the process steps.
In 'some', avoid computing the same result twice.
Explain the final nil evaluation.
Joel Martin [Fri, 3 May 2019 14:48:33 +0000 (07:48 -0700)]
Merge pull request #355 from asarhaddon/improve-ada.2
Clarify and optimize ada.2.
Nicolas Boulenguez [Thu, 2 May 2019 19:19:34 +0000 (21:19 +0200)]
Clarify and optimize ada.2.
Makefile:
Drop OPT and -gnat2020, not used anymore.
Simplify file list now that each unit has a body.
README:
Remove obsolete items.
Global:
Restrict most pointers to a provable non-null value.
Types: merge intermediate Types.Mal into the Types package. (the
intermediate package was created in order to prevent a circular
dependency, but is not needed anymore).
Most of the noise in the diff is caused by this change.
This allows to remove most Elaboration pragmas.
Declare most types abstract in the visible part,
enforcing the use of the constructor outside the declaring package.
Envs:
Replace the Get recursion with a more efficient loop.
Use MAL objects as key, string pointers do not change speed.
This delegates some checks from the step files.
Split the constructor and Set_Binds, so that an existing environment
can be reused during TCO.
Err:
Attempt to group the calls.
Avoid computing the message when the assertion holds.
Fns:
Declare and use the eval callback only here.
Separate function and macro interfaces.
Keep a reference to the provided parameter list instead of copying them.
Garbage_Collected:
Make explicit that Keep is not inherited.
Printer:
Remove obsolete inline indications and redundant Print_Function helper.
Maps:
Provide a cleaner interface copied from standard library.
Sequences: stop encapsulating the implementation because of the
performance hit.
Steps:
Move map and vector evaluations into separate functions for readability.
Replace return blocks with normal blocks (MAL values are not finalized
anymore).
Rename standard arrays instead of sequence_ptr when possible.
Remove some duplication and indentation from the apply phase.
Move the frequent special forms in front of the test cascade.
When an environment has been created in the same Eval, reuse it.
Strings:
Use the same garbage-collected storage model for all strings.
This seems faster than the default (mutable) string types.
Hide most of the implementation to avoid leaks.
Symbols: stop ensuring unique allocation of symbols. The reduced
garbage collection and comparison time was compensed by the
maintainance of a global hash.
Joel Martin [Sun, 21 Apr 2019 02:28:05 +0000 (21:28 -0500)]
Merge pull request #353 from bjh21/bjh21-minor-fixes
Minor doc/test fixes
Ben Harris [Sat, 20 Apr 2019 18:00:08 +0000 (19:00 +0100)]
Guide: when introducing read_atom, don't mention complex types.
Vectors, hash-maps, and atoms wouldn't be read by read_atom anyway.
Atoms don't even have a read syntax. While I'm there, also correct
which step keywords turn up in (step A, not step 9).
Ben Harris [Sat, 20 Apr 2019 17:49:29 +0000 (18:49 +0100)]
Step 6: Make tests of '*ARGV*' deferrable.
The Guide says that '*ARGV*' is deferrable at step 6.
Joel Martin [Fri, 19 Apr 2019 06:07:08 +0000 (01:07 -0500)]
wasm: wax runtime. Use WASI preopen process.
Add wasi-sdk to Dockerfile to be able to compile C code to wasm that
uses WASI API calls.
Joel Martin [Wed, 17 Apr 2019 05:35:39 +0000 (00:35 -0500)]
README: add webassembly embeddings/runtimes.
Joel Martin [Tue, 16 Apr 2019 03:08:07 +0000 (22:08 -0500)]
wasm: Support/add wasmtime runtime. WASI platform.
Joel Martin [Tue, 16 Apr 2019 01:54:11 +0000 (20:54 -0500)]
wasm: use wam-1.0.8 which supports new binaryen.
New binaryen doesn't allow data section to contain multiple strings to
be concatenated together any more. So wamp-1.0.8 does the
concatenating for it.
Joel Martin [Mon, 15 Apr 2019 05:57:59 +0000 (00:57 -0500)]
wasm: direct platform, wam memory
- Rename platform_os.wam to platform_direct.wam and update the direct
interface to use printline instead of fputs/stdout.
- Update to wamp 1.0.7 and new memory/memoryBase semantics: in
platform_direct and platform_libc, import memory and memoryBase
rather than relying on wamp to add it because wamp add direct memory
and memoryBase defintions (not imports) if the program doesn't
already define or import memory/memoryBase.
- Simplify entry point logic by moving it into the platform files.
Joel Martin [Sat, 13 Apr 2019 16:57:15 +0000 (11:57 -0500)]
README: reorganize slightly.
Move external implementations and other mal projects above the long
implementation details section. The implementation details are linked
to from the overview section so it's fine to have that lower on the
page.
Ben Harris [Wed, 10 Apr 2019 22:29:30 +0000 (23:29 +0100)]
guide.md: In step 1, correctly state how long strings can be deferred.
Ben Harris [Wed, 10 Apr 2019 22:20:28 +0000 (23:20 +0100)]
guide.md: Properly escape a '<'.
Joel Martin [Wed, 10 Apr 2019 18:35:19 +0000 (13:35 -0500)]
Merge pull request #352 from bjh21/bjh21-defer-strings
Mark step 4 tests that use strings as deferrable.
Ben Harris [Tue, 9 Apr 2019 20:10:49 +0000 (21:10 +0100)]
Mark step 4 tests that use strings as deferrable.
Strings are deferrable until step 6, so tests of string functionality at
step 4 should be marked as deferrable. A couple of tests just use
strings as convenient constants to return or print. In those cases,
replace the strings with integers rather than deferring the whole test.
Joel Martin [Mon, 8 Apr 2019 21:02:57 +0000 (16:02 -0500)]
Merge pull request #351 from bjh21/bjh21-no-vectors
guide.md: Don't use vectors in step 4 when they're still deferrable.
Ben Harris [Mon, 8 Apr 2019 20:11:11 +0000 (21:11 +0100)]
guide.md: Don't use vectors in step 4 when they're still deferrable.
Vectors are deferrable until step A, so the manual tests in step 4
shouldn't use them. Replacing them with lists works.
Joel Martin [Wed, 3 Apr 2019 18:55:16 +0000 (13:55 -0500)]
FAQ: answer bang/star question. Misc cleanup/updates.
Joel Martin [Mon, 1 Apr 2019 14:37:07 +0000 (09:37 -0500)]
graph: update collected data with ada.2 updates.
Joel Martin [Mon, 1 Apr 2019 14:30:56 +0000 (09:30 -0500)]
graph: remove unnecessary popup line breaks.
Joel Martin [Mon, 1 Apr 2019 14:27:24 +0000 (09:27 -0500)]
guide.md: fix cheatsheet and language rank links.
Joel Martin [Mon, 1 Apr 2019 00:16:53 +0000 (19:16 -0500)]
Merge pull request #348 from asarhaddon/ada.2
ada.2: fix memory leaks with garbage collection. Various simplifications.
Nicolas Boulenguez [Sun, 31 Mar 2019 17:06:00 +0000 (19:06 +0200)]
ada.2: fix memory leaks with garbage collection. Various simplifications.
Cyclic references were never deallocated by reference conuting.
Symbols cannot create cyclic structures and are less frequent (one
allocation per symbol), keep reference counting for them.
This slightly improves performances even though many previous
optimizations are removed (environment stack, reuse of memory).
Step caching hash of symbols. This does not seem to improve
performances. Hashing them instead of ordering them does.
Define Repl in the step file instead of globally. Move the eval
built-in function from core into the step file.
When possible, pass Ada records instead of explicit pointers.
In the reader, construct more objects directly as described in the MAL
process, reserve the buffer for sequences and maps
In eval, iterate on vectors without delegation. The increased
complexity was not improving performances. Keep demonstrating Ada
type-safe genericity for maps, where iterating outside Types.Maps
would be less easy and/or efficient.
In quasiquote_list, concatenate in one buffer instead of allocating a
list for each element. The buffer may be reallocated behind the
curtain, but not once per element anymore.
In environments, illustrate tail call optimization when recursion is
more readable than a loop.
Joel Martin [Thu, 28 Mar 2019 05:17:07 +0000 (00:17 -0500)]
graph: add ada.2, update perf numbers.
Joel Martin [Wed, 27 Mar 2019 16:25:14 +0000 (11:25 -0500)]
README: fix anchor to ada.2
Joel Martin [Wed, 27 Mar 2019 16:22:32 +0000 (11:22 -0500)]
README: add ada.2
Joel Martin [Wed, 27 Mar 2019 16:14:41 +0000 (11:14 -0500)]
Merge pull request #345 from asarhaddon/ada.2
Ada.2 distinct Ada implementation
Joel Martin [Wed, 27 Mar 2019 14:04:28 +0000 (09:04 -0500)]
README: link to malcc blog post.
Nicolas Boulenguez [Wed, 27 Mar 2019 07:19:15 +0000 (08:19 +0100)]
ada.2: fix reference count for envs and IO error propagation for slurp.
First fix also allows -gnatp compiler option.
Add assertions and improve dumps in environments.
Joel Martin [Tue, 26 Mar 2019 15:58:17 +0000 (10:58 -0500)]
graph/README: fix code quoting.
Joel Martin [Mon, 25 Mar 2019 18:50:41 +0000 (13:50 -0500)]
graph: sync notes with code updates.
Joel Martin [Mon, 25 Mar 2019 17:52:46 +0000 (12:52 -0500)]
Graph: change X-axis default to GH pushes.
This is the option with the most languages that have data.
Joel Martin [Mon, 25 Mar 2019 04:24:44 +0000 (23:24 -0500)]
Add GH Pull/Push, StackOverflow tags, README.
- Add GitHub/GitHut pull requests and pushes.
- Add StackOverflow tag counts (this also involves some hard-coded
rollup of certain tags).
- Add README with update instructions.
- Move graph specific data mangling from collect code to graph
rendering code.
Joel Martin [Thu, 21 Mar 2019 05:25:16 +0000 (00:25 -0500)]
Ada: fix accidental build breakage.
Joel Martin [Thu, 21 Mar 2019 05:14:56 +0000 (00:14 -0500)]
Move web files into docs/. Build docs/web/mal.js
To update the docs/web/mal.js script run `make -C js web/mal.js` from the
top-level (js/web is a symlink to docs/web).
Joel Martin [Thu, 21 Mar 2019 03:46:47 +0000 (22:46 -0500)]
Popup caveats/notes. Dynamically generate controls.
Joel Martin [Mon, 18 Mar 2019 05:31:02 +0000 (00:31 -0500)]
Stats collection script, dynamic scatter plot page
Joel Martin [Thu, 21 Mar 2019 03:50:03 +0000 (22:50 -0500)]
README: order and names updates.
Joel Martin [Thu, 21 Mar 2019 04:32:35 +0000 (23:32 -0500)]
Convert to loccount based stats calculation.
Nicolas Boulenguez [Sun, 17 Mar 2019 13:56:28 +0000 (14:56 +0100)]
ada.2: remove -gnatp optimization, which crashes the perf test.
Nicolas Boulenguez [Sun, 17 Mar 2019 13:15:41 +0000 (14:15 +0100)]
ada.2: add Dockerfile from kanaka
Nicolas Boulenguez [Sun, 17 Mar 2019 10:24:03 +0000 (11:24 +0100)]
ada.2: spring cleaning before final pull request.
Two changes require approval.
* The 'do' special becomes a built-in function similar to first. This
small change reduces the complexity of eval. The last evaluation
cannot benefit from TCO, but the performance change seems invisible.
* read/eval/print acts on each item found in the input string, as if
they were enclosed with (do ..). The guide does not specify what
should happen to text following the first AST, and this change actually
simplifies some things (like dealing with zero AST).
The read-string built-in function only returns the first AST,
as changing this would be much more intrusive.
Other changes seem straightforward.
Global:
* Ada 2020 target assignments (like +=, but more general).
* Use Constant_Indexing aspect for sequences, so that they can be
indexed in source code like native arrays.
* consistency renamings.
'fn' does not include built-in functions, 'function' does.
'list' does not include vectors, 'sequence' does.
Move error handling to a separate package.
* This simplifies code everywhere else.
* Uncaught expressions now report a stack trace.
Types:
* Count allocations and deallocations, check that counts match.
* Share more code between functions and macros.
Core:
* Replace the Core.Ns function returning an array with a procedure
(The intermediate object was preventing the reference counting code
from deallocating some unused objects).
* Implement Prn with Pr_Str.
Printer:
* Change the profile so that the caller spares some allocations.
Reader:
* Share a single buffer of mal values between all recursions.
This significantly reduces the stack footprint.
Steps:
* Fix implementation name (ada.2) in the startup script.
* Let environment variables trigger debugging information.
Joel Martin [Wed, 13 Mar 2019 22:31:57 +0000 (17:31 -0500)]
rexx, ruby: remove extraneous mal files.
Nicolas Boulenguez [Sun, 10 Mar 2019 00:14:23 +0000 (01:14 +0100)]
ada.2: add to .travis.yml
Nicolas Boulenguez [Sun, 10 Mar 2019 00:13:57 +0000 (01:13 +0100)]
ada2: rename to ada.2
Nicolas Boulenguez [Sun, 10 Mar 2019 00:07:53 +0000 (01:07 +0100)]
ada2: give an explicit prefix to fields in record invariants.
This hopefully fixes the build with gnat-4.9.
Nicolas Boulenguez [Sat, 9 Mar 2019 23:31:51 +0000 (00:31 +0100)]
ada.2: rewrite the reader, for readability and efficiency.
Use character sets and other language tools to delimit tokens.
When possible, only test each input character once.
Give verbose descriptions to subprograms.
Simplify with one global variable instead of two.
Improve reporting of ignored trailing items in input.
Nicolas Boulenguez [Sat, 9 Mar 2019 23:14:59 +0000 (00:14 +0100)]
ada2: replace a tail call with a jump in macroexpansion.
Nicolas Boulenguez [Sat, 9 Mar 2019 23:14:59 +0000 (00:14 +0100)]
ada2: fix formatting and typos, add comments, check more errors.
Only attempt to spare a recursion after step5, this is more consistent
with the process.
Nicolas Boulenguez [Wed, 6 Mar 2019 18:48:51 +0000 (19:48 +0100)]
Improve conformity with the MAL process, performance and readability.
Conformity:
Move readline to readline.ads and drop the Interactive_Loop subprogram.
Let the main Read and Print functions do input/output.
Rename environments.ads to envs.ads (the name of the eval parameter
seems more important).
Move association of formal and actual parameters to the env "constructor".
Use the documentation names whenever possible (especially, make calls
to Eval where they are expected and explicit the parameters).
Iterate on a NS structure provided by Core, as per the process.
Use similar method names for Envs.Ptr and Envs.Closure_Ptr,
as the difference is an implementation detail.
Performance:
Move Map into list methods, swap into atom methods.
Pass formal parameters as an array of symbols on the stack,
instead of a MAL list.
Readability:
Replace some one-letter names.
Use renamings when the lines become too long.
Split Pr_Str in small subprograms.
Declare the access to built-in functions in Types.Mal.
Consistent names.
Move redundant comments into README.
Nicolas Boulenguez [Sun, 3 Mar 2019 17:07:18 +0000 (18:07 +0100)]
Various cosmetic improvements inspired by adacontrol.
In Printer, Reader and Quasiquote: move subsubprogram into the
subprogram calling it: this improves the readability and spares some
adjust/finalizations.
Force elaboration of Environments and Symbols before Core.
Move some use clauses to the minimal scope requiring them.
Remove some name clashes.
Format more consistently.
Add comments to distant 'begin' keywords.
Give explicit list of remaining choices in crucial case statements.
Remove unneeded parenthesis.
Avoid unneeded exceptions.
Explicit some initial values.
Nicolas Boulenguez [Wed, 27 Feb 2019 21:27:12 +0000 (22:27 +0100)]
Major rewrite, improving style and improving performances.
Nicolas Boulenguez [Mon, 10 Oct 2016 17:08:59 +0000 (19:08 +0200)]
Another Ada implementation.
Joel Martin [Wed, 6 Mar 2019 18:33:49 +0000 (12:33 -0600)]
Merge pull request #344 from LispLY/add-swift4
Add swift4 implement
陆遥 [Wed, 6 Mar 2019 01:57:19 +0000 (09:57 +0800)]
clean-up
陆遥 [Wed, 6 Mar 2019 01:35:31 +0000 (09:35 +0800)]
Update readme and .travis.yml to add swift 4.
陆遥 [Wed, 6 Mar 2019 01:02:48 +0000 (09:02 +0800)]
remove auto-generated copyright declarations.
陆遥 [Tue, 5 Mar 2019 10:27:26 +0000 (18:27 +0800)]
Update Makefile
陆遥 [Tue, 5 Mar 2019 08:40:22 +0000 (16:40 +0800)]
add swift4 impliment.
Joel Martin [Sun, 3 Mar 2019 23:56:34 +0000 (17:56 -0600)]
Merge pull request #343 from bendudson/nasm-catchless-try
NASM: Add catchless try to step 9 and step A
Ben Dudson [Sat, 2 Mar 2019 21:20:50 +0000 (21:20 +0000)]
Push and pop environment in catchless try
Need to remember to save and restore R15 with the
environment pointer.
Ben Dudson [Sat, 2 Mar 2019 18:52:03 +0000 (18:52 +0000)]
Add catchless try to step 9 and step A
(try* A) evaluates A without setting an error handler.
Joel Martin [Thu, 28 Feb 2019 23:36:54 +0000 (17:36 -0600)]
elixir, elm, erlang: Support catchless try*.
Joel Martin [Thu, 28 Feb 2019 23:36:45 +0000 (17:36 -0600)]
cpp, racket: Support catchless try*
Joel Martin [Wed, 27 Feb 2019 23:06:14 +0000 (17:06 -0600)]
objpascal, r: Support catchless try*.
Joel Martin [Wed, 27 Feb 2019 22:39:23 +0000 (16:39 -0600)]
crystal, kotlin, mal, scala: Support catchless try*
Joel Martin [Tue, 26 Feb 2019 23:41:50 +0000 (17:41 -0600)]
basic: support catchless try*
Joel Martin [Tue, 26 Feb 2019 23:38:05 +0000 (17:38 -0600)]
Ignore step5 excludes during REGRESS too.
Vasilij Schneidermann [Mon, 25 Feb 2019 16:03:22 +0000 (17:03 +0100)]
elisp: A list of cadr is its cdr
Vasilij Schneidermann [Mon, 25 Feb 2019 15:37:24 +0000 (16:37 +0100)]
elisp: Avoid conflict by loading libs from mal/
Dov Murik [Thu, 21 Feb 2019 11:24:13 +0000 (11:24 +0000)]
forth: Support catchless try*
Dov Murik [Thu, 21 Feb 2019 11:06:20 +0000 (11:06 +0000)]
awk: Support catchless try*
Dov Murik [Thu, 21 Feb 2019 09:54:08 +0000 (09:54 +0000)]
rexx: Support catchless try*
Dov Murik [Thu, 21 Feb 2019 09:14:56 +0000 (09:14 +0000)]
logo: Support catchless try*
Dov Murik [Thu, 21 Feb 2019 08:15:18 +0000 (08:15 +0000)]
d: Support catchless try*
Dov Murik [Wed, 20 Feb 2019 07:21:48 +0000 (07:21 +0000)]
fantom: Support catchless try*
Dov Murik [Wed, 20 Feb 2019 07:14:23 +0000 (07:14 +0000)]
skew: Support catchless try*
Dov Murik [Wed, 20 Feb 2019 07:10:44 +0000 (07:10 +0000)]
tcl: Support catchless try*
Dov Murik [Wed, 20 Feb 2019 07:04:55 +0000 (07:04 +0000)]
vhdl: Support catchless try*
Joel Martin [Tue, 19 Feb 2019 21:40:02 +0000 (15:40 -0600)]
README: language list to table with anchor links
Vasilij Schneidermann [Tue, 19 Feb 2019 20:10:15 +0000 (21:10 +0100)]
elisp: Get rid of load-relative hack
Vasilij Schneidermann [Tue, 19 Feb 2019 20:01:42 +0000 (21:01 +0100)]
elisp: Relax version RE check