OSDN Git Service

joypy/Thun.git
18 months agominor cleanup
Simon Forman [Sun, 5 Feb 2023 21:53:53 +0000 (13:53 -0800)]
minor cleanup

18 months agoAuto-generate defintions from defs.txt
Simon Forman [Sun, 5 Feb 2023 21:50:16 +0000 (13:50 -0800)]
Auto-generate defintions from defs.txt

But it doesn't yet handle names with non-C-indentifier characters in
them.

18 months agoGenerate definitions.h; swons
Simon Forman [Sun, 5 Feb 2023 21:38:59 +0000 (13:38 -0800)]
Generate definitions.h; swons

18 months agoPut defs into a generated file.
Simon Forman [Sun, 5 Feb 2023 21:04:31 +0000 (13:04 -0800)]
Put defs into a generated file.

This is only part of the solution, we still need to update joy.h and
KEYWORDS.txt when defs.txt changes, and we need to handle names that
have non-C-identifier characters in them.

But it's a start...

18 months agopush_quote_onto_expression
Simon Forman [Sun, 5 Feb 2023 19:58:44 +0000 (11:58 -0800)]
push_quote_onto_expression

doesn't push an empty list, unlike push_quote() which does.

18 months agoconcat
Simon Forman [Sun, 5 Feb 2023 19:00:22 +0000 (11:00 -0800)]
concat

18 months agoswap
Simon Forman [Sun, 5 Feb 2023 18:27:17 +0000 (10:27 -0800)]
swap

18 months agoforgot to save
Simon Forman [Sun, 5 Feb 2023 18:23:50 +0000 (10:23 -0800)]
forgot to save

18 months agoNo clear def.
Simon Forman [Sun, 5 Feb 2023 18:05:20 +0000 (10:05 -0800)]
No clear def.

18 months agoRemove def of clear.
Simon Forman [Sun, 5 Feb 2023 18:04:20 +0000 (10:04 -0800)]
Remove def of clear.

It's a neat example of a custom implementation being more efficient than
the Joy code.

18 months agostack
Simon Forman [Sun, 5 Feb 2023 18:00:18 +0000 (10:00 -0800)]
stack

18 months agoswaack
Simon Forman [Sun, 5 Feb 2023 17:54:52 +0000 (09:54 -0800)]
swaack

18 months agopop
Simon Forman [Sun, 5 Feb 2023 17:50:41 +0000 (09:50 -0800)]
pop

18 months agocons
Simon Forman [Sun, 5 Feb 2023 17:40:47 +0000 (09:40 -0800)]
cons

18 months agodip
Simon Forman [Sun, 5 Feb 2023 16:49:05 +0000 (08:49 -0800)]
dip

18 months agominor cleanup
Simon Forman [Sun, 5 Feb 2023 16:38:15 +0000 (08:38 -0800)]
minor cleanup

18 months agodup
Simon Forman [Sun, 5 Feb 2023 16:37:13 +0000 (08:37 -0800)]
dup

18 months agominor cleanup
Simon Forman [Sun, 5 Feb 2023 16:12:32 +0000 (08:12 -0800)]
minor cleanup

18 months agotruthy
Simon Forman [Sun, 5 Feb 2023 07:45:13 +0000 (23:45 -0800)]
truthy

18 months agoDefinitions.
Simon Forman [Sun, 5 Feb 2023 07:08:39 +0000 (23:08 -0800)]
Definitions.

There are things to like about this implementation and things to
dislike.

Things to like:

- It works.
- The defs are baked into the wordlist.

Cons:

- The def bodies are built at start time by parsing strings.  it would
  be nice to somehow generate initializer literals if possible.  But
  would that mess up the garbage collector?
- It requires manual labor to update the defs when defs.txt changes.  It
  would be nice to have a solution that *make* can use.

18 months agoA first attempt at definitions.
Simon Forman [Sun, 5 Feb 2023 06:58:38 +0000 (22:58 -0800)]
A first attempt at definitions.

18 months agoAlmost truthy...
Simon Forman [Sun, 5 Feb 2023 06:58:16 +0000 (22:58 -0800)]
Almost truthy...

18 months agodiv and mod
Simon Forman [Sun, 5 Feb 2023 03:34:38 +0000 (19:34 -0800)]
div and mod

18 months agoclear
Simon Forman [Sun, 5 Feb 2023 03:21:13 +0000 (19:21 -0800)]
clear

18 months agobranch combinator.
Simon Forman [Sun, 5 Feb 2023 03:19:48 +0000 (19:19 -0800)]
branch combinator.

