1
1
mirror of https://github.com/kanaka/mal.git synced 2024-10-26 22:28:26 +03:00
Commit Graph

3203 Commits

Author SHA1 Message Date
AnotherTest
fd99084ca6 no more infinite boot times!
move the repl inside XSLT itself, as a result, we'll exit the repl
after 100000000 iterations, but...that's probably enough for a lot
of things
2020-05-30 23:37:21 +04:30
AnotherTest
e4882d7d71 attempt to speed execution up
by booting up multiple instancees of saxon, waiting for a signal
This doesn't really help much, since most of our tests are very small
however, it does lower the overall boot time (assuming travis can do
real concurrency)
2020-05-30 23:37:21 +04:30
AnotherTest
73e80a3974 ...add default target back 🤦
I'm sorry, travis....
2020-05-30 23:37:21 +04:30
AnotherTest
645a03553a makefile tweak to avoid failure~ 2020-05-30 23:37:21 +04:30
AnotherTest
a1252d40dd eliminate unnecessary env serialisations
gains about 40% performance (on average?)
2020-05-30 23:37:21 +04:30
AnotherTest
1c2f45cfe5 format all xslt files 2020-05-30 23:37:21 +04:30
AnotherTest
92ff68a8b1 remove irrelevant comment 2020-05-30 23:37:20 +04:30
AnotherTest
0365ac1252 we can now self-host 🎉 2020-05-30 23:37:20 +04:30
AnotherTest
8ff20ab862 try to avoid spammy "No such file or directory" errors
it doesn't happen on my machine, not sure why it does that
2020-05-30 23:37:20 +04:30
AnotherTest
64eb1e7d56 we can now self-host...almost
Atoms still need some ironing out, something is not updating them
properly
Also unknown is an issue where `def!` is not updating the env, probably
related to the above problem
2020-05-30 23:37:20 +04:30
AnotherTest
091b0e0518 apply @kanaka's patch to Dockerfile 2020-05-30 23:37:20 +04:30
AnotherTest
e8c4b5eadb add xslt to build matrix 🤦 2020-05-30 23:37:20 +04:30
AnotherTest
f130c9a2f0 add a dockerfile with saxon in it 2020-05-24 02:27:17 +04:30
AnotherTest
c77e046409 be more spec-compatible with readline 2020-05-24 02:27:17 +04:30
AnotherTest
4c50b6736b add 'xpath-eval', and fix most running issues
- step7 still has the replEnv-values-are-not-captured issue
2020-05-24 02:27:17 +04:30
AnotherTest
d83ad64a13 fix (fn? +) ;=> false 2020-05-24 02:27:17 +04:30
AnotherTest
e914bc2d59 oops. 2020-05-24 02:27:17 +04:30
AnotherTest
607023b703 rebase to kanaka/mal 2020-05-24 02:27:17 +04:30
AnotherTest
de6a100c42 generate perf analysis 2020-05-24 02:27:17 +04:30
AnotherTest
309b36eea0 fix previous env issue
perf tests run, still can't self-host
2020-05-24 02:27:17 +04:30
AnotherTest
d4798a5731 impl everything, passes tests, has some weird bug with eval
- investigate the case where (eval ...) loses the entire env
2020-05-24 02:27:17 +04:30
AnotherTest
9c04968f90 Implement step9 fully. pass all tests~ 2020-05-24 02:27:16 +04:30
AnotherTest
08e24d4117 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
2020-05-24 02:27:16 +04:30
AnotherTest
d91d092f76 fix in-file step name 2020-05-24 02:27:16 +04:30
AnotherTest
0a8bc7de34 implement step7-quote 2020-05-24 02:27:16 +04:30
AnotherTest
d125e4411f remove debug function 2020-05-24 02:27:16 +04:30
AnotherTest
ab29f6bd37 impl step6
separate replEnv from function environments, so as to decrease base size
(state size is still O(2^n))
2020-05-24 02:27:16 +04:30
AnotherTest
342a5b36c3 impl step4, fix string parsing 2020-05-24 02:27:16 +04:30
AnotherTest
296cab4c51 print functions as #<fn name> 2020-05-24 02:27:16 +04:30
AnotherTest
b10698ecc6 impl step3 fully. passes all tests 2020-05-24 02:27:16 +04:30
AnotherTest
e93ba76def handle vectors and hashmaps 2020-05-24 02:27:16 +04:30
AnotherTest
b650f47981 impl step2, remove interleaved calls in READ/EVAL/PRINT 2020-05-24 02:27:16 +04:30
AnotherTest
b86f74e460 start step2-eval 2020-05-24 02:27:16 +04:30
AnotherTest
e1deef63fe pass all step1 tests 2020-05-24 02:27:16 +04:30
AnotherTest
78ec3e6290 add reader macros 2020-05-24 02:27:16 +04:30
AnotherTest
cdb0217672 complete required functionality for step1 2020-05-24 02:27:16 +04:30
AnotherTest
bfae91ccdc starting xslt impl 2020-05-24 02:27:16 +04:30
Joel Martin
805ae7b280
Merge pull request #510 from bjh21/bjh21-runtest-simpler
Simplify runtest.py's input handling
2020-05-23 11:39:13 -05:00
Ben Harris
ab7ecbbcad 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.
2020-05-23 11:51:51 +01:00
Ben Harris
d7f5f54c38 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.
2020-05-23 11:51:52 +01:00
Joel Martin
5952e9dcc9
Merge pull request #506 from gabrielmadruga/master
Update and fixes for the lua implementation.
2020-05-21 18:39:49 -05:00
Joel Martin
73cd4374ba
Merge pull request #508 from bjh21/bjh21-throwtests
Add tests for nested exception handlers
2020-05-21 18:07:15 -05:00
Joel Martin
b71e37e409
Merge pull request #509 from bjh21/bjh21-ps-catch
ps: Fix handling of exceptions thrown from `catch*` clause
2020-05-21 18:05:03 -05:00
Ben Harris
e069ddff67 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).
2020-05-21 21:21:55 +01:00
Ben Harris
5fb74d336f 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.
2020-05-19 10:28:21 +01:00
Gabriel M
d4fc4551a0 Change os.clock multiplier, update Dockerfile to use lua 5.3.5.5 2020-05-17 14:23:54 -03:00
Joel Martin
89b940ae62
Merge pull request #505 from bjh21/bjh21-test-readatom
Step 6: Test read-string of a single atom at the end of input
2020-05-16 17:52:52 -05:00
Gabriel M
024e0b0415 Update README.md 2020-05-15 23:33:26 -03:00
Gabriel M
e2b93732eb Change \177 to \u{029e}, correctly define keyword, change loadstring to load 2020-05-15 23:09:09 -03:00
Gabriel M
a62a56f535 Add lrexlib-pcre through luarocks. 2020-05-15 22:04:45 -03:00