Commit Graph

74 Commits

Author SHA1 Message Date
Simon Forman 7f193fbdbe This brings Python Joy into congruence with Nim.
It's hacky.  I edited the generated file.  The more complicated
functions like popop will not generate the same errors as the Nim
versions.  This is only congruence in the sense that the current jtest
suite passes identically on both.

Ideally I should be generating both the Nim and Python code from the
Prolog compiler.
2021-04-09 18:01:07 -07:00
Simon Forman 8e0472a5ff Correct swap. 2021-04-09 17:49:44 -07:00
Simon Forman 7957136ac3 Correct swaack. 2021-04-09 17:46:45 -07:00
Simon Forman e417842923 Customizing error messages. 2021-04-09 17:41:42 -07:00
Simon Forman 49bcab2e91 Correct i combinator. 2021-04-09 17:13:09 -07:00
Simon Forman 8c65046420 Interesting that Nim checks type of first arg...
...before stack depth of second arg.
2021-04-09 16:59:06 -07:00
Simon Forman 227e8b124b Bringing it in line with Nim version. 2021-04-09 16:58:38 -07:00
Simon Forman 65b2b4a7e3 Switch back to spaces for indentation.
For better or worse, Python 3 won.  No need to be shitty about it, eh?
2021-04-09 16:16:34 -07:00
Simon Forman b2c449dd66 Print Boolean values with lowercase intitial letters. 2021-04-06 11:41:39 -07:00
Simon Forman 1cf82b8bcb Don't let module imports have side-effects.
The pretty printer module was inscribing the trace command as a side-
effect of importing it.
2020-12-19 23:53:04 -08:00
Simon Forman aa43eb6684 Minor cleanup. 2020-12-18 16:10:45 -08:00
Simon Forman 90eef110d1 Drag-n-Drop stack util function. 2020-12-17 21:02:26 -08:00
Simon Forman ba0c24c39b Minor cleanup. 2020-05-20 15:34:30 -07:00
Simon Forman 8bd0e7ce0e Remove the types stuff et. al. 2020-05-19 13:01:37 -07:00
Simon Forman 548709c87a Format lists properly. 2020-05-10 12:46:33 -07:00
Simon Forman ddf063973c Trace command.
Don't print trace by default, instead a new `trace` combinator wirks like `i` and prints a trace.
2020-04-28 15:28:43 -07:00
Simon Forman 078f29830d Switch to tabs for indentation.
Instead of a mix of 2- and 4-space tabs just use actual tabs.  ;-P
2020-04-24 12:48:15 -07:00
Simon Forman 6fe11aa205 Remove `__next__`. 2020-04-24 10:32:48 -07:00
Simon Forman 29d510eb46 futurize stage2 core 2020-04-23 23:33:23 -07:00
Simon Forman b0df80f3e6 futurize stage1 core 2020-04-23 23:16:45 -07:00
Simon Forman 8d0d0de897 Fixes #38239 rename parameter of stack.pick() 2020-04-23 21:39:29 -07:00
Simon Forman 3b0b7659b3 A bunch of docs.
Things have kind of run away with me.  I've been working in Prolog for
the last month or so.  I'm not yet sure how to bring it together with the
Python code.
2018-08-24 16:48:15 -07:00
Simon Forman c88e00ecd0 Add binary functions. 2018-08-02 14:22:42 -07:00
Simon Forman dae5126bfc In progress.. 2018-08-01 12:26:50 -07:00
Simon Forman 5974c516d1 Working on compiler.
I have a simple dataflow thingy for some Yin and Yang functions.
2018-08-01 10:59:07 -07:00
Simon Forman 33a952ff71 Config file and CLI arg parser. 2018-07-21 17:56:53 -07:00
Simon Forman ca06c626e1 Loop and while combinators. 2018-07-20 12:33:06 -07:00
Simon Forman dea6cbc8c2 Working to get types right. 2018-07-19 12:38:19 -07:00
Simon Forman 6576e1a431 Fix TextJoyType inheritance. 2018-07-18 17:47:19 -07:00
Simon Forman 49941f9a33 Log types at startup. 2018-07-18 17:06:51 -07:00
Simon Forman 1e8c196c5b Add some logging. 2018-07-18 16:14:32 -07:00
Simon Forman 8ad4ab791b Removing polytypes; some pylint hints. 2018-07-18 14:55:39 -07:00
Simon Forman 7607ca7650 Definitions infer stack effects.
At start-up defs that DON'T type check are permitted (so you can use e.g.
loop, map, etc.) in the definitions "source", but then the user-facing
inscribe command only allows you to define new commands that DO
type-check.  The ideal solution here is to get inference working for the
loopy words.  (In the meantime you can select and execute their
definition text directly.  That's not (yet!) type-checked.)
2018-07-17 20:52:57 -07:00
Simon Forman c9f405fbe9 Nearly there maybe, maybe not. 2018-07-17 20:09:17 -07:00
Simon Forman 73d19b1f3d Moving right along.
A little clunky but it seems to work so far.
2018-07-17 17:12:27 -07:00
Simon Forman c2dd7cca0a So fra, so good... 2018-07-17 12:43:24 -07:00
Simon Forman 25b7871074 i got used to it, but Jupyter likes 4 2018-07-17 10:49:09 -07:00
Simon Forman 14d67dd7c5 in the middle, just want to 2ify my indents... 2018-07-17 10:47:50 -07:00
Simon Forman 0029656351 TextJoyType and inscribe command.
I took the plunge and added the meta-command "inscribe" to the library.
This is, of course, a very dangerous and powerful command.  Use it
wisely.
2018-07-17 10:35:11 -07:00
Simon Forman d9d52fa224 A few more stack effects. 2018-07-16 20:28:53 -07:00
Simon Forman 3551b6148b expectations_of_definition() and some helper infer funcs. 2018-07-16 19:10:16 -07:00
Simon Forman 043acd685c More stack effects, and modify the key bindings. 2018-07-16 18:43:40 -07:00
Simon Forman cf12b9ce17 Fix bugs
Type checking e.g. sum or product.
Any type accepts complex numbers.
Lots of the math functions now just use Number rather than more specific
poly-types.
2018-07-15 20:37:52 -07:00
Simon Forman c4af5682c4 That "fix" wasn't a fix.
It broke other stuff.  What I really wanted to do was change the stack
effect of 'clear'.
2018-07-15 14:06:10 -07:00
Simon Forman 20d87db9d5 Fix up stacks for type checking.
Sometimes (e.g. 'clear') the () at the end of the stack was tripping up
the unify() function.
2018-07-15 13:57:11 -07:00
Simon Forman e169c6aae2 Some integration with Type Checking.
Now the UI highlights commands and numbers as you move the mouse, numbers
are blue, commands that type-check are green, commands that fail to
type-check are orange and will not be interpreted, and if there is no
stack effect information available for a command it is grey but you can
still attempt to execute it.

You can still evaluate whole expressions by selceting them and
right-inter-clicking before you release the left button, or by putting
the cursor on a line and typing ctrl-enter, which will run the whole
line.  These expressions are NOT (yet) type-checked.
2018-07-15 11:48:08 -07:00
Simon Forman fcf483af22 Ah, Symbols. 2018-07-11 07:12:14 -07:00
Simon Forman 343a2f8459 Unicode in docstring. 2018-07-11 07:11:56 -07:00
Simon Forman d95b92314e Clean up. 2018-07-06 14:20:04 -07:00
Simon Forman 1862ece03e Adding support for type checking. 2018-07-06 14:19:36 -07:00