18 months agoi combinator.
Simon Forman [Sun, 5 Feb 2023 03:05:26 +0000 (19:05 -0800)]
i combinator.

18 months agoDepend on joy.h.
Simon Forman [Sun, 5 Feb 2023 02:59:59 +0000 (18:59 -0800)]
Depend on joy.h.

18 months agoMinor cleanup, print_stack.
Simon Forman [Sun, 5 Feb 2023 02:51:58 +0000 (18:51 -0800)]
Minor cleanup, print_stack.

18 months agoMinor cleanup.
Simon Forman [Sat, 4 Feb 2023 21:46:29 +0000 (13:46 -0800)]
Minor cleanup.

18 months agoExpression is a list-of-lists now.
Simon Forman [Sat, 4 Feb 2023 21:38:28 +0000 (13:38 -0800)]
Expression is a list-of-lists now.

That way we don't have to concatinate quotes onto it all the time.
Instead we amortize in the next_term() function.

18 months agoCmp, comes with GMP.
Simon Forman [Sat, 4 Feb 2023 20:47:45 +0000 (12:47 -0800)]
Cmp, comes with GMP.

18 months agoBoolean singleton values.
Simon Forman [Sat, 4 Feb 2023 19:27:03 +0000 (11:27 -0800)]
Boolean singleton values.

18 months agoBoolean singleton values.
Simon Forman [Sat, 4 Feb 2023 18:25:14 +0000 (10:25 -0800)]
Boolean singleton values.

18 months agoNode head is pointer now.
Simon Forman [Sat, 4 Feb 2023 16:12:30 +0000 (08:12 -0800)]
Node head is pointer now.

18 months agoJoyListPtr too
Simon Forman [Sat, 4 Feb 2023 15:55:11 +0000 (07:55 -0800)]
JoyListPtr too

18 months agoUse JoyListPtr.
Simon Forman [Sat, 4 Feb 2023 15:52:36 +0000 (07:52 -0800)]
Use JoyListPtr.

18 months agosub and mul through judicious (I hope) use of macros.
Simon Forman [Sat, 4 Feb 2023 03:38:18 +0000 (19:38 -0800)]
sub and mul through judicious (I hope) use of macros.

18 months agopop_any(), pop_int(), and add
Simon Forman [Fri, 3 Feb 2023 23:46:52 +0000 (15:46 -0800)]
pop_any(), pop_int(), and add

18 months agoInterpret symbols.
Simon Forman [Fri, 3 Feb 2023 19:48:32 +0000 (11:48 -0800)]
Interpret symbols.

C has function pointers, we can put them in the Gperf wordlist, this
makes the interpreter really simple.  No need for a dictionary (yet).

Implementing the basis functions will be a bit of a slog, and
I still have to implement definitions, but this is starting to shape up
nicely.

18 months agoYet more minor cleanup.
Simon Forman [Fri, 3 Feb 2023 17:39:02 +0000 (09:39 -0800)]
Yet more minor cleanup.

18 months agoMore minor cleanup.
Simon Forman [Fri, 3 Feb 2023 17:30:11 +0000 (09:30 -0800)]
More minor cleanup.

18 months agoMinor cleanup.
Simon Forman [Fri, 3 Feb 2023 17:27:30 +0000 (09:27 -0800)]
Minor cleanup.

18 months agonewJoyList
Simon Forman [Fri, 3 Feb 2023 17:18:32 +0000 (09:18 -0800)]
newJoyList

18 months agoCan haz function pointers in my worldist.
Simon Forman [Fri, 3 Feb 2023 16:13:57 +0000 (08:13 -0800)]
Can haz function pointers in my worldist.

18 months agotypedef for the win!
Simon Forman [Fri, 3 Feb 2023 04:45:28 +0000 (20:45 -0800)]
typedef for the win!

18 months agomake clean rule
Simon Forman [Fri, 3 Feb 2023 01:02:55 +0000 (17:02 -0800)]
make clean rule

18 months agoUse gperf to save memory.
Simon Forman [Fri, 3 Feb 2023 00:58:44 +0000 (16:58 -0800)]
Use gperf to save memory.

We check terms to see if they're in the wordlist, if they are we reuse
the string from the wordlist instead of allocating a new one.

(I've always wanted to use Gperf so I'm pretty stoked about this!)

18 months agoIgnore object files.
Simon Forman [Fri, 3 Feb 2023 00:14:11 +0000 (16:14 -0800)]
Ignore object files.

18 months agominor cleanup
Simon Forman [Fri, 3 Feb 2023 00:13:15 +0000 (16:13 -0800)]
minor cleanup

