1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-21 02:27:10 +03:00
Commit Graph

2437 Commits

Author SHA1 Message Date
woclass
c89b2a6f7d run test on cygwin 2019-06-02 22:22:52 +08:00
Joel Martin
d78d93938b FAQ: answer bang/star question. Misc cleanup/updates. 2019-04-03 13:56:30 -05:00
Joel Martin
93708da80e graph: update collected data with ada.2 updates. 2019-04-01 09:37:07 -05:00
Joel Martin
aa4dd9e824 graph: remove unnecessary popup line breaks. 2019-04-01 09:30:56 -05:00
Joel Martin
b284f4b844 guide.md: fix cheatsheet and language rank links. 2019-04-01 09:27:24 -05:00
Joel Martin
15b8d6aa9d
Merge pull request #348 from asarhaddon/ada.2
ada.2: fix memory leaks with garbage collection. Various simplifications.
2019-03-31 19:16:53 -05:00
Nicolas Boulenguez
5a07bb5331 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.
2019-03-31 19:06:00 +02:00
Joel Martin
6d9e1684de graph: add ada.2, update perf numbers. 2019-03-28 00:17:07 -05:00
Joel Martin
971450db2d README: fix anchor to ada.2 2019-03-27 11:25:14 -05:00
Joel Martin
d387f26eef README: add ada.2 2019-03-27 11:22:32 -05:00
Joel Martin
8bd40aedc5
Merge pull request #345 from asarhaddon/ada.2
Ada.2 distinct Ada implementation
2019-03-27 11:14:41 -05:00
Joel Martin
e503fe64aa README: link to malcc blog post. 2019-03-27 09:04:28 -05:00
Nicolas Boulenguez
9ac10d1d75 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.
2019-03-27 08:19:15 +01:00
Joel Martin
36c54c9bd2 graph/README: fix code quoting. 2019-03-26 10:58:17 -05:00
Joel Martin
715bd98746 graph: sync notes with code updates. 2019-03-25 13:50:41 -05:00
Joel Martin
51ed67ae46 Graph: change X-axis default to GH pushes.
This is the option with the most languages that have data.
2019-03-25 12:52:46 -05:00
Joel Martin
9d68841dcd 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.
2019-03-25 12:47:17 -05:00
Joel Martin
f244de07d9 Ada: fix accidental build breakage. 2019-03-21 00:25:16 -05:00
Joel Martin
b0e8fd0703 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).
2019-03-21 00:14:56 -05:00
Joel Martin
e1bc7804ad Popup caveats/notes. Dynamically generate controls. 2019-03-20 23:34:21 -05:00
Joel Martin
1eff25447a Stats collection script, dynamic scatter plot page 2019-03-20 23:34:21 -05:00
Joel Martin
833fc8cc19 README: order and names updates. 2019-03-20 23:34:21 -05:00
Joel Martin
c4269f9bf5 Convert to loccount based stats calculation. 2019-03-20 23:34:21 -05:00
Nicolas Boulenguez
a4820e976b ada.2: remove -gnatp optimization, which crashes the perf test. 2019-03-17 14:56:28 +01:00
Nicolas Boulenguez
265dd4e9ef ada.2: add Dockerfile from kanaka 2019-03-17 14:15:41 +01:00
Nicolas Boulenguez
00c3a3c33d 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.
2019-03-17 14:03:38 +01:00
Joel Martin
73b7847ef6 rexx, ruby: remove extraneous mal files. 2019-03-13 17:31:57 -05:00
Nicolas Boulenguez
0b4ab1a526 ada.2: add to .travis.yml 2019-03-10 01:25:11 +01:00
Nicolas Boulenguez
e3b1335caa ada2: rename to ada.2 2019-03-10 01:25:07 +01:00
Nicolas Boulenguez
1dc35df487 ada2: give an explicit prefix to fields in record invariants.
This hopefully fixes the build with gnat-4.9.
2019-03-10 01:25:03 +01:00
Nicolas Boulenguez
e2b412f928 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.
2019-03-10 01:24:48 +01:00
Nicolas Boulenguez
2ddc3cd1a8 ada2: replace a tail call with a jump in macroexpansion. 2019-03-10 01:24:34 +01:00
Nicolas Boulenguez
a5d17b88f4 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.
2019-03-10 01:24:24 +01:00
Nicolas Boulenguez
11932a6c89 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.
2019-03-10 01:24:17 +01:00
Nicolas Boulenguez
6e2b7ddffe 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.
2019-03-10 01:24:13 +01:00
Nicolas Boulenguez
daffc668e9 Major rewrite, improving style and improving performances. 2019-03-10 01:23:21 +01:00
Nicolas Boulenguez
cbbb51b465 Another Ada implementation. 2019-03-10 01:23:08 +01:00
Joel Martin
23b7e1085b
Merge pull request #344 from LispLY/add-swift4
Add swift4 implement
2019-03-06 12:33:49 -06:00
陆遥
56847c519c clean-up 2019-03-06 09:57:19 +08:00
陆遥
2c1c266085 Update readme and .travis.yml to add swift 4. 2019-03-06 09:35:31 +08:00
陆遥
34264332a9 remove auto-generated copyright declarations. 2019-03-06 09:02:48 +08:00
陆遥
573f6d0f7e Update Makefile 2019-03-05 18:27:26 +08:00
陆遥
bdda211295 add swift4 impliment. 2019-03-05 16:40:22 +08:00
Joel Martin
23342cb610
Merge pull request #343 from bendudson/nasm-catchless-try
NASM: Add catchless try to step 9 and step A
2019-03-03 17:56:34 -06:00
Ben Dudson
022e833987 Push and pop environment in catchless try
Need to remember to save and restore R15 with the
environment pointer.
2019-03-02 21:20:50 +00:00
Ben Dudson
e005219d76 Add catchless try to step 9 and step A
(try* A) evaluates A without setting an error handler.
2019-03-02 18:52:03 +00:00
Joel Martin
bb1e6df663 elixir, elm, erlang: Support catchless try*. 2019-02-28 17:36:54 -06:00
Joel Martin
5d99181284 cpp, racket: Support catchless try* 2019-02-28 17:36:45 -06:00
Joel Martin
dc191336f8 objpascal, r: Support catchless try*. 2019-02-27 17:06:14 -06:00
Joel Martin
757ebbfbbf crystal, kotlin, mal, scala: Support catchless try* 2019-02-27 16:39:23 -06:00