jackhill/mal.git
3 years agogenerate perf analysis
AnotherTest [Thu, 20 Feb 2020 20:54:32 +0000 (00:24 +0330)]
generate perf analysis

3 years agofix previous env issue
AnotherTest [Thu, 20 Feb 2020 18:48:09 +0000 (22:18 +0330)]
fix previous env issue

perf tests run, still can't self-host

3 years agoimpl everything, passes tests, has some weird bug with eval
AnotherTest [Thu, 20 Feb 2020 00:51:36 +0000 (04:21 +0330)]
impl everything, passes tests, has some weird bug with eval

- investigate the case where (eval ...) loses the entire env

3 years agoImplement step9 fully. pass all tests~
AnotherTest [Wed, 19 Feb 2020 21:36:45 +0000 (01:06 +0330)]
Implement step9 fully. pass all tests~

3 years agoFinish step8
AnotherTest [Wed, 19 Feb 2020 18:06:55 +0000 (21:36 +0330)]
Finish step8

Issue: yanking out the replEnv from closures has an adverse effect in
that symbols meant to be captured from it will not be captured
We could get around this by copying all the used symbols, but
find-all-lexically-bound-symbols is quite complex

3 years agofix in-file step name
AnotherTest [Wed, 19 Feb 2020 11:35:13 +0000 (15:05 +0330)]
fix in-file step name

3 years agoimplement step7-quote
AnotherTest [Wed, 19 Feb 2020 11:33:59 +0000 (15:03 +0330)]
implement step7-quote

3 years agoremove debug function
AnotherTest [Wed, 19 Feb 2020 10:32:28 +0000 (14:02 +0330)]
remove debug function

3 years agoimpl step6
AnotherTest [Wed, 19 Feb 2020 10:29:00 +0000 (13:59 +0330)]
impl step6

separate replEnv from function environments, so as to decrease base size
(state size is still O(2^n))

3 years agoimpl step4, fix string parsing
AnotherTest [Wed, 12 Feb 2020 21:02:32 +0000 (00:32 +0330)]
impl step4, fix string parsing

3 years agoprint functions as #<fn name>
AnotherTest [Mon, 10 Feb 2020 20:18:32 +0000 (23:48 +0330)]
print functions as #<fn name>

3 years agoimpl step3 fully. passes all tests
AnotherTest [Sun, 9 Feb 2020 21:48:20 +0000 (01:18 +0330)]
impl step3 fully. passes all tests

3 years agohandle vectors and hashmaps
AnotherTest [Sun, 9 Feb 2020 18:10:59 +0000 (21:40 +0330)]
handle vectors and hashmaps

3 years agoimpl step2, remove interleaved calls in READ/EVAL/PRINT
AnotherTest [Sun, 9 Feb 2020 18:07:11 +0000 (21:37 +0330)]
impl step2, remove interleaved calls in READ/EVAL/PRINT

3 years agostart step2-eval
AnotherTest [Sat, 8 Feb 2020 11:52:05 +0000 (15:22 +0330)]
start step2-eval

3 years agopass all step1 tests
AnotherTest [Sat, 8 Feb 2020 08:01:19 +0000 (11:31 +0330)]
pass all step1 tests

3 years agoadd reader macros
AnotherTest [Fri, 7 Feb 2020 23:44:40 +0000 (03:14 +0330)]
add reader macros

3 years agocomplete required functionality for step1
AnotherTest [Fri, 7 Feb 2020 20:36:01 +0000 (00:06 +0330)]
complete required functionality for step1

3 years agostarting xslt impl
AnotherTest [Fri, 7 Feb 2020 20:28:36 +0000 (23:58 +0330)]
starting xslt impl

3 years agoMerge pull request #510 from bjh21/bjh21-runtest-simpler
Joel Martin [Sat, 23 May 2020 16:39:13 +0000 (11:39 -0500)]
Merge pull request #510 from bjh21/bjh21-runtest-simpler

Simplify runtest.py's input handling

3 years agoruntest: Strip CR on input
Ben Harris [Sat, 23 May 2020 10:02:18 +0000 (11:02 +0100)]
runtest: Strip CR on input

Implementations don't generally deliberately emit CR, so any CR we see
was introduced either by the host language runtime or the OS terminal
driver, neither of which we're trying to test.

3 years agoruntest: Don't worry about how implementation echoes input
Ben Harris [Sat, 23 May 2020 09:58:57 +0000 (10:58 +0100)]
runtest: Don't worry about how implementation echoes input