18 months agoGperf.
Simon Forman [Fri, 3 Feb 2023 00:12:59 +0000 (16:12 -0800)]
Gperf.

18 months agoMinor cleanup.
Simon Forman [Thu, 2 Feb 2023 21:22:11 +0000 (13:22 -0800)]
Minor cleanup.

18 months agoTrue and False values.
Simon Forman [Thu, 2 Feb 2023 21:06:07 +0000 (13:06 -0800)]
True and False values.

18 months agoCopyright, etc.
Simon Forman [Thu, 2 Feb 2023 19:14:58 +0000 (11:14 -0800)]
Copyright, etc.

18 months agoFix bug with no trailing spaces.
Simon Forman [Thu, 2 Feb 2023 18:58:03 +0000 (10:58 -0800)]
Fix bug with no trailing spaces.

Gotta update that pointer, eh?

18 months agoI was post-incrementing when I should have been pre-incrementing!
Simon Forman [Thu, 2 Feb 2023 16:52:27 +0000 (08:52 -0800)]
I was post-incrementing when I should have been pre-incrementing!

D'oh!

18 months agoSimple terms work. Problem is with sub-lists.
Simon Forman [Thu, 2 Feb 2023 16:36:13 +0000 (08:36 -0800)]
Simple terms work. Problem is with sub-lists.

18 months agoParsing isn't this hard?
Simon Forman [Thu, 2 Feb 2023 16:32:45 +0000 (08:32 -0800)]
Parsing isn't this hard?

18 months agoUm, don't do that.
Simon Forman [Thu, 2 Feb 2023 04:36:18 +0000 (20:36 -0800)]
Um, don't do that.

I wonder where the data was winding up?

18 months agoMinor cleanup.
Simon Forman [Thu, 2 Feb 2023 04:34:49 +0000 (20:34 -0800)]
Minor cleanup.

18 months agoRemove separate parser code.
Simon Forman [Thu, 2 Feb 2023 04:34:04 +0000 (20:34 -0800)]
Remove separate parser code.

18 months agoPrint true, false, and lists.
Simon Forman [Thu, 2 Feb 2023 04:33:04 +0000 (20:33 -0800)]
Print true, false, and lists.

18 months agoPrint ints.
Simon Forman [Thu, 2 Feb 2023 04:28:24 +0000 (20:28 -0800)]
Print ints.

18 months agoPrint list.
Simon Forman [Thu, 2 Feb 2023 04:09:03 +0000 (20:09 -0800)]
Print list.

18 months agoText to expr coming along.
Simon Forman [Thu, 2 Feb 2023 03:26:50 +0000 (19:26 -0800)]
Text to expr coming along.

18 months agoNeed to be able to store a string.
Simon Forman [Thu, 2 Feb 2023 02:37:10 +0000 (18:37 -0800)]
Need to be able to store a string.

18 months agoMinor cleanup.
Simon Forman [Thu, 2 Feb 2023 02:35:11 +0000 (18:35 -0800)]
Minor cleanup.

18 months agoMinor cleanup.
Simon Forman [Thu, 2 Feb 2023 01:39:37 +0000 (17:39 -0800)]
Minor cleanup.

Don't pass NULL to strpbrk().

18 months agoHandle stretches of blanks.
Simon Forman [Thu, 2 Feb 2023 01:25:54 +0000 (17:25 -0800)]
Handle stretches of blanks.

Don't create zero-length strings.

18 months agoNice skeleton of parser.
Simon Forman [Thu, 2 Feb 2023 01:17:35 +0000 (17:17 -0800)]
Nice skeleton of parser.

18 months agoAlmost there on parsing.
Simon Forman [Thu, 2 Feb 2023 00:57:46 +0000 (16:57 -0800)]
Almost there on parsing.

18 months agotrim_leading_blanks
Simon Forman [Thu, 2 Feb 2023 00:40:14 +0000 (16:40 -0800)]
trim_leading_blanks

18 months agoLet's parse.
Simon Forman [Thu, 2 Feb 2023 00:02:19 +0000 (16:02 -0800)]
Let's parse.

18 months agoDon't version the binary.
Simon Forman [Wed, 1 Feb 2023 23:26:07 +0000 (15:26 -0800)]
Don't version the binary.

18 months agoI think I'm doing this right?
Simon Forman [Wed, 1 Feb 2023 23:25:21 +0000 (15:25 -0800)]
I think I'm doing this right?

18 months agominor style glitch
Simon Forman [Wed, 1 Feb 2023 22:56:11 +0000 (14:56 -0800)]
minor style glitch

