OSDN Git Service
Simon Forman [Sun, 26 Feb 2023 19:12:07 +0000 (11:12 -0800)]
Okay, alright, skipping blank pixels.
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.
Simon Forman [Sun, 26 Feb 2023 18:52:09 +0000 (10:52 -0800)]
A start on draw_char().
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
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?
Simon Forman [Sun, 26 Feb 2023 18:06:39 +0000 (10:06 -0800)]
This compiles.
Simon Forman [Sun, 26 Feb 2023 18:01:40 +0000 (10:01 -0800)]
I think I got it.
Simon Forman [Sun, 26 Feb 2023 17:39:21 +0000 (09:39 -0800)]
Adding a function and it still compiles.
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.
Simon Forman [Sun, 26 Feb 2023 17:37:20 +0000 (09:37 -0800)]
So far...
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?
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.
Simon Forman [Sun, 26 Feb 2023 15:58:18 +0000 (07:58 -0800)]
Ignore tryrax binary.
Simon Forman [Sun, 26 Feb 2023 15:53:47 +0000 (07:53 -0800)]
Let's use uvm.
https://github.com/maximecb/uvm
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?
Simon Forman [Tue, 21 Feb 2023 00:04:12 +0000 (16:04 -0800)]
Break up completion into simple and prefixed cases.
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.
Simon Forman [Mon, 20 Feb 2023 20:53:58 +0000 (12:53 -0800)]
Linenoise with rax.
Simon Forman [Mon, 20 Feb 2023 19:19:27 +0000 (11:19 -0800)]
Let's use rax to generate tab completions?
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
Simon Forman [Mon, 20 Feb 2023 16:35:03 +0000 (08:35 -0800)]
Move and rename push_thing_onto_expression().
Simon Forman [Mon, 20 Feb 2023 14:38:18 +0000 (06:38 -0800)]
Minor cleanup.
Simon Forman [Mon, 20 Feb 2023 04:06:07 +0000 (20:06 -0800)]
typedef FTW
Simon Forman [Mon, 20 Feb 2023 03:43:53 +0000 (19:43 -0800)]
Wrap it?
Simon Forman [Mon, 20 Feb 2023 03:41:11 +0000 (19:41 -0800)]
I figured out how to spell it.
Simon Forman [Mon, 20 Feb 2023 03:40:43 +0000 (19:40 -0800)]
A little macro.
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.
Simon Forman [Mon, 20 Feb 2023 01:43:18 +0000 (17:43 -0800)]
How would you compile this?
fn [+] step
Simon Forman [Sun, 19 Feb 2023 04:09:19 +0000 (20:09 -0800)]
SWIProlog
Simon Forman [Fri, 17 Feb 2023 21:56:37 +0000 (13:56 -0800)]
eval_joy_ast
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
Simon Forman [Fri, 17 Feb 2023 19:07:32 +0000 (11:07 -0800)]
vlist.c
Simon Forman [Fri, 17 Feb 2023 01:45:25 +0000 (17:45 -0800)]
Minor cleanup.
Simon Forman [Thu, 16 Feb 2023 21:36:31 +0000 (13:36 -0800)]
Minor cleanup.
Simon Forman [Thu, 16 Feb 2023 21:26:11 +0000 (13:26 -0800)]
Minor cleanup.
Simon Forman [Thu, 16 Feb 2023 20:12:42 +0000 (12:12 -0800)]
pick and length
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!
Simon Forman [Thu, 16 Feb 2023 19:42:17 +0000 (11:42 -0800)]
Double list size each time; neat demo.
Simon Forman [Thu, 16 Feb 2023 19:41:35 +0000 (11:41 -0800)]
Set correct last_used when creating new vlist.
Simon Forman [Thu, 16 Feb 2023 19:27:39 +0000 (11:27 -0800)]
() is the null pointer
Simon Forman [Thu, 16 Feb 2023 18:56:37 +0000 (10:56 -0800)]
A start on VList.
Simon Forman [Thu, 16 Feb 2023 01:22:14 +0000 (17:22 -0800)]
Used "Artistic Style" (astyle) to check formatting.
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.
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?
Simon Forman [Wed, 15 Feb 2023 04:31:35 +0000 (20:31 -0800)]
Logical Boolean ops in bigints.joy.
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!
Simon Forman [Wed, 15 Feb 2023 02:48:49 +0000 (18:48 -0800)]
Emit errors on stderr.
Simon Forman [Wed, 15 Feb 2023 01:57:29 +0000 (17:57 -0800)]
Emit error messages on stderr.
Simon Forman [Wed, 15 Feb 2023 01:52:52 +0000 (17:52 -0800)]
Emit error messages on stderr.
Simon Forman [Wed, 15 Feb 2023 01:40:49 +0000 (17:40 -0800)]
Conform Python error messages.
Simon Forman [Tue, 14 Feb 2023 22:56:46 +0000 (14:56 -0800)]
No negative shift values.
Simon Forman [Tue, 14 Feb 2023 22:19:57 +0000 (14:19 -0800)]
lshift and rshift for Nim.
Incomplete, should reject negative shift count.
Simon Forman [Tue, 14 Feb 2023 21:15:53 +0000 (13:15 -0800)]
lshift and rshift for C.
Simon Forman [Tue, 14 Feb 2023 20:27:46 +0000 (12:27 -0800)]
or instead of ||, and instead of &&
Docs still TODO!
Simon Forman [Tue, 14 Feb 2023 20:08:32 +0000 (12:08 -0800)]
Hack to deal with trailing underscores.
Simon Forman [Tue, 14 Feb 2023 20:07:58 +0000 (12:07 -0800)]
Bring error message inline with other implementations.
Simon Forman [Tue, 14 Feb 2023 18:26:33 +0000 (10:26 -0800)]
Ignore some stuff.
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.
Simon Forman [Tue, 14 Feb 2023 18:19:03 +0000 (10:19 -0800)]
Aliases for builtins in Python Joy.
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.
Simon Forman [Tue, 14 Feb 2023 17:52:01 +0000 (09:52 -0800)]
Splice defs.txt into joy.py to make "joy" script.
Simon Forman [Tue, 14 Feb 2023 16:48:08 +0000 (08:48 -0800)]
Move all the bigints code into own dir.
Simon Forman [Tue, 14 Feb 2023 16:40:32 +0000 (08:40 -0800)]
Make /\ and \/ check that their args are Booleans.
Simon Forman [Tue, 14 Feb 2023 16:39:52 +0000 (08:39 -0800)]
Don't let defs shadow builtins.
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
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?
Simon Forman [Tue, 14 Feb 2023 15:56:27 +0000 (07:56 -0800)]
Minor edits.
Simon Forman [Tue, 14 Feb 2023 15:55:58 +0000 (07:55 -0800)]
Updating the README a little.
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.
Simon Forman [Mon, 13 Feb 2023 04:39:26 +0000 (20:39 -0800)]
initialization/1 FTW!
Simon Forman [Mon, 13 Feb 2023 04:11:40 +0000 (20:11 -0800)]
Minor cleanup.
To the first serious Joy code: bigints!
Simon Forman [Mon, 13 Feb 2023 03:19:51 +0000 (19:19 -0800)]
minor refactor
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'.
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.
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?
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
Simon Forman [Mon, 13 Feb 2023 00:00:45 +0000 (16:00 -0800)]
Minor cleanup.
Simon Forman [Sun, 12 Feb 2023 23:15:01 +0000 (15:15 -0800)]
Quiet mode for C.
Simon Forman [Sun, 12 Feb 2023 16:22:16 +0000 (08:22 -0800)]
minor cleanup
Simon Forman [Fri, 10 Feb 2023 16:10:47 +0000 (08:10 -0800)]
Build manifest for sr.ht.
Simon Forman [Fri, 10 Feb 2023 16:09:31 +0000 (08:09 -0800)]
minor cleanup
Simon Forman [Thu, 9 Feb 2023 18:58:08 +0000 (10:58 -0800)]
null, small
https://todo.sr.ht/~sforman/thun-der/23
Simon Forman [Thu, 9 Feb 2023 16:28:31 +0000 (08:28 -0800)]
minor cleanup
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.
Simon Forman [Thu, 9 Feb 2023 14:59:39 +0000 (06:59 -0800)]
divmod, xor
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.
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
Simon Forman [Wed, 8 Feb 2023 23:06:12 +0000 (15:06 -0800)]
unstack
Simon Forman [Wed, 8 Feb 2023 20:50:23 +0000 (12:50 -0800)]
Handle definitions with non-alphanumeric chars in their names.
Simon Forman [Wed, 8 Feb 2023 19:55:33 +0000 (11:55 -0800)]
Oh, LDFLAGS, right...
Simon Forman [Wed, 8 Feb 2023 04:53:44 +0000 (20:53 -0800)]
Initializers for Boolean values.
Simon Forman [Wed, 8 Feb 2023 04:47:32 +0000 (20:47 -0800)]
Minor cleanup.
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.
Simon Forman [Wed, 8 Feb 2023 01:44:32 +0000 (17:44 -0800)]
dispatch
Simon Forman [Mon, 6 Feb 2023 21:14:14 +0000 (13:14 -0800)]
Track KEYWORDS.txt after all.
Simon Forman [Mon, 6 Feb 2023 21:09:37 +0000 (13:09 -0800)]
eq, neq, gt, ge, lt, le
Simon Forman [Mon, 6 Feb 2023 20:59:39 +0000 (12:59 -0800)]
A bunch of definitions.
Still to do: the comparison functions.
Simon Forman [Mon, 6 Feb 2023 08:30:25 +0000 (00:30 -0800)]
Use setjmp/longjmp to recover after errors.
Wow! That was easy!
Simon Forman [Mon, 6 Feb 2023 04:48:19 +0000 (20:48 -0800)]
Clean KEYWORDS.txt too.
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.