Elm README.

And minor edits.
This commit is contained in:
sforman 2023-07-31 11:30:12 -07:00
parent ac286a283f
commit 45f00c8f2e
3 changed files with 47 additions and 28 deletions

View File

@ -0,0 +1,10 @@
# Joy interpreter in Elm
> Simple pleasures are the best.
This interpreter written in Elm is part of the Thun project.
You should be able to run `elm reactor` in this directory and then
browse to http://localhost:8000/src/Main.elm to try the interpreter.

View File

@ -7,47 +7,33 @@ includes interpreters written in Python and Prolog, and some explorations
towards compilers for Joy written in Prolog. towards compilers for Joy written in Prolog.
## Building
To build an executable just run:
nim c joy.nim
To build and immediately run an executable use:
nim c -r joy.nim
To build a smaller binary do:
nim c -d:release joy.nim
strip --strip-debug joy.exe
## Dependencies ## Dependencies
- Nim functional programming library https://github.com/vegansk/nimfp - Nim functional programming library https://github.com/vegansk/nimfp
- Pure Nim (i.e. not GMP) BigInts library https://github.com/def-/nim-bigints - Pure Nim (i.e. not GMP) BigInts library https://github.com/def-/nim-bigints
- ... - ...
If you have `nimble` installed:
nimble install bigints nimfp
## Building
To build an executable just run:
make
This will copy the `implementations/defs.txt` file into the Nim project and
compile the `joy` executable.
## TODOs: ## TODOs:
- link to other Thun sub-projects & info on Joy in general
- ctrl-c should exit cleanly - ctrl-c should exit cleanly
- graphics? - graphics?
- `words` and `help`? - `words` and `help`?
- How to integrate docs? - How to integrate docs?
nim cc \
-d:release \
--stackTrace:off \
--lineTrace:off \
--checks:off \
--assertions:off \
--debugger:native \
joy.nim
nim doc --project --index:on --git.url:"https://git.sr.ht/~sforman/Bliss" --git.commit:10b5651ed242fb16c29f2c1f7340d77f65926ca4 --outdir:htmldocs joy.nim
https://git.sr.ht/~sforman/Bliss/tree/10b5651ed242fb16c29f2c1f7340d77f65926ca4/item/types.nim#L26

23
misc.txt Normal file
View File

@ -0,0 +1,23 @@
(I had the Python package set up to upload to PyPI as "Thun", but the
whole Python distribution story seems unsettled at the moment (2023) so
I've gone back to the *old ways*: there is a single script ``joy.py``
that gets modified (``defs.txt`` is inserted) to create a ``joy`` script
that uses the "shebang" trick to pretend to be a binary. In other words,
run ``make`` and put the resulting ``joy`` script in your PATH, if that's
what you want to do. In a year or two the Python folks will have sorted
things out and we can go back to ``pip install Thun`` or whatever.)
nim cc \
-d:release \
--stackTrace:off \
--lineTrace:off \
--checks:off \
--assertions:off \
--debugger:native \
joy.nim
nim doc --project --index:on --git.url:"https://git.sr.ht/~sforman/Bliss" --git.commit:10b5651ed242fb16c29f2c1f7340d77f65926ca4 --outdir:htmldocs joy.nim
https://git.sr.ht/~sforman/Bliss/tree/10b5651ed242fb16c29f2c1f7340d77f65926ca4/item/types.nim#L26