OSDN Git Service

joypy/Thun.git
9 months agoAdd definition for xor.
sforman [Wed, 16 Aug 2023 17:05:30 +0000 (10:05 -0700)]
Add definition for xor.

9 months agoWorking on the notebooks.
sforman [Wed, 16 Aug 2023 17:04:52 +0000 (10:04 -0700)]
Working on the notebooks.

9 months agoUpdating notebooks
sforman [Mon, 14 Aug 2023 16:18:04 +0000 (09:18 -0700)]
Updating notebooks

to not use Jupyter because I can't figure out how to use the Joy kernel.

9 months agoWorking on the website for Thun.
sforman [Sun, 13 Aug 2023 21:30:57 +0000 (14:30 -0700)]
Working on the website for Thun.

I'm going to eventually update the old Sphinx-generated site on OSDN.

9 months agocleanup
sforman [Sun, 13 Aug 2023 15:49:20 +0000 (08:49 -0700)]
cleanup

9 months agoPut this over there.
sforman [Sun, 13 Aug 2023 15:48:06 +0000 (08:48 -0700)]
Put this over there.

9 months agoMinor edits.
sforman [Sun, 13 Aug 2023 15:47:16 +0000 (08:47 -0700)]
Minor edits.

9 months agoMessing around with type inference.
sforman [Sat, 12 Aug 2023 23:45:59 +0000 (16:45 -0700)]
Messing around with type inference.

What if we insist that both branches of a branch have compatible types?

For one thing `[+] [* +] branch` leads to a circular term which, when
printed, goes into a loop: "int,int,int,...".  Hmm...

9 months agofor-each
sforman [Sat, 12 Aug 2023 21:09:44 +0000 (14:09 -0700)]
for-each

9 months agoA crude main loop.
sforman [Sat, 12 Aug 2023 20:03:42 +0000 (13:03 -0700)]
A crude main loop.

I know there are better ways to do this, but I don't know what they are
yet.  Maybe a "do" loop?  Anyway, this works, although it doesn't catch
errors yet.

9 months agoMinor edit.
sforman [Sat, 12 Aug 2023 19:55:25 +0000 (12:55 -0700)]
Minor edit.

9 months agoLittle updates to the spec doc.
sforman [Sat, 12 Aug 2023 17:36:19 +0000 (10:36 -0700)]
Little updates to the spec doc.

9 months agoMinor edits.
sforman [Sat, 12 Aug 2023 15:40:55 +0000 (08:40 -0700)]
Minor edits.

9 months agoUpdate defs.scm
sforman [Sat, 12 Aug 2023 15:26:59 +0000 (08:26 -0700)]
Update defs.scm

9 months agoMerge in the test suite.
sforman [Sat, 12 Aug 2023 15:19:54 +0000 (08:19 -0700)]
Merge in the test suite.

Why not?

(I have a slow tide, expand into pieces, contract into units, and back
again.  This is part of a contract and unify phase.)

9 months agoMath ops, definitions for left- and right-shift.
sforman [Sat, 12 Aug 2023 15:04:21 +0000 (08:04 -0700)]
Math ops, definitions for left- and right-shift.

9 months agomul div mod add sub in Nim
sforman [Sat, 12 Aug 2023 14:54:33 +0000 (07:54 -0700)]
mul div mod add sub in Nim

9 months agofirst rest
sforman [Sat, 12 Aug 2023 06:02:46 +0000 (23:02 -0700)]
first rest

9 months agoconcat cons comparison
sforman [Sat, 12 Aug 2023 05:48:25 +0000 (22:48 -0700)]
concat cons comparison

9 months agoloop
sforman [Sat, 12 Aug 2023 04:27:41 +0000 (21:27 -0700)]
loop

9 months agobranch and refactor simple functions.
sforman [Sat, 12 Aug 2023 04:15:26 +0000 (21:15 -0700)]
branch and refactor simple functions.

The refactor should be a macro but I don't know how to write those yet
(apparently there are different macros systems...  ooo la la!)

9 months agodip
sforman [Sat, 12 Aug 2023 03:47:53 +0000 (20:47 -0700)]
dip

9 months agoi
sforman [Sat, 12 Aug 2023 03:45:25 +0000 (20:45 -0700)]
i

9 months agoswap
sforman [Sat, 12 Aug 2023 03:38:01 +0000 (20:38 -0700)]
swap

9 months agopop
sforman [Sat, 12 Aug 2023 03:34:40 +0000 (20:34 -0700)]
pop

9 months agostack, swaack
sforman [Fri, 11 Aug 2023 18:11:51 +0000 (11:11 -0700)]
stack, swaack