Some of the complexity of runtest is in the way that it insists on
checking whether the implementation managed to echo its input line
correctly.  This isn't really an important part of the implementation,
though, and when using friendly line-editing libraries the echoing can
often end up containing escape sequences.  Simplify things by just
assuming that anything up to the first newline is our input being echoed
back.

This also means that various pre-processing of input is no longer
required.

3 years agoMerge pull request #506 from gabrielmadruga/master
Joel Martin [Thu, 21 May 2020 23:39:49 +0000 (18:39 -0500)]
Merge pull request #506 from gabrielmadruga/master

Update and fixes for the lua implementation.

3 years agoMerge pull request #508 from bjh21/bjh21-throwtests
Joel Martin [Thu, 21 May 2020 23:07:15 +0000 (18:07 -0500)]
Merge pull request #508 from bjh21/bjh21-throwtests

Add tests for nested exception handlers

3 years agoMerge pull request #509 from bjh21/bjh21-ps-catch
Joel Martin [Thu, 21 May 2020 23:05:03 +0000 (18:05 -0500)]
Merge pull request #509 from bjh21/bjh21-ps-catch

ps: Fix handling of exceptions thrown from `catch*` clause

3 years agops: Fix handling of exceptions thrown from catch* clause
Ben Harris [Thu, 21 May 2020 19:50:42 +0000 (20:50 +0100)]
ps: Fix handling of exceptions thrown from catch* clause

PostScript's exception handling doesn't restore the dictionary or
operand stacks to the state they were in when the "stopped" operator
started, so mal's EVAL needs to do that itself.  To do this, it records
the current height of the stacks, but of course it does that in a
dictionary.  This means that when catching at exception, it relies on
the highest instance of "dictcnt" on the dictionary stack being the
correct one.  EVAL, however, was failing to restore the dictionary stack
at the right time.

For instance, conside this code (from the tests):

  (try* (try* (throw "e1") (catch* e (throw "e2"))) (catch* e "c2"))

Each "try*" clause saves "dictcnt" into a dictionary on the dictionary
stack.  When the inner "catch*" clause fires, it pops the dictionary and
operand stacks to the correct point, but then calls the second "throw"
with the wrong value of "dictcnt" still visible.  The result is that the
"catch*" clause ends up running with the wrong value of "dictcnt" and
restoring the stacks to the wrong place, essentially executing the
_inner_ "catch*" clause again, whereupon the error doesn't get caught
because there's no "stopped" left on the PostScript execution stack.

The fix is to add another dictionary that's just used to hold "dictcnt"
and "stackcnt", and to pop that from the dictionary stack as soon as the
stacks have been restored (or when it becomes unnecessary because the
"try*" clause has returned normally).

3 years agoAdd tests for nested exception handlers
Ben Harris [Tue, 19 May 2020 09:28:21 +0000 (10:28 +0100)]
Add tests for nested exception handlers

When implementing exceptions on top of longjmp() or similar, it's
necessary to make sure that exception handlers get properly restored
after the try* clause, and none of the existing step 9 tests covered
this.

There are two cases covered here: throwing an exception after a
successful try*, and throwing and exception from within a catch*.  In
both cases we make sure that an outer catch* does its job.

4 years agoChange os.clock multiplier, update Dockerfile to use lua 5.3.5.5
Gabriel M [Sun, 17 May 2020 17:23:54 +0000 (14:23 -0300)]
Change os.clock multiplier, update Dockerfile to use lua 5.3.5.5

4 years agoMerge pull request #505 from bjh21/bjh21-test-readatom
Joel Martin [Sat, 16 May 2020 22:52:52 +0000 (17:52 -0500)]
Merge pull request #505 from bjh21/bjh21-test-readatom

Step 6: Test read-string of a single atom at the end of input

4 years agoUpdate README.md
Gabriel M [Sat, 16 May 2020 02:33:26 +0000 (23:33 -0300)]
Update README.md

4 years agoChange \177 to \u{029e}, correctly define keyword, change loadstring to load
Gabriel M [Sat, 16 May 2020 02:09:09 +0000 (23:09 -0300)]
Change \177 to \u{029e}, correctly define keyword, change loadstring to load

4 years agoAdd lrexlib-pcre through luarocks.
Gabriel M [Fri, 15 May 2020 19:05:10 +0000 (16:05 -0300)]
Add lrexlib-pcre through luarocks.

4 years agoRemove usage of socket
Gabriel M [Fri, 15 May 2020 19:05:57 +0000 (16:05 -0300)]
Remove usage of socket

4 years agoLua Makefile improvements.
Gabriel M [Fri, 15 May 2020 17:32:55 +0000 (14:32 -0300)]
Lua Makefile improvements.
Clean lib folder, and find linenoise.so.

