OSDN Git Service

joypy/Thun.git
17 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.

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

17 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?

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

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

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

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

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

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

17 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.

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

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

Don't pass NULL to strpbrk().

17 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.

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

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

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

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

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

17 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?

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

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

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

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

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

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

21 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?

21 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.

21 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.

21 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.

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

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

21 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.

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

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

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

21 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.

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

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

21 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.)

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

21 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...

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

21 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.

21 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.

21 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.

21 months agoI think I figured something out...
Simon Forman [Wed, 5 Oct 2022 17:16:47 +0000 (10:16 -0700)]
I think I figured something out...

21 months agoKinda sorta not really working,
Simon Forman [Wed, 5 Oct 2022 16:15:41 +0000 (09:15 -0700)]
Kinda sorta not really working,

as in broken.

This is getting out of hand.

21 months agoAlmost got it...
Simon Forman [Wed, 5 Oct 2022 15:49:35 +0000 (08:49 -0700)]
Almost got it...

21 months agoDivmod, yeah?
Simon Forman [Wed, 5 Oct 2022 15:27:01 +0000 (08:27 -0700)]
Divmod, yeah?

21 months agoMinor cleanup.
Simon Forman [Wed, 5 Oct 2022 05:21:58 +0000 (22:21 -0700)]
Minor cleanup.

I almost can't believe I did it.  I guess I thought it would be harder
or more involved.  Maybe divmod will be a pill?

Kinda relaxing after wasting the weekend nerd-sniped by curses.

21 months agoCopyright and executable bit
Simon Forman [Wed, 5 Oct 2022 05:19:14 +0000 (22:19 -0700)]
Copyright and executable bit

21 months agoMinor cleanup.
Simon Forman [Wed, 5 Oct 2022 05:18:22 +0000 (22:18 -0700)]
Minor cleanup.

21 months agoMinor cleanup; multiplication.
Simon Forman [Wed, 5 Oct 2022 05:06:49 +0000 (22:06 -0700)]
Minor cleanup; multiplication.

I forgot to commit after cleanup but before implementing multiplication
so this commit is kind of a mess.

Anyway, it works.  :D

21 months agotest_Subtraction_large_from_small
Simon Forman [Tue, 4 Oct 2022 23:41:09 +0000 (16:41 -0700)]
test_Subtraction_large_from_small

21 months agoI guess subtraction works!?
Simon Forman [Tue, 4 Oct 2022 23:28:43 +0000 (16:28 -0700)]
I guess subtraction works!?

21 months agoAdding two negative numbers.
Simon Forman [Tue, 4 Oct 2022 19:10:32 +0000 (12:10 -0700)]
Adding two negative numbers.

21 months agoThat was easy! Add BigInts of the same sign.
Simon Forman [Tue, 4 Oct 2022 19:05:41 +0000 (12:05 -0700)]
That was easy!  Add BigInts of the same sign.

21 months agoRed... (Green, Refactor)
Simon Forman [Tue, 4 Oct 2022 18:37:55 +0000 (11:37 -0700)]
Red... (Green, Refactor)

TDD FTW!

21 months agoNot using ctypes; test_twice_min
Simon Forman [Tue, 4 Oct 2022 18:31:40 +0000 (11:31 -0700)]
Not using ctypes; test_twice_min

21 months agoMinor cleanup.
Simon Forman [Tue, 4 Oct 2022 18:21:07 +0000 (11:21 -0700)]
Minor cleanup.

21 months agoFix import.
Simon Forman [Tue, 4 Oct 2022 18:20:55 +0000 (11:20 -0700)]
Fix import.

21 months agoBitInt start; unittest.
Simon Forman [Tue, 4 Oct 2022 18:20:14 +0000 (11:20 -0700)]
BitInt start; unittest.

21 months agoThat was easy...
Simon Forman [Tue, 4 Oct 2022 15:53:32 +0000 (08:53 -0700)]
That was easy...

but it breaks associativity or is it commutivity?

Anyway you can't add THREE or more things in one expression (yet)
because adding OberonInt objects returns a two-tuple.

I could adjust the semantics of ObInt to accept such two-tuples and do
add_with_carry() but that's probably more trouble than it's worth.

Just gotta be careful with math expressions, eh?

21 months agoSwitch to double-underscore method names.
Simon Forman [Tue, 4 Oct 2022 15:49:40 +0000 (08:49 -0700)]
Switch to double-underscore method names.

Worry about type conversions later.

21 months agoSubtraction.
Simon Forman [Tue, 4 Oct 2022 15:47:39 +0000 (08:47 -0700)]
Subtraction.

21 months agoBigInts in terms of Oberon Ints
Simon Forman [Tue, 4 Oct 2022 15:32:04 +0000 (08:32 -0700)]
BigInts in terms of Oberon Ints

Oberon RISC has Two's Complement 32-bit ints with carry.

So far so good.

21 months agoMinor cleanup.
Simon Forman [Thu, 29 Sep 2022 05:07:28 +0000 (22:07 -0700)]
Minor cleanup.

21 months agoMinor cleanup.
Simon Forman [Thu, 29 Sep 2022 04:56:53 +0000 (21:56 -0700)]
Minor cleanup.

Functional Programming FTW!

21 months agoApparently this is redundant.
Simon Forman [Thu, 29 Sep 2022 04:22:19 +0000 (21:22 -0700)]
Apparently this is redundant.

Discovered by running `nim doc joy.nim`, compiling doesn't flag it.