18 months agoMinor cleanup.
Simon Forman [Wed, 1 Feb 2023 22:55:21 +0000 (14:55 -0800)]
Minor cleanup.

18 months agoSome notebooks.
Simon Forman [Wed, 1 Feb 2023 22:54:07 +0000 (14:54 -0800)]
Some notebooks.

18 months agoMessing around with C.
Simon Forman [Wed, 1 Feb 2023 22:23:54 +0000 (14:23 -0800)]
Messing around with C.

22 months agoReadline support would be nice.
Simon Forman [Tue, 18 Oct 2022 00:51:12 +0000 (17:51 -0700)]
Readline support would be nice.

22 months agoThis and that.
Simon Forman [Sun, 16 Oct 2022 03:04:27 +0000 (20:04 -0700)]
This and that.

22 months agoCleanup and refactoring.
Simon Forman [Sat, 15 Oct 2022 18:05:17 +0000 (11:05 -0700)]
Cleanup and refactoring.

Bug when subtracting identical numbers.  It gives

    [false 0]

When it should be

    [false]

or better yet

    [true]

eh?

22 months agoThat seems to work: addition and subtraction.
Simon Forman [Sat, 15 Oct 2022 16:52:58 +0000 (09:52 -0700)]
That seems to work: addition and subtraction.

22 months agoMostly done with addition and subtraction.
Simon Forman [Sat, 15 Oct 2022 04:01:18 +0000 (21:01 -0700)]
Mostly done with addition and subtraction.

22 months agoNot quite as smooth as I'd hoped.
Simon Forman [Sat, 15 Oct 2022 03:36:50 +0000 (20:36 -0700)]
Not quite as smooth as I'd hoped.

22 months agoSubtraction seems to work now.
Simon Forman [Sat, 15 Oct 2022 00:52:31 +0000 (17:52 -0700)]
Subtraction seems to work now.

22 months agoProgress.
Simon Forman [Fri, 14 Oct 2022 06:10:41 +0000 (23:10 -0700)]
Progress.

22 months agoAdding like-sign bigints in Joy.
Simon Forman [Tue, 11 Oct 2022 18:37:38 +0000 (11:37 -0700)]
Adding like-sign bigints in Joy.

22 months agoMisc stuff.
Simon Forman [Tue, 11 Oct 2022 05:28:50 +0000 (22:28 -0700)]
Misc stuff.

22 months agoMinor cleanup.
Simon Forman [Tue, 11 Oct 2022 05:23:19 +0000 (22:23 -0700)]
Minor cleanup.

22 months agoAdd two lists of digits.
Simon Forman [Tue, 11 Oct 2022 03:32:57 +0000 (20:32 -0700)]
Add two lists of digits.

22 months agoI think I got it.
Simon Forman [Tue, 11 Oct 2022 03:26:59 +0000 (20:26 -0700)]
I think I got it.

Whew!  Think slow and steady FTW.  Don't get ahead of yourself.  Put the
non-recursive parts in the non-recursive branch, duh.

22 months agoDang it...
Simon Forman [Tue, 11 Oct 2022 01:39:35 +0000 (18:39 -0700)]
Dang it...

22 months agoMinor cleanup.
Simon Forman [Fri, 7 Oct 2022 01:11:24 +0000 (18:11 -0700)]
Minor cleanup.

22 months agoJust for me...
Simon Forman [Thu, 6 Oct 2022 22:36:16 +0000 (15:36 -0700)]
Just for me...

(That's how you look all clever, but it's a dick move removing the
commentary like that.)

22 months agoBisect for the win!
Simon Forman [Thu, 6 Oct 2022 22:34:34 +0000 (15:34 -0700)]
Bisect for the win!

22 months agofind_greatest()
Simon Forman [Thu, 6 Oct 2022 22:31:24 +0000 (15:31 -0700)]
find_greatest()

I think it's ready to use...

22 months agoFinish lil_divmod.
Simon Forman [Thu, 6 Oct 2022 15:04:54 +0000 (08:04 -0700)]
Finish lil_divmod.

22 months agoOne more lil bug squash.
Simon Forman [Wed, 5 Oct 2022 19:31:35 +0000 (12:31 -0700)]
One more lil bug squash.

Subsidiary functions...

Fuzz FTW.

22 months agoDiv Mod of same sign ints.
Simon Forman [Wed, 5 Oct 2022 19:21:46 +0000 (12:21 -0700)]
Div Mod of same sign ints.

That seems to be that.

22 months agoFlush out and squash some bugs.
Simon Forman [Wed, 5 Oct 2022 19:19:39 +0000 (12:19 -0700)]
Flush out and squash some bugs.