4 years agoStep 6: Test read-string of a single atom at the end of input
Ben Harris [Sun, 10 May 2020 13:23:40 +0000 (14:23 +0100)]
Step 6: Test read-string of a single atom at the end of input

All of the other read-string tests test forms whose end can be detected
before the end of the input string, either because they're naturally
self-terminating (lists, strings) or because there's white space after
them.  All of the uses of the reader from the REPL are similarly likely
to have input with a newline or similar at the end.

My BCPL implementation turned out to read one character past the end of
the input when the input ended inside an atom, and to incorporate that
one byte into the output.  The consequences of a buffer over-read are a
little unpredictable, so I've just written a test that was good enough
to catch the bug for me.

4 years agoMerge pull request #502 from maniaphobic/master
Joel Martin [Mon, 30 Mar 2020 19:22:53 +0000 (14:22 -0500)]
Merge pull request #502 from maniaphobic/master

Correct a trivial typographical error in the guide

4 years agoCorrect a trivial typographical error in the guide
mANIApHOBIC [Sun, 29 Mar 2020 03:01:46 +0000 (20:01 -0700)]
Correct a trivial typographical error in the guide

I corrected "you implementation" to "your implementation".

4 years agoRevert accidentally pushed close_fds experiment
Joel Martin [Tue, 11 Feb 2020 16:02:53 +0000 (10:02 -0600)]
Revert accidentally pushed close_fds experiment

4 years agoMove implementations into impls/ dir
Joel Martin [Tue, 11 Feb 2020 05:50:16 +0000 (23:50 -0600)]
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.

4 years agoDEBUG re-enable (REMOVE ME).
Joel Martin [Thu, 23 Jan 2020 16:44:19 +0000 (10:44 -0600)]
DEBUG re-enable (REMOVE ME).

4 years agoDISABLE FDs (REMOVE ME).
Joel Martin [Thu, 23 Jan 2020 16:12:37 +0000 (10:12 -0600)]
DISABLE FDs (REMOVE ME).

4 years agoFD debug (REMOVE ME).
Joel Martin [Thu, 23 Jan 2020 15:56:56 +0000 (09:56 -0600)]
FD debug (REMOVE ME).

4 years agoruntest.py: close FDS on Popen
Joel Martin [Mon, 20 Jan 2020 23:19:13 +0000 (17:19 -0600)]
runtest.py: close FDS on Popen

Be more consistent about what FDs the executing implementation will
have during execution. This makes it more consistent with behavior of
launching the implementation directly.

4 years agoAdd missing clean targets in 5 impls.
Joel Martin [Fri, 17 Jan 2020 00:46:28 +0000 (18:46 -0600)]
Add missing clean targets in 5 impls.

4 years agograph: update stats, add new implementations.
Joel Martin [Thu, 16 Jan 2020 21:51:54 +0000 (15:51 -0600)]
graph: update stats, add new implementations.

New implementations: jq, pike, wren, zig, python #2, Swift 5.

4 years agoAlign jq capitalization with docs.
Joel Martin [Thu, 16 Jan 2020 21:50:11 +0000 (15:50 -0600)]
Align jq capitalization with docs.

Docs uses lower-case "jq": https://stedolan.github.io/jq/manual/

4 years agoMerge pull request #493 from alimpfard/patch-3
Joel Martin [Thu, 16 Jan 2020 14:52:27 +0000 (08:52 -0600)]
Merge pull request #493 from alimpfard/patch-3

Add test for atoms "leaking" out of let* binds

4 years agoMerge pull request #494 from alimpfard/master
Joel Martin [Thu, 16 Jan 2020 14:46:10 +0000 (08:46 -0600)]
Merge pull request #494 from alimpfard/master