21 months agoClear out old docs; update defs.txt.
Simon Forman [Thu, 29 Sep 2022 01:28:25 +0000 (18:28 -0700)]
Clear out old docs; update defs.txt.

21 months agoI had to model it in Python
Simon Forman [Thu, 29 Sep 2022 01:21:13 +0000 (18:21 -0700)]
I had to model it in Python

before writing it in OCaml.

21 months agoImprove compiling of step combinator.
Simon Forman [Thu, 29 Sep 2022 01:18:20 +0000 (18:18 -0700)]
Improve compiling of step combinator.

21 months agoInitial outline for a talk on Joy.
Simon Forman [Thu, 29 Sep 2022 01:16:45 +0000 (18:16 -0700)]
Initial outline for a talk on Joy.

21 months agocoms, swap
Simon Forman [Sun, 25 Sep 2022 04:19:35 +0000 (21:19 -0700)]
coms, swap

21 months agoComparison operations.
Simon Forman [Sun, 25 Sep 2022 04:00:26 +0000 (21:00 -0700)]
Comparison operations.

21 months agobranch, dip, i, loop
Simon Forman [Sun, 25 Sep 2022 03:45:06 +0000 (20:45 -0700)]
branch, dip, i, loop

The core combinators (except fork).

21 months agoMinor cleanup.
Simon Forman [Sun, 25 Sep 2022 02:39:10 +0000 (19:39 -0700)]
Minor cleanup.

21 months agoSimple REPL.
Simon Forman [Sun, 25 Sep 2022 02:33:29 +0000 (19:33 -0700)]
Simple REPL.

Still very crude, and exceptions are not caught, but it works.

21 months agoMinor cleanup.
Simon Forman [Sat, 24 Sep 2022 21:54:07 +0000 (14:54 -0700)]
Minor cleanup.

21 months agoconcat
Simon Forman [Sat, 24 Sep 2022 21:29:03 +0000 (14:29 -0700)]
concat

Ocaml's match is very powerful, respect, but if I want more precise
error messages (that conform to the joytest suite) then the extra
utility functions must be implemented and employed.

After that it's definition loading and the main REPL loop and I think
that's it, eh?

21 months agoautoformat
Simon Forman [Sat, 24 Sep 2022 21:16:44 +0000 (14:16 -0700)]
autoformat

21 months agoclear
Simon Forman [Sat, 24 Sep 2022 21:16:20 +0000 (14:16 -0700)]
clear

21 months agoAutoformat.
Simon Forman [Sat, 24 Sep 2022 20:13:44 +0000 (13:13 -0700)]
Autoformat.

21 months agoEvaluation is working.
Simon Forman [Sat, 24 Sep 2022 20:13:03 +0000 (13:13 -0700)]
Evaluation is working.

It's all downhill from here, like in skiing!

21 months agoEval symbols...
Simon Forman [Sat, 24 Sep 2022 19:54:46 +0000 (12:54 -0700)]
Eval symbols...

21 months agoWorking towards interpretation.
Simon Forman [Sat, 24 Sep 2022 19:44:20 +0000 (12:44 -0700)]
Working towards interpretation.

21 months agoNice and clean.
Simon Forman [Sat, 24 Sep 2022 19:02:00 +0000 (12:02 -0700)]
Nice and clean.

I wonder what Ocaml programmers would think of this code?

21 months agoParser.
Simon Forman [Sat, 24 Sep 2022 18:00:19 +0000 (11:00 -0700)]
Parser.

Mighty battle.

21 months agoOrder is preserved.
Simon Forman [Sat, 24 Sep 2022 16:01:16 +0000 (09:01 -0700)]
Order is preserved.

21 months agoA couple of little comments.
Simon Forman [Sat, 24 Sep 2022 15:59:38 +0000 (08:59 -0700)]
A couple of little comments.

21 months agoParse tokens into joy_list.
Simon Forman [Sat, 24 Sep 2022 15:54:04 +0000 (08:54 -0700)]
Parse tokens into joy_list.

That seemed a lot harder than it should have been...

21 months agoA start of parsing tokens.
Simon Forman [Sat, 24 Sep 2022 02:35:15 +0000 (19:35 -0700)]
A start of parsing tokens.

21 months agoFormatting.
Simon Forman [Sat, 24 Sep 2022 00:47:31 +0000 (17:47 -0700)]
Formatting.

21 months agoI think I got the tokenizer right.
Simon Forman [Sat, 24 Sep 2022 00:31:16 +0000 (17:31 -0700)]
I think I got the tokenizer right.

21 months agoSo that's mutual recursion in Ocaml?
Simon Forman [Fri, 23 Sep 2022 15:59:06 +0000 (08:59 -0700)]
So that's mutual recursion in Ocaml?

I like it.  Just change "let" to "and" and you're good-to-go.

21 months agoIgnoring _build.
Simon Forman [Fri, 23 Sep 2022 15:54:37 +0000 (08:54 -0700)]
Ignoring _build.

21 months agoIgnore _build dirs.
Simon Forman [Fri, 23 Sep 2022 15:53:39 +0000 (08:53 -0700)]
Ignore _build dirs.

21 months agoautoformat
Simon Forman [Fri, 23 Sep 2022 15:38:17 +0000 (08:38 -0700)]
autoformat

21 months agoOcaml FTW!
Simon Forman [Fri, 23 Sep 2022 15:37:04 +0000 (08:37 -0700)]
Ocaml FTW!

21 months agoAt this point...
Simon Forman [Fri, 23 Sep 2022 03:43:25 +0000 (20:43 -0700)]
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.