OSDN Git Service

joypy/Thun.git
17 months agoOkay, alright, skipping blank pixels.
Simon Forman [Sun, 26 Feb 2023 19:12:07 +0000 (11:12 -0800)]
Okay, alright, skipping blank pixels.

17 months agoWe have a character on the screen!
Simon Forman [Sun, 26 Feb 2023 19:07:29 +0000 (11:07 -0800)]
We have a character on the screen!

It looks like potato because no alpha blending yet, but it's certainly
there!  I don't like the spelling of the C code, but who cares?  It
works.

17 months agoA start on draw_char().
Simon Forman [Sun, 26 Feb 2023 18:52:09 +0000 (10:52 -0800)]
A start on draw_char().

17 months agoRename anim_callback to draw_background
Simon Forman [Sun, 26 Feb 2023 18:18:46 +0000 (10:18 -0800)]
Rename anim_callback to draw_background

because that's what it is

17 months agoi can haz font data
Simon Forman [Sun, 26 Feb 2023 18:11:58 +0000 (10:11 -0800)]
i can haz font data

ooo that's a finicky parser tho

Early days.  It's all good.

(But damn those Rust tracebacks, what a useless pile of text.  i know
the problem is in the parser!?  why is it showing me all the rust
internal crap and none of the actual stack trace of the ncc code?  I
mean, look at this thing:

    sforman@bock:~/src/Joypy/implementations/uvm-ncc % setenv RUST_BACKTRACE full
    sforman@bock:~/src/Joypy/implementations/uvm-ncc % gmake
    cd /home/sforman/src/uvm/ncc ; cargo run /home/sforman/src/Joypy/implementations/uvm-ncc/xerblin.c
        Finished dev [unoptimized + debuginfo] target(s) in 0.01s
         Running `target/debug/ncc /home/sforman/src/Joypy/implementations/uvm-ncc/xerblin.c`
    thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError { msg: "expected identifier", line_no: 139, col_no: 20 }', src/main.rs:98:43
    stack backtrace:
       0:          0x10d741f - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h919bef3d5abebde9
       1:          0x10ee08e - core::fmt::write::h6413343c5226105f
       2:          0x10bce85 - std::io::Write::write_fmt::had0ddcb25461208f
       3:          0x10d71d5 - std::sys_common::backtrace::print::h5ed9962f90e9b258
       4:          0x10c6eff - std::panicking::default_hook::{{closure}}::h3978a8a8f5c1f893
       5:          0x10c6b91 - std::panicking::default_hook::h0cdbdd5201407347
       6:          0x10c75bb - std::panicking::rust_panic_with_hook::h15bc8b6da20c2af3
       7:          0x10d7777 - std::panicking::begin_panic_handler::{{closure}}::h082a693f9436206b
       8:          0x10d756c - std::sys_common::backtrace::__rust_end_short_backtrace::h56343aa2331ff455
       9:          0x10c7142 - rust_begin_unwind
      10:          0x10ed3d3 - core::panicking::panic_fmt::hf18d1d226927e137
      11:          0x10efa93 - core::result::unwrap_failed::ha5725a0b4539229c
      12:          0x105b505 - core::result::Result<T,E>::unwrap::h0f336a18a308049e
                                   at /wrkdirs/usr/ports/lang/rust/work/rustc-1.66.0-src/library/core/src/result.rs:1113:23
      13:          0x1068314 - ncc::main::h189929cbc5450262
                                   at /usr/home/sforman/src/uvm/ncc/src/main.rs:98:20
      14:          0x10611cb - core::ops::function::FnOnce::call_once::h8146a3c8fa28ca14
                                   at /wrkdirs/usr/ports/lang/rust/work/rustc-1.66.0-src/library/core/src/ops/function.rs:251:5
      15:          0x106e13e - std::sys_common::backtrace::__rust_begin_short_backtrace::h4e9f285841c55b79
                                   at /wrkdirs/usr/ports/lang/rust/work/rustc-1.66.0-src/library/std/src/sys_common/backtrace.rs:121:18
      16:          0x1069fa1 - std::rt::lang_start::{{closure}}::h8ca60a785648e691
                                   at /wrkdirs/usr/ports/lang/rust/work/rustc-1.66.0-src/library/std/src/rt.rs:166:18
      17:          0x10c1514 - std::rt::lang_start_internal::hadf3843363799440
      18:          0x1069f7a - std::rt::lang_start::h3ee6ffb894d9f1d3
                                   at /wrkdirs/usr/ports/lang/rust/work/rustc-1.66.0-src/library/std/src/rt.rs:165:17
      19:          0x10684ee - main
      20:          0x104f472 - _start
                                   at /usr/src/lib/csu/amd64/crt1.c:76:7
    gmake: *** [GNUmakefile:11: /home/sforman/src/uvm/ncc/out.asm] Error 101

There's ONE LINE from the ncc source: uvm/ncc/src/main.rs:98:20 which is a call
to parse_unit, but it's the following unwrap that seems to be causing the error
message?

17 months agoThis compiles.
Simon Forman [Sun, 26 Feb 2023 18:06:39 +0000 (10:06 -0800)]
This compiles.

17 months agoI think I got it.
Simon Forman [Sun, 26 Feb 2023 18:01:40 +0000 (10:01 -0800)]
I think I got it.

17 months agoAdding a function and it still compiles.
Simon Forman [Sun, 26 Feb 2023 17:39:21 +0000 (09:39 -0800)]
Adding a function and it still compiles.

17 months agoThis compiles and runs, include font.h but don't call init_font_data() yet.
Simon Forman [Sun, 26 Feb 2023 17:37:59 +0000 (09:37 -0800)]
This compiles and runs, include font.h but don't call init_font_data() yet.

17 months agoSo far...
Simon Forman [Sun, 26 Feb 2023 17:37:20 +0000 (09:37 -0800)]
So far...

17 months agoDrawing pixel per mouse move is slow at 1280x800.
Simon Forman [Sun, 26 Feb 2023 16:52:53 +0000 (08:52 -0800)]
Drawing pixel per mouse move is slow at 1280x800.

So let's just use a smaller screen for now, eh?

17 months agoRepair damage during mouse move.
Simon Forman [Sun, 26 Feb 2023 16:42:37 +0000 (08:42 -0800)]
Repair damage during mouse move.

This is a compromise between updating the screen every frame (which
takes ~60% CPU on my old no-GPU hardware) and repairing damage from e.g.
dragging offscreen and back on, or covering and uncovering the window
with another window.

17 months agoIgnore tryrax binary.
Simon Forman [Sun, 26 Feb 2023 15:58:18 +0000 (07:58 -0800)]
Ignore tryrax binary.

17 months agoLet's use uvm.
Simon Forman [Sun, 26 Feb 2023 15:53:47 +0000 (07:53 -0800)]
Let's use uvm.

https://github.com/maximecb/uvm

18 months agoAllocate a buffer just large enough.
Simon Forman [Tue, 21 Feb 2023 00:23:41 +0000 (16:23 -0800)]
Allocate a buffer just large enough.

I figure that's worth the overhead of iterating twice.  It's happening
during a user interaction so there's plenty of time, eh?

18 months agoBreak up completion into simple and prefixed cases.
Simon Forman [Tue, 21 Feb 2023 00:04:12 +0000 (16:04 -0800)]
Break up completion into simple and prefixed cases.

18 months agoHandle completion of symbols with a prefix...
Simon Forman [Mon, 20 Feb 2023 23:48:59 +0000 (15:48 -0800)]
Handle completion of symbols with a prefix...

You can type stuff and then tab and it will work.  Before it would try
to complete the whole line, which didn't work.

18 months agoLinenoise with rax.
Simon Forman [Mon, 20 Feb 2023 20:53:58 +0000 (12:53 -0800)]
Linenoise with rax.

18 months agoLet's use rax to generate tab completions?
Simon Forman [Mon, 20 Feb 2023 19:19:27 +0000 (11:19 -0800)]
Let's use rax to generate tab completions?

18 months agoLine editing with linenoise.
Simon Forman [Mon, 20 Feb 2023 18:20:40 +0000 (10:20 -0800)]
Line editing with linenoise.

https://github.com/antirez/linenoise
https://todo.sr.ht/~sforman/thun-der/33

18 months agoMove and rename push_thing_onto_expression().
Simon Forman [Mon, 20 Feb 2023 16:35:03 +0000 (08:35 -0800)]
Move and rename push_thing_onto_expression().

18 months agoMinor cleanup.
Simon Forman [Mon, 20 Feb 2023 14:38:18 +0000 (06:38 -0800)]
Minor cleanup.

18 months agotypedef FTW
Simon Forman [Mon, 20 Feb 2023 04:06:07 +0000 (20:06 -0800)]
typedef FTW

18 months agoWrap it?
Simon Forman [Mon, 20 Feb 2023 03:43:53 +0000 (19:43 -0800)]
Wrap it?

18 months agoI figured out how to spell it.
Simon Forman [Mon, 20 Feb 2023 03:41:11 +0000 (19:41 -0800)]
I figured out how to spell it.

18 months agoA little macro.
Simon Forman [Mon, 20 Feb 2023 03:40:43 +0000 (19:40 -0800)]
A little macro.

18 months agoLet's use the idiomatic functions, eh?
Simon Forman [Mon, 20 Feb 2023 01:54:34 +0000 (17:54 -0800)]
Let's use the idiomatic functions, eh?

That way the code is simpler and there aren't error messages scattered
all over the place.

18 months agoHow would you compile this?
Simon Forman [Mon, 20 Feb 2023 01:43:18 +0000 (17:43 -0800)]
How would you compile this?

    fn [+] step

18 months agoSWIProlog vlist
Simon Forman [Sun, 19 Feb 2023 04:09:19 +0000 (20:09 -0800)]
SWIProlog

18 months agoeval_joy_ast
Simon Forman [Fri, 17 Feb 2023 21:56:37 +0000 (13:56 -0800)]
eval_joy_ast

18 months agoA simple Joy-to-AST program.
Simon Forman [Fri, 17 Feb 2023 19:08:43 +0000 (11:08 -0800)]
A simple Joy-to-AST program.

Written in GNU Prolog, doncha know!?  :D

18 months agovlist.c
Simon Forman [Fri, 17 Feb 2023 19:07:32 +0000 (11:07 -0800)]
vlist.c

18 months agoMinor cleanup.
Simon Forman [Fri, 17 Feb 2023 01:45:25 +0000 (17:45 -0800)]
Minor cleanup.

18 months agoMinor cleanup.
Simon Forman [Thu, 16 Feb 2023 21:36:31 +0000 (13:36 -0800)]
Minor cleanup.

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

18 months agopick and length
Simon Forman [Thu, 16 Feb 2023 20:12:42 +0000 (12:12 -0800)]
pick and length

18 months agoMinor cleanup. This is pretty nice.
Simon Forman [Thu, 16 Feb 2023 19:45:54 +0000 (11:45 -0800)]
Minor cleanup.  This is pretty nice.

It's hard to believe this datastructure is so obscure!

18 months agoDouble list size each time; neat demo.
Simon Forman [Thu, 16 Feb 2023 19:42:17 +0000 (11:42 -0800)]
Double list size each time; neat demo.

18 months agoSet correct last_used when creating new vlist.
Simon Forman [Thu, 16 Feb 2023 19:41:35 +0000 (11:41 -0800)]
Set correct last_used when creating new vlist.

18 months ago() is the null pointer
Simon Forman [Thu, 16 Feb 2023 19:27:39 +0000 (11:27 -0800)]
() is the null pointer

18 months agoA start on VList.
Simon Forman [Thu, 16 Feb 2023 18:56:37 +0000 (10:56 -0800)]
A start on VList.

18 months agoUsed "Artistic Style" (astyle) to check formatting.
Simon Forman [Thu, 16 Feb 2023 01:22:14 +0000 (17:22 -0800)]
Used "Artistic Style" (astyle) to check formatting.

18 months agoA start on styling notebooks.
Simon Forman [Wed, 15 Feb 2023 21:43:22 +0000 (13:43 -0800)]
A start on styling notebooks.

I'd like the website to have some consistency.

18 months agoMinor updates to README file.
Simon Forman [Wed, 15 Feb 2023 18:05:25 +0000 (10:05 -0800)]
Minor updates to README file.

Removed setup.py until Python folks stabilize packaging and
distribution.  Just put the joy script in your PATH, eh?

18 months agoLogical Boolean ops in bigints.joy.
Simon Forman [Wed, 15 Feb 2023 04:31:35 +0000 (20:31 -0800)]
Logical Boolean ops in bigints.joy.

18 months agoinscribe command for Nim.
Simon Forman [Wed, 15 Feb 2023 04:27:36 +0000 (20:27 -0800)]
inscribe command for Nim.

https://todo.sr.ht/~sforman/thun-der/27

It doesn't let you overwrite definitions that are loaded from defs.txt.
It DOES let you overwrite builtins, but that doesn't matter because they
are handled by joy_eval() before it checks the dictionary, so in
practice the definitions are never evaluated even though they are put
into the dictionary.  Whew!  It's hacky but it works!

18 months agoEmit errors on stderr.
Simon Forman [Wed, 15 Feb 2023 02:48:49 +0000 (18:48 -0800)]
Emit errors on stderr.

18 months agoEmit error messages on stderr.
Simon Forman [Wed, 15 Feb 2023 01:57:29 +0000 (17:57 -0800)]
Emit error messages on stderr.

18 months agoEmit error messages on stderr.
Simon Forman [Wed, 15 Feb 2023 01:52:52 +0000 (17:52 -0800)]
Emit error messages on stderr.

18 months agoConform Python error messages.
Simon Forman [Wed, 15 Feb 2023 01:40:49 +0000 (17:40 -0800)]
Conform Python error messages.

18 months agoNo negative shift values.
Simon Forman [Tue, 14 Feb 2023 22:56:46 +0000 (14:56 -0800)]
No negative shift values.

18 months agolshift and rshift for Nim.
Simon Forman [Tue, 14 Feb 2023 22:19:57 +0000 (14:19 -0800)]
lshift and rshift for Nim.

Incomplete, should reject negative shift count.

18 months agolshift and rshift for C.
Simon Forman [Tue, 14 Feb 2023 21:15:53 +0000 (13:15 -0800)]
lshift and rshift for C.

18 months agoor instead of ||, and instead of &&
Simon Forman [Tue, 14 Feb 2023 20:27:46 +0000 (12:27 -0800)]
or instead of ||, and instead of &&

Docs still TODO!

18 months agoHack to deal with trailing underscores.
Simon Forman [Tue, 14 Feb 2023 20:08:32 +0000 (12:08 -0800)]
Hack to deal with trailing underscores.

18 months agoBring error message inline with other implementations.
Simon Forman [Tue, 14 Feb 2023 20:07:58 +0000 (12:07 -0800)]
Bring error message inline with other implementations.

18 months agoIgnore some stuff.
Simon Forman [Tue, 14 Feb 2023 18:26:33 +0000 (10:26 -0800)]
Ignore some stuff.

18 months agoRegularize defs.txt.
Simon Forman [Tue, 14 Feb 2023 18:23:23 +0000 (10:23 -0800)]
Regularize defs.txt.

All three main interpreters use the same defs.txt file.

18 months agoAliases for builtins in Python Joy.
Simon Forman [Tue, 14 Feb 2023 18:19:03 +0000 (10:19 -0800)]
Aliases for builtins in Python Joy.

18 months agoLoad embedded defs.txt, remove ≡ stuff.
Simon Forman [Tue, 14 Feb 2023 18:07:26 +0000 (10:07 -0800)]
Load embedded defs.txt, remove ≡ stuff.

I like that ≡ but I also like consistency.

18 months agoSplice defs.txt into joy.py to make "joy" script.
Simon Forman [Tue, 14 Feb 2023 17:52:01 +0000 (09:52 -0800)]
Splice defs.txt into joy.py to make "joy" script.

18 months agoMove all the bigints code into own dir.
Simon Forman [Tue, 14 Feb 2023 16:48:08 +0000 (08:48 -0800)]
Move all the bigints code into own dir.

18 months agoMake /\ and \/ check that their args are Booleans.
Simon Forman [Tue, 14 Feb 2023 16:40:32 +0000 (08:40 -0800)]
Make /\ and  \/ check that their args are Booleans.

18 months agoDon't let defs shadow builtins.
Simon Forman [Tue, 14 Feb 2023 16:39:52 +0000 (08:39 -0800)]
Don't let defs shadow builtins.

18 months agoregularize defs.txt; new andies.
Simon Forman [Tue, 14 Feb 2023 16:27:17 +0000 (08:27 -0800)]
regularize defs.txt; new andies.

I made a crude facility in the C impl for excluding definitions that
would replace built-in commands.  This should be improved, eh?

I also started on renameing the logical Boolean ops
https://todo.sr.ht/~sforman/thun-der/29

18 months agoNote to self...
Simon Forman [Tue, 14 Feb 2023 15:56:52 +0000 (07:56 -0800)]
Note to self...

This bit of code works, but I'm not sure why, or even if it's just an
illusion of working, and here lurks a nasty bug?

18 months agoMinor edits.
Simon Forman [Tue, 14 Feb 2023 15:56:27 +0000 (07:56 -0800)]
Minor edits.

18 months agoUpdating the README a little.
Simon Forman [Tue, 14 Feb 2023 15:55:58 +0000 (07:55 -0800)]
Updating the README a little.

18 months agoUnify the various defs.txt files...
Simon Forman [Tue, 14 Feb 2023 15:55:09 +0000 (07:55 -0800)]
Unify the various defs.txt files...

Work in progress.  THis is broken now.

18 months agoinitialization/1 FTW!
Simon Forman [Mon, 13 Feb 2023 04:39:26 +0000 (20:39 -0800)]
initialization/1 FTW!

18 months agoMinor cleanup.
Simon Forman [Mon, 13 Feb 2023 04:11:40 +0000 (20:11 -0800)]
Minor cleanup.

To the first serious Joy code: bigints!

18 months agominor refactor
Simon Forman [Mon, 13 Feb 2023 03:19:51 +0000 (19:19 -0800)]
minor refactor

18 months agoConform!
Simon Forman [Mon, 13 Feb 2023 02:45:56 +0000 (18:45 -0800)]
Conform!

cons and loop check type before number.
Don't print '<- top'.

18 months agoMake Python and C interpreters conform.
Simon Forman [Mon, 13 Feb 2023 00:17:27 +0000 (16:17 -0800)]
Make Python and C interpreters conform.

The Python one still checks number before type with get_n_items().
I can live with that for now.

18 months agofdiv
Simon Forman [Mon, 13 Feb 2023 00:04:37 +0000 (16:04 -0800)]
fdiv

This is why you compile and run tests /before/ you commit changes, eh?

18 months agoBring behaviour inline with joytest.
Simon Forman [Mon, 13 Feb 2023 00:01:19 +0000 (16:01 -0800)]
Bring behaviour inline with joytest.

Pop has it's own error message.

Div should be "floor" division

> fdiv rounds q down towards -infinity, and r will have the same sign as
> d. The f stands for “floor”.

https://gmplib.org/manual/Integer-Division

18 months agoMinor cleanup.
Simon Forman [Mon, 13 Feb 2023 00:00:45 +0000 (16:00 -0800)]
Minor cleanup.

18 months agoQuiet mode for C.
Simon Forman [Sun, 12 Feb 2023 23:15:01 +0000 (15:15 -0800)]
Quiet mode for C.

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

18 months agoBuild manifest for sr.ht.
Simon Forman [Fri, 10 Feb 2023 16:10:47 +0000 (08:10 -0800)]
Build manifest for sr.ht.

18 months agominor cleanup
Simon Forman [Fri, 10 Feb 2023 16:09:31 +0000 (08:09 -0800)]
minor cleanup

18 months agonull, small
Simon Forman [Thu, 9 Feb 2023 18:58:08 +0000 (10:58 -0800)]
null, small

https://todo.sr.ht/~sforman/thun-der/23

18 months agominor cleanup
Simon Forman [Thu, 9 Feb 2023 16:28:31 +0000 (08:28 -0800)]
minor cleanup

18 months agoand, or (Boolean ops). simpler
Simon Forman [Thu, 9 Feb 2023 15:52:50 +0000 (07:52 -0800)]
and, or (Boolean ops).

"not not" serves as a kind of type-checking identity function. "not"
will error out on non-Boolean values, or the absence of a second arg.

18 months agodivmod, xor
Simon Forman [Thu, 9 Feb 2023 14:59:39 +0000 (06:59 -0800)]
divmod, xor

18 months agoAllow for redefinition of user defs.
Simon Forman [Thu, 9 Feb 2023 07:20:35 +0000 (23:20 -0800)]
Allow for redefinition of user defs.

And some protection for inscribe, empty quotes or quotes that do not
have a symbol at the first item are just consumed without affecting the
user defs.

Because the Gperf wordlist is checked before the user defs hash the
inscribe command cannot overwrite the commands defined in the wordlist.

18 months agoUser definitions with the inscribe command.
Simon Forman [Thu, 9 Feb 2023 05:13:23 +0000 (21:13 -0800)]
User definitions with the inscribe command.

Using uthash http://troydhanson.github.io/uthash/index.html

18 months agounstack
Simon Forman [Wed, 8 Feb 2023 23:06:12 +0000 (15:06 -0800)]
unstack

18 months agoHandle definitions with non-alphanumeric chars in their names.
Simon Forman [Wed, 8 Feb 2023 20:50:23 +0000 (12:50 -0800)]
Handle definitions with non-alphanumeric chars in their names.

18 months agoOh, LDFLAGS, right...
Simon Forman [Wed, 8 Feb 2023 19:55:33 +0000 (11:55 -0800)]
Oh, LDFLAGS, right...

18 months agoInitializers for Boolean values.
Simon Forman [Wed, 8 Feb 2023 04:53:44 +0000 (20:53 -0800)]
Initializers for Boolean values.

18 months agoMinor cleanup.
Simon Forman [Wed, 8 Feb 2023 04:47:32 +0000 (20:47 -0800)]
Minor cleanup.

18 months agoAliases can be put in KEYWORDS.in
Simon Forman [Wed, 8 Feb 2023 03:14:37 +0000 (19:14 -0800)]
Aliases can be put in KEYWORDS.in

This avoids the overhead of single-functions definitions for aliases.

18 months agodispatch
Simon Forman [Wed, 8 Feb 2023 01:44:32 +0000 (17:44 -0800)]
dispatch

18 months agoTrack KEYWORDS.txt after all.
Simon Forman [Mon, 6 Feb 2023 21:14:14 +0000 (13:14 -0800)]
Track KEYWORDS.txt after all.

18 months agoeq, neq, gt, ge, lt, le
Simon Forman [Mon, 6 Feb 2023 21:09:37 +0000 (13:09 -0800)]
eq, neq, gt, ge, lt, le

18 months agoA bunch of definitions.
Simon Forman [Mon, 6 Feb 2023 20:59:39 +0000 (12:59 -0800)]
A bunch of definitions.

Still to do: the comparison functions.

18 months agoUse setjmp/longjmp to recover after errors.
Simon Forman [Mon, 6 Feb 2023 08:30:25 +0000 (00:30 -0800)]
Use setjmp/longjmp to recover after errors.

Wow!  That was easy!

18 months agoClean KEYWORDS.txt too.
Simon Forman [Mon, 6 Feb 2023 04:48:19 +0000 (20:48 -0800)]
Clean KEYWORDS.txt too.

18 months agopop_list <=> pop_list_node
Simon Forman [Mon, 6 Feb 2023 03:47:32 +0000 (19:47 -0800)]
pop_list <=> pop_list_node

These names seem like they should be swapped.