Simon Forman
64d4a42978
autoformat
2022-09-23 08:38:17 -07:00
Simon Forman
c76ae9979d
Ocaml FTW!
2022-09-23 08:37:04 -07:00
Simon Forman
8cb04fc72d
At this point...
...
...I'm just relearning C semantics. (And they are garbage, as is widely
known.)
I don't think there's much point to this (at the moment) because I don't
want to relearn C (at the moment) and Nim is available (at the moment.)
Really, I'm trying to do away with the entire relationship of C et. al.
to the underlying machine. (For instance, Nim gives you a much nicer
relationship, without the vast distance that, say, Python imposes.) I
should really look at other compiled languages, like Ocaml or Julia.
2022-09-22 20:43:25 -07:00
Simon Forman
ae864909ee
Create an int and add ints.
2022-09-22 20:08:24 -07:00
Simon Forman
5caa685bab
Try using GC_register_finalizer?
2022-09-22 19:34:57 -07:00
Simon Forman
5ceab61ca1
Maybe this is the right thing to do?
...
https://stackoverflow.com/questions/59489221/using-the-gmp-library-with-boehms-garbage-collector
2022-09-22 19:00:40 -07:00
Simon Forman
813c5c0a23
What would a little C Joy look like?
...
Let's use GMP for ints and Boehm GC.
2022-09-22 17:26:28 -07:00
Simon Forman
92338037e7
Wait for both results together.
...
If one causes an error before the other is finished SIGKILL the other
job. (I do not know if this will kill the sub-tasks if any. The Python
docs say that with terminate() "descendant processes of the process will
not be terminated – they will simply become orphaned." but it doesn't
say whether that's true with kill().
2022-09-22 13:20:30 -07:00
Simon Forman
0904bad81b
Capture and fwd exceptions in subforks.
...
(Should there be only one subtask? Do the other quote in the main
proc?)
2022-09-22 11:41:16 -07:00
Simon Forman
50293908d9
Let's play with more cores.
2022-09-22 09:13:11 -07:00
Simon Forman
caa4461217
Basic system, incomplete.
...
Still needs the rest of the core functions and defs.
Could read defs from a file at compile-time?
Integer math? Boolean ops? Just type inference and maybe compiling?
2022-09-20 17:56:18 -07:00
Simon Forman
b49e7458c2
Parse the tokens into a Joy expression.
2022-09-20 17:14:41 -07:00
Simon Forman
c8f67f02f9
Parser in GNU Prolog.
...
Wonky handling of UTF_8 blankspace.
2022-09-20 16:29:35 -07:00
Simon Forman
3f4e9d9fe2
The whole thing is kind of a mess.
2022-09-20 14:22:47 -07:00
Simon Forman
d080cd20c7
Let simple joy be joy.
...
Still to do: clear away the rest of the old cruft.
2022-09-20 11:12:59 -07:00
Simon Forman
2367191918
Remove cruft.
2022-09-20 11:12:28 -07:00
Simon Forman
283832c649
Minor cleanup.
2022-09-20 10:20:58 -07:00
Simon Forman
a6ff9857d2
Add trace word back in.
...
Remove pretty_print module.
Still to do: update Nim implementation with a trace function. ;)
2022-09-20 10:19:45 -07:00
Simon Forman
36a9967e6c
Fix typo in hyperlink in README.
2022-09-19 19:43:34 -07:00
Simon Forman
fab172daf4
Minor cleanup.
2022-09-19 13:25:09 -07:00
Simon Forman
668040f6c6
Add a flowchart for the interpreter.
...
Using PlantUML.
2022-09-19 13:22:31 -07:00
Simon Forman
b2a1f40155
Fixed bug in appN
...
while updating some Jupyter notebooks with the Joypy kernel.
2022-09-16 20:49:46 -07:00
Simon Forman
3d1dc6232e
Remove old docs.
2022-09-16 17:54:42 -07:00
Simon Forman
466bf3d79b
A bit more docs.
2022-09-16 12:28:13 -07:00
Simon Forman
dbcbf16bc9
Got back the LI for lower-cased title notebooks.
...
Not sure what went wrong there.
2022-09-16 11:27:00 -07:00
Simon Forman
406740bbd6
Whence fun_with_scan and with_sympy?
2022-09-16 11:06:30 -07:00
Simon Forman
9de71c84bf
Cleaning up docs.
...
Kinda...
2022-09-16 09:03:42 -07:00
Simon Forman
7a25eee481
The (crude) site.
...
It's funny that I'm using nbconvert, markdown, pandoc, tidy, and of
course python, all to make a simple static website...
"There's got to be a better way!"
2022-09-16 07:36:28 -07:00
Simon Forman
b67fc46291
Function Reference
2022-09-16 07:35:11 -07:00
Simon Forman
ea52cd7bfb
bits and pieces
2022-09-15 19:17:56 -07:00
Simon Forman
fe6567fd9e
Rework docs, simpler (no Sphinx.)
2022-09-15 18:14:01 -07:00
Simon Forman
68838155dc
delete all the extra notebook conversions
2022-09-15 18:11:16 -07:00
Simon Forman
aad6777bb9
Ignore the Nim joy binary.
2022-09-15 09:34:39 -07:00
Simon Forman
77b1638d64
Check for minus before converting to int.
...
BigInts converts "-" to 0. This happens in the parser before you get to
the evaluator.
2022-09-14 21:09:20 -07:00
Simon Forman
9d7a2a8fcb
Minor cleanup, subtraction.
...
Testing with the joytest test suite revealed that I had forgotten to
implement subtraction. This also unconvered a (maybe) bug in the
BigInts package where it converts "-" to zero.
https://git.sr.ht/~sforman/joytest
https://github.com/nim-lang/bigints/issues/116
2022-09-14 21:01:50 -07:00
Simon Forman
39008b351b
Let simplejoy be joy.
...
Simple pleasures are the best.
2022-09-14 20:15:25 -07:00
Simon Forman
f5265a2287
Remove old code.
2022-09-14 20:14:34 -07:00
Simon Forman
3f7adea56f
Read defs.txt at compile-time.
...
I'd like to build the dict datastructure at compile-time too but I'm not
going to figure that out tonight. It's enough that the defs are
embedded in the executable. (You can see them with the strings utility.)
2022-09-14 20:08:40 -07:00
Simon Forman
30c57c180b
basis complete
2022-09-14 18:51:58 -07:00
Simon Forman
0f79f089a6
dup, first, i, loop
2022-09-14 15:48:25 -07:00
Simon Forman
f86e1b2e7c
dip and cons
2022-09-14 15:04:07 -07:00
Simon Forman
129a5f776d
Rewrite expression to use list instead of list node.
2022-09-14 14:36:29 -07:00
Simon Forman
9e5d699b0f
Minor cleanup.
2022-09-14 13:31:44 -07:00
Simon Forman
3d199c1106
Reuse as_list().
2022-09-14 11:24:56 -07:00
Simon Forman
9f04aa97e2
Cleaning up the code.
2022-09-14 10:49:13 -07:00
Simon Forman
6eb71b3c6e
Nimpretty reformat. Two-space indentation.
2022-09-14 09:49:33 -07:00
Simon Forman
6b07d7d30b
Minor cleanup
2022-09-14 09:46:31 -07:00
Simon Forman
94929e8520
Let's pile Nim code into one file too, why not?
2022-09-14 09:45:34 -07:00
Simon Forman
aad2da35cf
divmod
...
We don't need floor if we have only ints.
Id is too easy as a definition.
divmod is cool.
2022-09-12 16:38:14 -07:00
Simon Forman
1e3b2f76bb
step, times
2022-09-12 16:07:21 -07:00