[jq impl] fix atoms not leaking out of let* (related to pr #493)

4 years agofix case where env could be null
AnotherTest [Thu, 16 Jan 2020 04:51:46 +0000 (08:21 +0330)]
fix case where env could be null

+ micro-optimisation

4 years agofix atoms not leaking out of let*
AnotherTest [Thu, 16 Jan 2020 04:02:22 +0000 (07:32 +0330)]
fix atoms not leaking out of let*

This was some ironic happenstance

4 years agoAdd test for atoms "leaking" out of let* binds
Ali Mohammad Pur [Wed, 15 Jan 2020 21:25:12 +0000 (00:55 +0330)]
Add test for atoms "leaking" out of let* binds

(hopefully) closes #490

4 years agoMerge pull request #492 from alimpfard/patch-2
Joel Martin [Wed, 15 Jan 2020 17:06:40 +0000 (11:06 -0600)]
Merge pull request #492 from alimpfard/patch-2

issue #491

4 years agoissue #491
Ali Mohammad Pur [Wed, 15 Jan 2020 16:15:33 +0000 (19:45 +0330)]
issue #491

adds a `--crlf` switch to runtest.py

4 years agoMerge pull request #488 from alimpfard/main+jq
Joel Martin [Mon, 13 Jan 2020 22:48:46 +0000 (16:48 -0600)]
Merge pull request #488 from alimpfard/main+jq

Add Jq implementation

4 years agorefactor atoms out of step4 and step5
AnotherTest [Mon, 13 Jan 2020 22:25:39 +0000 (01:55 +0330)]
refactor atoms out of step4 and step5

also inline step4-and-5-specific versions of env.jq and interp.jq

4 years agorefactor some stuff to adhere to mal guidelines
AnotherTest [Mon, 13 Jan 2020 21:50:01 +0000 (01:20 +0330)]
refactor some stuff to adhere to mal guidelines

4 years agoMerge pull request #489 from def-/master
Joel Martin [Mon, 13 Jan 2020 20:10:06 +0000 (14:10 -0600)]
Merge pull request #489 from def-/master

Fix Nim version for Nim 1.0.4

4 years agoFix Nim version for Nim 1.0.4
Dennis Felsing [Mon, 13 Jan 2020 15:01:59 +0000 (16:01 +0100)]
Fix Nim version for Nim 1.0.4

4 years agoadd stub makefile
AnotherTest [Mon, 13 Jan 2020 19:06:15 +0000 (22:36 +0330)]
add stub makefile

4 years agoorder alphabetically
AnotherTest [Sun, 12 Jan 2020 11:41:47 +0000 (15:11 +0330)]
order alphabetically

4 years agoMerge branch 'main+jq' of https://github.com/alimpfard/mal into main+jq
AnotherTest [Sun, 12 Jan 2020 11:40:42 +0000 (15:10 +0330)]
Merge branch 'main+jq' of https://github.com/alimpfard/mal into main+jq

4 years agoclean up comments
AnotherTest [Sun, 12 Jan 2020 11:39:52 +0000 (15:09 +0330)]
clean up comments

4 years agochange Dockerfile to build on top of ubuntu:bionic
AnotherTest [Sun, 12 Jan 2020 11:33:08 +0000 (15:03 +0330)]
change Dockerfile to build on top of ubuntu:bionic

4 years agoadd jq info to readme
Ali Mohammad Pur [Fri, 10 Jan 2020 14:37:10 +0000 (18:07 +0330)]
add jq info to readme

4 years agobring the let* child env to newwer steps
AnotherTest [Fri, 10 Jan 2020 14:27:51 +0000 (17:57 +0330)]
bring the let* child env to newwer steps

4 years agoadd jq to travis matrix
AnotherTest [Fri, 10 Jan 2020 14:22:44 +0000 (17:52 +0330)]
add jq to travis matrix

4 years agoswitch run to a python script that gives io to the program
AnotherTest [Fri, 10 Jan 2020 14:13:51 +0000 (17:43 +0330)]
switch run to a python script that gives io to the program

4 years agoswitch to tail -f circular pipes
AnotherTest [Fri, 10 Jan 2020 07:14:35 +0000 (10:44 +0330)]
switch to tail -f circular pipes

4 years agocoreutils
AnotherTest [Fri, 10 Jan 2020 06:38:47 +0000 (10:08 +0330)]
coreutils

4 years agoyes
AnotherTest [Fri, 10 Jan 2020 06:36:46 +0000 (10:06 +0330)]
yes

4 years agoxenial is the latest LTS apparently
AnotherTest [Fri, 10 Jan 2020 06:35:34 +0000 (10:05 +0330)]
xenial is the latest LTS apparently

4 years agoswitch to ubuntu :shrug:
AnotherTest [Fri, 10 Jan 2020 06:34:13 +0000 (10:04 +0330)]
switch to ubuntu :shrug:

4 years agochange python version, py2 segfaults
AnotherTest [Fri, 10 Jan 2020 06:25:03 +0000 (09:55 +0330)]
change python version, py2 segfaults

4 years agobusybox has its own timeout
AnotherTest [Fri, 10 Jan 2020 06:11:13 +0000 (09:41 +0330)]
busybox has its own timeout

4 years agoadd Dockerfile
AnotherTest [Fri, 10 Jan 2020 06:08:30 +0000 (09:38 +0330)]
add Dockerfile

4 years agoimplement conj/seq
AnotherTest [Fri, 10 Jan 2020 06:01:00 +0000 (09:31 +0330)]
implement conj/seq

now we're self-hosting

4 years agofix macroexpand
AnotherTest [Fri, 10 Jan 2020 01:13:54 +0000 (04:43 +0330)]
fix macroexpand

4 years agofix printing strings
AnotherTest [Fri, 10 Jan 2020 01:12:39 +0000 (04:42 +0330)]
fix printing strings

4 years agofix weird interaction between let* and fn* and atoms
AnotherTest [Thu, 9 Jan 2020 16:07:24 +0000 (19:37 +0330)]
fix weird interaction between let* and fn* and atoms

4 years agoadd step9 and fix "symbol not found" exception format
AnotherTest [Wed, 8 Jan 2020 16:34:12 +0000 (20:04 +0330)]
add step9 and fix "symbol not found" exception format

4 years agofix atom interactions and unfuck execution speed
AnotherTest [Wed, 8 Jan 2020 14:36:57 +0000 (18:06 +0330)]
fix atom interactions and unfuck execution speed

4 years agoproperly implement tco and add step7:quote
AnotherTest [Tue, 7 Jan 2020 16:43:49 +0000 (20:13 +0330)]
properly implement tco and add step7:quote

4 years agoadd step8
AnotherTest [Tue, 7 Jan 2020 20:26:31 +0000 (23:56 +0330)]
add step8

4 years agoproperly implement tco and add step7:quote
AnotherTest [Tue, 7 Jan 2020 16:43:49 +0000 (20:13 +0330)]
properly implement tco and add step7:quote

4 years agoadd atoms
AnotherTest [Mon, 6 Jan 2020 20:55:22 +0000 (00:25 +0330)]
add atoms

+ fix lists (lists do not behave like let*)
+ add file io

4 years agostart step6 and add the cheaty runtime of cheatiness
AnotherTest [Mon, 6 Jan 2020 16:26:48 +0000 (19:56 +0330)]
start step6 and add the cheaty runtime of cheatiness

4 years agofix scoping and backport print patch
AnotherTest [Mon, 6 Jan 2020 07:30:26 +0000 (11:00 +0330)]
fix scoping and backport print patch

add TCO file, no TCO though (seems ok?)

4 years agoEQUIRECURSION BABY!
AnotherTest [Sun, 5 Jan 2020 23:40:03 +0000 (03:10 +0330)]
EQUIRECURSION BABY!

fix (cheat) print

4 years ago...add step4...
AnotherTest [Sun, 5 Jan 2020 20:25:03 +0000 (23:55 +0330)]
...add step4...

4 years agofix (= list vector) and the case where (((& x) ...)) assigns nothing
AnotherTest [Sun, 5 Jan 2020 20:22:44 +0000 (23:52 +0330)]
fix (= list vector) and the case where (((& x) ...)) assigns nothing

4 years agoimpl step5
AnotherTest [Sun, 5 Jan 2020 19:59:12 +0000 (23:29 +0330)]
impl step5

cannot print raw strings, so a lot of things fail

4 years agostep 3 done~
AnotherTest [Sun, 5 Jan 2020 17:49:41 +0000 (21:19 +0330)]
step 3 done~

4 years agoprepare for later
AnotherTest [Sun, 5 Jan 2020 15:08:15 +0000 (18:38 +0330)]
prepare for later

4 years agostep2 - eval
AnotherTest [Sun, 5 Jan 2020 15:05:49 +0000 (18:35 +0330)]
step2 - eval

Since we can't store functions, this is gonna be a _mess_

4 years agoall tests passing yay
AnotherTest [Sun, 5 Jan 2020 14:03:09 +0000 (17:33 +0330)]
all tests passing yay

4 years ago"fix" more reader stuff
AnotherTest [Sun, 5 Jan 2020 13:36:06 +0000 (17:06 +0330)]
"fix" more reader stuff

4 years agobasic...? impl
AnotherTest [Sun, 5 Jan 2020 11:02:39 +0000 (14:32 +0330)]
basic...? impl

4 years agoMerge pull request #478 from rjtobin/zig
Joel Martin [Fri, 20 Dec 2019 06:43:01 +0000 (00:43 -0600)]
Merge pull request #478 from rjtobin/zig

Zig implementation

4 years agozig: readme and travis
Josh Tobin [Fri, 20 Dec 2019 04:24:54 +0000 (23:24 -0500)]
zig: readme and travis

4 years agozig: remove env usage in step2
Josh Tobin [Thu, 19 Dec 2019 05:07:11 +0000 (00:07 -0500)]
zig: remove env usage in step2