9 months agoAdd copyleft notice.
sforman [Fri, 11 Aug 2023 18:03:00 +0000 (11:03 -0700)]
Add copyleft notice.

9 months agoLoad defs at compile time.
sforman [Fri, 11 Aug 2023 17:48:33 +0000 (10:48 -0700)]
Load defs at compile time.

I don't really know the proper way to do this, but I managed to whump
something up.

9 months agoEvaluate definitions.
sforman [Fri, 11 Aug 2023 17:31:53 +0000 (10:31 -0700)]
Evaluate definitions.

9 months agoConvert defs.txt to defs.scm.
sforman [Fri, 11 Aug 2023 17:15:31 +0000 (10:15 -0700)]
Convert defs.txt to defs.scm.

Gonna need a makefile.

9 months agoLoad defs from defs.txt.
sforman [Fri, 11 Aug 2023 15:50:00 +0000 (08:50 -0700)]
Load defs from defs.txt.

They are loaded at runtime though :(  shouldn't be too hard to fix that?

9 months agoA start on dictionaries using srfi-69 hash tables.
sforman [Fri, 11 Aug 2023 04:49:37 +0000 (21:49 -0700)]
A start on dictionaries using srfi-69 hash tables.

9 months agoUse '->' in names of functions that convert values.
sforman [Fri, 11 Aug 2023 04:48:46 +0000 (21:48 -0700)]
Use '->' in names of functions that convert values.

9 months agodup
sforman [Fri, 11 Aug 2023 04:47:54 +0000 (21:47 -0700)]
dup

9 months agominor edit
sforman [Fri, 11 Aug 2023 04:46:56 +0000 (21:46 -0700)]
minor edit

9 months agoIt's more efficient to concat the empty list
sforman [Fri, 11 Aug 2023 04:45:40 +0000 (21:45 -0700)]
It's more efficient to concat the empty list

than to concate a non-empty list onto the empty list.

9 months agoA start on simple functions.
sforman [Fri, 4 Aug 2023 17:38:52 +0000 (10:38 -0700)]
A start on simple functions.

I'm sure there's a cooler way to do this, but it works.  (This is my
first Scheme code.)

9 months agoParser emits errors; joy
sforman [Fri, 4 Aug 2023 16:52:09 +0000 (09:52 -0700)]
Parser emits errors; joy

9 months agojoy-expression-to-string
sforman [Fri, 4 Aug 2023 15:14:45 +0000 (08:14 -0700)]
joy-expression-to-string

9 months agotext-to-expression
sforman [Fri, 4 Aug 2023 14:47:12 +0000 (07:47 -0700)]
text-to-expression

9 months agoIt's Joy.
sforman [Fri, 4 Aug 2023 14:43:05 +0000 (07:43 -0700)]
It's Joy.

Or will be soon.

9 months agoParser.
sforman [Fri, 4 Aug 2023 07:33:11 +0000 (00:33 -0700)]
Parser.

9 months agoScheme, eh?
sforman [Thu, 3 Aug 2023 18:28:46 +0000 (11:28 -0700)]
Scheme, eh?

9 months agoSWIProlog can't not emit '.'.
sforman [Thu, 3 Aug 2023 05:38:04 +0000 (22:38 -0700)]
SWIProlog can't not emit '.'.

I would like the GNU Prolog and SWI Prolog versions to be compatible, if
possible.

SWI has bigints, GNU doesn't, so that's a wrinkle...

9 months agoThread the dict through the interaction loop.
sforman [Thu, 3 Aug 2023 04:19:43 +0000 (21:19 -0700)]
Thread the dict through the interaction loop.

Like a total newbie I put the call to the interpreter in the view
function instead of the update function!  I thought it was weird having
to specify the HTML twice, but I figured I was just doing it wrong.  I
was, but not in the way I suspected.

In any event, I like how this make it clear that errors can't affect the
dictionary.

9 months agoChecked old defs.
sforman [Thu, 3 Aug 2023 02:37:36 +0000 (19:37 -0700)]
Checked old defs.

I forgot `over`!

9 months agoTalk about symbols on the stack.
sforman [Thu, 3 Aug 2023 02:08:42 +0000 (19:08 -0700)]
Talk about symbols on the stack.

9 months agoA spec doc for Thun.
sforman [Thu, 3 Aug 2023 01:52:31 +0000 (18:52 -0700)]
A spec doc for Thun.

It's not very good yet, or formal, "but it's mine and I love it."

9 months ago_isnt_bool _isnt_two_bools
sforman [Wed, 2 Aug 2023 16:06:11 +0000 (09:06 -0700)]
_isnt_bool _isnt_two_bools

These probably won't last?

9 months agominor edits
sforman [Mon, 31 Jul 2023 19:08:39 +0000 (12:08 -0700)]
minor edits

9 months agoElm README.
sforman [Mon, 31 Jul 2023 18:30:12 +0000 (11:30 -0700)]
Elm README.

And minor edits.

9 months agominor edits
sforman [Mon, 31 Jul 2023 18:22:44 +0000 (11:22 -0700)]
minor edits

9 months agominor edits
sforman [Mon, 31 Jul 2023 18:17:05 +0000 (11:17 -0700)]
minor edits

9 months agominor edits
sforman [Mon, 31 Jul 2023 18:06:13 +0000 (11:06 -0700)]
minor edits

9 months agoOops, that is not a definition of `first`.
sforman [Mon, 31 Jul 2023 17:44:38 +0000 (10:44 -0700)]
Oops, that is not a definition of `first`.

9 months agoMinor edits.
sforman [Mon, 31 Jul 2023 17:36:53 +0000 (10:36 -0700)]
Minor edits.

9 months agoMinor edits.
sforman [Sun, 30 Jul 2023 23:34:56 +0000 (16:34 -0700)]
Minor edits.

9 months agoI think I have got it.
sforman [Sun, 30 Jul 2023 23:16:51 +0000 (16:16 -0700)]
I think I have got it.

9 months agoegad
sforman [Sun, 30 Jul 2023 23:14:52 +0000 (16:14 -0700)]
egad

9 months agoweird symbols in table
sforman [Sun, 30 Jul 2023 23:03:17 +0000 (16:03 -0700)]
weird symbols in table

9 months agomdtableeeeee
sforman [Sun, 30 Jul 2023 23:01:09 +0000 (16:01 -0700)]
mdtableeeeee

9 months agoMD TABLE!?
sforman [Sun, 30 Jul 2023 22:54:07 +0000 (15:54 -0700)]
MD TABLE!?

9 months agoSort out the and/or/... ops.
sforman [Sun, 30 Jul 2023 22:51:29 +0000 (15:51 -0700)]
Sort out the and/or/... ops.

9 months agoCrude type checking.
sforman [Sun, 30 Jul 2023 22:42:55 +0000 (15:42 -0700)]
Crude type checking.

I forget why I was doing "not not" so I made it a little more clear.  In
practice this is regressive:  The built-in "isnt_bool" function should
be in the dictionary?  Or prohibit type checking and let the bugs flow?
Rely on inference to prevent bugs that would pass the non-checking
versions of the functions?  Hmm...

9 months agoName Boolean ops.
sforman [Sun, 30 Jul 2023 22:41:58 +0000 (15:41 -0700)]
Name Boolean ops.

So they don't overshadow the defs for the short-circuiting combinators.

9 months agoError type (not just a string.)
sforman [Sun, 30 Jul 2023 21:59:09 +0000 (14:59 -0700)]
Error type (not just a string.)

This is mostly for fun, but I bet it comes in handy, eh?

At the very least, it's a nice catalog of the possible errors that the
basic Joy system might encounter.

9 months agotype alias JoyFunction
sforman [Sun, 30 Jul 2023 21:27:27 +0000 (14:27 -0700)]
type alias JoyFunction

9 months agoFormat.
sforman [Sun, 30 Jul 2023 14:47:26 +0000 (07:47 -0700)]
Format.

9 months agoinscribe, definitions.
sforman [Sun, 30 Jul 2023 14:45:06 +0000 (07:45 -0700)]
inscribe, definitions.

9 months agoInitialize dict with defs.
sforman [Sun, 30 Jul 2023 00:10:45 +0000 (17:10 -0700)]
Initialize dict with defs.

Just sqr for now, but it shows that it works.

I would like to return Results from add_def but it makes using foldl
slightly tricky,  not a lot, just slightly, and my brainpower is low at
the mo'.

9 months agoLook up words in the dictionary.
sforman [Sat, 29 Jul 2023 19:35:47 +0000 (12:35 -0700)]
Look up words in the dictionary.

If they are not built-in, which means you can't "shadow" built-ins with
"inscribe", which may or may not turn out to be what we want?

9 months agoThread the dictionary through the call stack.
sforman [Sat, 29 Jul 2023 19:30:22 +0000 (12:30 -0700)]
Thread the dictionary through the call stack.

9 months agoEmpty string is not an unknown word.
sforman [Sat, 29 Jul 2023 19:11:43 +0000 (12:11 -0700)]
Empty string is not an unknown word.

9 months agoGotta keep a Dict around.
sforman [Sat, 29 Jul 2023 19:09:08 +0000 (12:09 -0700)]
Gotta keep a Dict around.

9 months agoLogical ops.
sforman [Sat, 29 Jul 2023 18:37:07 +0000 (11:37 -0700)]
Logical ops.

9 months agoLeft- and Right-shift.
sforman [Sat, 29 Jul 2023 18:32:22 +0000 (11:32 -0700)]
Left- and Right-shift.

9 months agoComparison ops.
sforman [Sat, 29 Jul 2023 18:07:50 +0000 (11:07 -0700)]
Comparison ops.

9 months agoloop
sforman [Sat, 29 Jul 2023 17:44:51 +0000 (10:44 -0700)]
loop

9 months agobranch
sforman [Sat, 29 Jul 2023 17:38:12 +0000 (10:38 -0700)]
branch

9 months agodip
sforman [Sat, 29 Jul 2023 17:28:31 +0000 (10:28 -0700)]
dip

9 months agoi
sforman [Sat, 29 Jul 2023 17:23:06 +0000 (10:23 -0700)]
i

9 months agotruthy
sforman [Sat, 29 Jul 2023 17:19:39 +0000 (10:19 -0700)]
truthy

I have to check into this: the Python version has "bool" and no
"truthy".

9 months agoswap
sforman [Sat, 29 Jul 2023 17:09:40 +0000 (10:09 -0700)]
swap

9 months agostack, swaack
sforman [Sat, 29 Jul 2023 17:00:16 +0000 (10:00 -0700)]
stack, swaack

9 months agopop
sforman [Sat, 29 Jul 2023 16:55:28 +0000 (09:55 -0700)]
pop

9 months agofirst, rest
sforman [Sat, 29 Jul 2023 16:53:00 +0000 (09:53 -0700)]
first, rest

9 months agodup
sforman [Sat, 29 Jul 2023 16:22:26 +0000 (09:22 -0700)]
dup

9 months agocons
sforman [Sat, 29 Jul 2023 16:17:27 +0000 (09:17 -0700)]
cons

9 months agoclear, concat
sforman [Sat, 29 Jul 2023 16:06:14 +0000 (09:06 -0700)]
clear, concat

9 months agoMinor cleanup.
sforman [Sat, 29 Jul 2023 15:57:58 +0000 (08:57 -0700)]
Minor cleanup.

9 months agoType alias JList
sforman [Sat, 29 Jul 2023 15:49:31 +0000 (08:49 -0700)]
Type alias JList

9 months agoRefactor pop_int.
sforman [Sat, 29 Jul 2023 14:51:31 +0000 (07:51 -0700)]
Refactor pop_int.

I don't like passing the stack through isnt_int but that let's you chain
with andThen.

There's probably a clever or idiomatic way to not do that and couple the
stack to the result without passing it through the type checker function
but I don't know what it is right now, and this works.

9 months agoBinary Math Ops
sforman [Sat, 29 Jul 2023 14:32:56 +0000 (07:32 -0700)]
Binary Math Ops

9 months agoI don't think andThen helps here?
sforman [Sat, 29 Jul 2023 14:19:08 +0000 (07:19 -0700)]
I don't think andThen helps here?

9 months agoI can add integers!
sforman [Sat, 29 Jul 2023 13:54:15 +0000 (06:54 -0700)]
I can add integers!

9 months agoParsing working.
sforman [Sat, 29 Jul 2023 04:51:34 +0000 (21:51 -0700)]
Parsing working.

Modeled on the OCaml code.

9 months agoA start on Joy types.
sforman [Fri, 28 Jul 2023 22:04:35 +0000 (15:04 -0700)]
A start on Joy types.

9 months agoIn Elm.
sforman [Fri, 28 Jul 2023 21:18:12 +0000 (14:18 -0700)]
In Elm.

9 months agoUse Python as SHELL in Makefile.
sforman [Thu, 27 Jul 2023 17:32:45 +0000 (10:32 -0700)]
Use Python as SHELL in Makefile.

It's a simple task, but I'm not up on my CLI tools, so I went with
Python instead of sh.  The split command doesn't have '-p' switch on
Ubuntu.  (I'm using Ubuntu on this laptop because it can correctly
configure the WiFi and the laptop has no ethernet port.)

9 months agominor cleanup
sforman [Thu, 27 Jul 2023 16:55:26 +0000 (09:55 -0700)]
minor cleanup