2024-08-28 00:06:59 hi! 2024-08-28 00:35:41 how is it going? 2024-08-28 00:53:15 can't complain. out of money as usual, but I got F83 running 2024-08-28 00:54:25 sorry to hear, but glad you got it up and running : ) 2024-08-28 00:55:11 I've been using my little music player written in uxntal for a second day now, it's quite nigood 2024-08-28 00:55:18 good* 2024-08-28 00:55:39 (if I can say so myself) 2024-08-28 00:55:42 :-) 2024-08-28 00:55:48 do you support tagging? 2024-08-28 00:56:00 I hacked together a tagging system a few years ago as some Unix shell scripts with one playlist file per tag 2024-08-28 00:56:04 https://assets.merveilles.town/media_attachments/files/113/036/375/508/636/952/original/0dc586d6777ea54f.mp4 2024-08-28 00:56:33 it looks great! 2024-08-28 00:56:47 ddo you mean id3 tags? 2024-08-28 00:56:50 no 2024-08-28 00:56:57 folksonomy tags 2024-08-28 00:57:09 what's that? 2024-08-28 00:57:17 I probably don't 2024-08-28 00:57:23 I don't support much of anything haha 2024-08-28 00:57:26 #rock #alternative #instrumental #calm #female-vocalist 2024-08-28 00:57:33 someone asked what windowing system and GUI toolkit you were using 2024-08-28 00:57:35 it's really simple, just 9000 bytes, and that includes a big font 2024-08-28 00:57:50 Oh no, I don't support genres at all 2024-08-28 00:57:57 tags aren't necessarily genres 2024-08-28 00:58:06 I tend to organize my library by genres in folders, and the artists under 2024-08-28 00:58:24 this is pretty much designed to be organized in the filesystem 2024-08-28 00:58:30 (I use rio) 2024-08-28 00:58:41 yeah, someone else said it looked like rio 2024-08-28 00:58:53 it's the default wm for plan 9 2024-08-28 00:59:00 yes 2024-08-28 00:59:12 I hacked it up a bit 2024-08-28 00:59:12 https://wiki.xxiivv.com/site/rio 2024-08-28 00:59:49 somewhere I'd gotten the idea that Chicago was a monospace font 2024-08-28 01:00:04 but either this isn't Chicago or Chicago isn't monospace 2024-08-28 01:00:04 it sometimes is, I found monospace versions of it 2024-08-28 01:00:17 it renders quite well monospace too 2024-08-28 01:00:33 aha, that's a possibility I hadn't considered 2024-08-28 01:00:44 I'm not at all a fan of monoline fonts like Courier and Helvetica 2024-08-28 01:00:53 so Chicago is a nice step up from Courier 2024-08-28 01:01:26 yeah, courier doesn't render too well I find, it has a lot of rough edges 2024-08-28 01:02:13 you're using monoline fonts in those screenshots though 2024-08-28 01:02:36 I'm using a monoline font in this window myself 2024-08-28 01:02:55 rather similar to Courier in fact 2024-08-28 01:04:09 I should change that 2024-08-28 01:07:16 yeah that's cream, the original smalltalk font 2024-08-28 01:07:34 I like it a lot 2024-08-28 01:07:50 oh, wait do you mean in rio? 2024-08-28 01:08:14 Oh that's some shitty font, I don't know which one that is in the screenshot on the page, it's quite old 2024-08-28 01:22:44 yeah, in Rio 2024-08-28 01:22:51 I like Cream a lot myself 2024-08-28 01:23:59 it's a divisive font 2024-08-28 01:24:04 is it? why? 2024-08-28 01:24:09 some really like it, others hate it with a passion 2024-08-28 01:24:23 the only thing I don't like about it is the lack of antialiasing 2024-08-28 01:24:24 lots of people looking at Left can't believe I use that everyday 2024-08-28 01:24:52 so, I got the dynamic scoping thing into a block file I can directly load into F83: http://canonical.org/~kragen/sw/dev3/hanoi.blk 2024-08-28 01:25:06 I can almost directly load it into Gforth too 2024-08-28 01:25:45 what is dynamic scopping? 2024-08-28 01:26:19 dynamic scoping is the way local variables worked in old Lisps and still work in Emacs Lisp by default; are you familiar with that? 2024-08-28 01:26:40 I might, maybe I don't understand the term 2024-08-28 01:26:50 what does it do? 2024-08-28 01:27:16 (I've never used emacs for anything other than erc) 2024-08-28 01:27:44 well, when you evaluate a variable like `foo`, it might be a local variable. say, a parameter to the function you're in 2024-08-28 01:28:14 in that case you want its local value, and you want that implemented in a way that supports recursion 2024-08-28 01:28:46 nowadays the standard way to do this is with lexically-scoped block-local variables, which is a little bit tricky to explain 2024-08-28 01:29:45 but in original Lisp the way to do it was effectively the same thing as temporarily assigning a value to `foo` and then restoring its old value when you exit the function, so-called "dynamic scoping" 2024-08-28 01:30:01 OOoh, okay I get it 2024-08-28 01:30:03 this differs from lexical scoping in two important cases: 2024-08-28 01:31:00 I guess I wasn't even familiar with how that worked 2024-08-28 01:31:02 so if you write to that variable inside a scope, when you come out, it's unchanged 2024-08-28 01:31:23 1. function f with local variable x returns a nested function which refers to x. With lexical scoping, in this case, the x it sees is the local binding of x when it was created 2024-08-28 01:31:32 I might have used systems that worked that way, stack frames tend to work that way regardless of name conflicts 2024-08-28 01:32:00 2. function f with local variable x calls function g which refers to *global* variable x. With lexical scoping, in this case, the x it sees is the global binding of x. 2024-08-28 01:32:12 With dynamic scoping, these two situations are reversed. 2024-08-28 01:32:40 that's super clear, thanks for explaining 2024-08-28 01:33:06 sure! there's a longer explanation in forth-dynamic-scoping.md in http://canonical.org/~kragen/sw/pavnotes2.git/ 2024-08-28 01:33:56 I realized the other night that I could hack kind of inefficient dynamic scoping into standard Forth with one line of code: 2024-08-28 01:34:07 : (let!) dup @ over swap 2r> rot >r rot >r >r >r ! ; : let! (let!) 2r> ! ; 2024-08-28 01:34:12 yeeesh 2024-08-28 01:34:14 :/ 2024-08-28 01:34:59 to my immense surprise, it works perfectly (as long as you aren't using the return stack for anything at the point where you invoke let!) 2024-08-28 01:35:19 and not only does it work in Gforth, PForth, and PFE — it works in F83! 2024-08-28 01:35:58 a 40-year-old Forth 2024-08-28 01:36:01 it's kind of confusing though, and there's a longer explanation in forth-dynamic-scoping.md as well 2024-08-28 01:36:12 it's not that complicated 2024-08-28 01:36:47 it's a lot of shuffling but I'm glad it's working 2024-08-28 01:37:21 I've never actually tried to implement hanoi before 2024-08-28 01:37:34 it's just one of those things that you just have to do at some point 2024-08-28 01:38:54 does F83 do stack effect arity validation? 2024-08-28 01:39:11 someone was asking in the concat chat the other day 2024-08-28 01:41:49 it was complicated for *me* even if not for you :) 2024-08-28 01:42:41 my previous example of using it was decimal : dec. 10 base let! . ; 2024-08-28 01:43:13 which is useful, and clearly simpler than the canonical definition of dec. 2024-08-28 01:43:40 wait so what does `let!` actually do 2024-08-28 01:43:56 which is something like decimal : dec. base @ swap 10 base ! . base ! ; 2024-08-28 01:44:18 amby: it temporarily puts a value in a memory cell until its caller returns 2024-08-28 01:44:27 clever 2024-08-28 01:44:38 and that's the problem, isn't it? 2024-08-28 01:44:50 the terrible thing about Forth is that it tempts you to be clever 2024-08-28 01:45:37 i mean my H. is : H. BASE @ HEX SWAP . BASE ! ; 2024-08-28 01:45:58 that's probably better! 2024-08-28 01:46:23 i am quite proud of a related word # 2024-08-28 01:47:16 : # IMMEDIATE WORD NUMBER DROP STATE @ IF [COMPILE] LITERAL THEN ; 2024-08-28 01:47:19 as for stack effect arity validation, neauoire, do you mean static checking? no Forth does static checking 2024-08-28 01:47:27 forces the next word to be interpreted as a number 2024-08-28 01:47:43 damn, yes that's what I meant sorry, I thought it was F83 that did it.. 2024-08-28 01:47:58 maybe I dreamt this.. welp, I think I sent something into a fool's errand 2024-08-28 01:48:04 it does do checking of control structure nesting though 2024-08-28 01:48:20 but : n. 0 do . loop ; for example is legal Forth 2024-08-28 01:48:45 amby: I see! that clashes with the standard # used for pictured numeric output but maybe you've renamed it 2024-08-28 01:48:45 # isn't too useful on its own but H# has turned out pretty useful 2024-08-28 01:49:02 forces the next word to be interpreted as a hex number 2024-08-28 01:49:04 oh yeah, I implemented H# for interpret mode the other night 2024-08-28 01:49:20 i'm gonna be honest i don't know what pictured numeric output means 2024-08-28 01:49:45 oh, that's where you say how you want a number to be formatted 2024-08-28 01:49:54 my forth is built on jonesforth as a base so it's pretty minimal 2024-08-28 01:50:21 oh so like. leading spaces/zeros and suck 2024-08-28 01:50:21 *such 2024-08-28 01:50:35 this was my implementation of H#, which I called $: : $ 0 0 bl word count base @ >r #16 base ! >number 2drop drop r> base ! ; 2024-08-28 01:51:37 mine is `BASE @ HEX [COMPILE] # STATE @ ULTHEN SWAP BASE !` 2024-08-28 01:51:46 I was tempted to write a state-smart word like that the other day but got depressed when I read https://www.complang.tuwien.ac.at/anton/euroforth/ef98/ertl98.pdf 2024-08-28 01:51:50 `ULTHEN` is a thing i did 2024-08-28 01:52:02 `ULTHEN X` is basically equivalent to `UNLESS X THEN` 2024-08-28 01:52:58 he bags on parsing words in there too! Ertl doesn't want us to have *any* fun 2024-08-28 01:54:06 you can use pictured numeric output for leading zeros but if you want leading spaces it may be easier to use .r 2024-08-28 01:54:06 haha 2024-08-28 01:54:15 i ean 2024-08-28 01:54:16 mean 2024-08-28 01:54:32 state-smart # is fine because you're never gonna want to postpone it 2024-08-28 01:54:51 maybe not! 2024-08-28 01:55:01 the main reason for pictured numeric output is, as I understand it, decimal fixed point 2024-08-28 01:55:13 so you can print out 5301 as $53.01 2024-08-28 01:55:22 yeah i can see that 2024-08-28 01:55:36 i'd probably call that `Q.R` or something 2024-08-28 01:56:17 `Q` from TI/ARM notation for fixed point numbers 2024-08-28 01:56:19 something like : $. <# # # [char] . hold #s [char] $ hold #> type ; if you aren't worried about the sign 2024-08-28 01:56:34 or possibly just Q. 2024-08-28 01:56:43 Gforth test: 2024-08-28 01:56:48 : $. <# # # [char] . hold #s [char] $ hold #> type ; 53.01 $. $53.01 ok 2024-08-28 01:57:13 i have some really hacky floating point print/parse words 2024-08-28 01:57:15 with PNO you describe how to print the number backwards, starting from the end 2024-08-28 01:57:30 because i felt like fucking about with x87 2024-08-28 01:58:12 that sounds like fun 2024-08-28 01:58:26 the above code doesn't handle negative numbers very well 2024-08-28 01:59:01 -53.01 $. $3402823669209384634633746074317682061.55 ok 2024-08-28 01:59:04 the way jonesforth prints negative numbers is basically just prints "-", negates the number, then prints it unsigned 2024-08-28 01:59:17 yes, and you can do that; it looks like this 2024-08-28 02:00:12 except for `.R`, which calculates the width and prints the padding first 2024-08-28 02:00:19 so you don't end up with `- 123` 2024-08-28 02:01:40 never mind, that's beyond my competence so far apparently ;) 2024-08-28 02:02:00 i'm also quite proud of [[ and ]] 2024-08-28 02:02:06 which are for inlining sequences of words 2024-08-28 02:02:24 where you would go `' A , ' B ,` you can instead go `[[ A B ]]` 2024-08-28 02:03:41 I don't know very much about how compiling works 2024-08-28 02:03:48 which is why I was reading Ertl's paper 2024-08-28 02:04:12 for me, being able to fuck about with the compiler is like. the main reason to use forth 2024-08-28 02:04:35 yeah, and I think that's a big part of its current appeal 2024-08-28 02:04:59 also people who don't want to understand how the whole system works are probably going to have a bad time with Forth 2024-08-28 02:05:06 yeah 2024-08-28 02:05:12 it's why i don't recommend people gforth 2024-08-28 02:05:18 because you need to understand what's going on in order to debug anything 2024-08-28 02:05:34 i tell people to read through jonesforth 2024-08-28 02:05:38 because it's great 2024-08-28 02:08:56 okay, here's a working $. handling negative numbers: : $. <# 2dup dabs # # [char] . hold #s [char] $ hold 2drop dup sign #> type ; 2024-08-28 02:09:16 yeah, I found jonesforth highly educational! 2024-08-28 02:12:53 you can use PNO for things like comma-separated numbers and whatnot 2024-08-28 02:13:11 ive tried to write all my extensions in the same literate programming style 2024-08-28 02:13:25 if you haven't used pictured numeric output before, the first pitfall is that the numbers have to be double-precision; you can convert a signed single-precision number to double with s>d 2024-08-28 02:13:33 like -123 s>d $. 2024-08-28 02:38:50 so a thing I'm trying to figure out is if I can make http://canonical.org/~kragen/sw/dev3/hanoi.blk work in both Gforth and F83 2024-08-28 02:39:40 I think the ideal way to do that would be to provide a definition for `ascii` that just calls `char` in Gforth. but I don't want to provide that definition in F83 2024-08-28 02:42:08 I know Gforth has things like [ifdef], but if I use them, then F83 will error on them 2024-08-28 02:47:07 I could do some kind of heuristic thing that runs in both Forths but behaves differently but I'm still not sure how to conditionally define a word 2024-08-28 04:55:28 might not be what you're after, but this is somewhat conditional (and a bit ugly)... : IF: IF : ELSE [CHAR] ; PARSE 2DROP THEN ; 2024-08-28 04:56:31 47 3 + 50 = IF: BAD-NEWS ." EMBEZZLE WASH SPIN RINSE EXTORT DRAIN" ; 2024-08-28 04:57:50 oddly enough a lisp book talks about how to divert money from bank accounts 2024-08-28 05:04:02 what's the title? 2024-08-28 05:17:04 hmm, that's interesting! 2024-08-28 05:18:05 although I guess for it to compile in both Gforth and F83 I'd want to say 59 instead of [char] ; 2024-08-28 05:20:01 it took me myself quite a while to PARSE it 2024-08-28 05:21:18 how will you differentiate between f83 and gforth? 2024-08-28 05:22:15 practical common lisp 2024-08-28 05:22:57 I'm not sure. I mean, there are any number of small differences 2024-08-28 05:23:16 a funny thing I ran across today is that defined in F83 leaves two things on the stack, for example 2024-08-28 05:23:30 instead of one 2024-08-28 05:24:04 but I'm sure there's something more canonical than that 2024-08-28 05:25:15 thrig: were they stealing from the steel bank? 2024-08-28 05:37:25 xentrac: i was looking at bootmessage and noticed version-string in gforth 2024-08-28 05:38:34 too bad there isn't just a string that consists of s" gforth" lying around 2024-08-28 05:38:55 or at least not that i've noticed yet 2024-08-28 05:40:21 there is 0 arg though 2024-08-28 05:42:38 but i'd bet that f83 either doesn't have arg or it's used for a totally difference purpose 2024-08-28 05:42:57 s/nce/nt/ 2024-08-28 05:48:35 yeah, it doesn't have arg 2024-08-28 05:51:38 another small behavior difference is that, in F83, r@ in a do loop returns numbers leading up to 32767, while in Gforth, r@ is equivalent to i 2024-08-28 05:52:13 at least a normal upward-counting one 2024-08-28 05:53:37 but there's nothing in any Forth standard that gives you any guarantee of what a do-sys looks like 2024-08-28 05:55:44 maybe I should just say : haschar c" char" find nip ; 2024-08-28 05:56:12 oh, no, because c" doesn't exist in F83 2024-08-28 05:57:12 it's just ", but that's s" 2024-08-28 05:57:18 could you build the string in something like pad and pass pad's address instead? 2024-08-28 05:57:35 that sounds totally reasonable 2024-08-28 05:59:53 I seem to have crashed MS-DOS trying, though 2024-08-28 06:00:08 heh 2024-08-28 06:02:11 does the cp/m version have the same set of words? 2024-08-28 06:02:37 I haven't looked at it in much detail, but mostly yes I think 2024-08-28 06:02:42 including the CP/M-80 version 2024-08-28 06:02:52 i couldn't find the output of something like vlist or words from f83 with google at least 2024-08-28 06:02:55 it isn't like one of them includes the screen editor and another one omits it 2024-08-28 06:03:16 yeah, it's rather depressingly hard to find 2024-08-28 06:03:56 i came across eforth.com.tw (i think that's the right domain) but the f83 links were broken, and i did manage to get a tarball of pdfs from forth.org 2024-08-28 06:04:16 seems likely 2024-08-28 06:04:32 although the section i looked at about words seem to have a ton of blank space where there probably should have been diagrams or figures 2024-08-28 06:04:48 Dr. Ting updated Inside F83 for a fourth edition which is on the Internet Archive 2024-08-28 06:04:56 if that's what you're looking for 2024-08-28 06:05:39 block files tend to have a ton of blank space in them because inserting and deleting lines into your *file* is impossible 2024-08-28 06:05:47 you can only insert and delete lines into your *block* 2024-08-28 06:07:44 ok maybe this was just a case of a less than ideal conversion to pdf: it was Chap2.pdf from https://www.forth.org/library/eforth_SOC/eforth_SOC_source/f83/InsideF83.tar.gz 2024-08-28 06:07:56 okay, I can put a counted string for "char" into pad with decimal : padchar 114 97 104 99 4 5 0 do i pad + c! loop ; 2024-08-28 06:08:19 Chap10.pdf (about word parsing) seems readable enough 2024-08-28 06:09:51 although now that I think about it it would be much more sensible to create charname 4 c, 99 c, 104 c, 97 c, 114 c, 2024-08-28 06:10:42 that looks a lot better 2024-08-28 06:11:36 at least it's in the order you expect to read it as well 2024-08-28 06:11:38 then charname find nip leaves the definedness of char on the stack 2024-08-28 06:15:46 so, here's what I'm going to try now: 2024-08-28 06:15:47 : if: if : else 59 parse 2drop then ; 2024-08-28 06:15:47 create nascii 5 c, 97 c, 115 c, 99 c, 105 c, 105 c, 2024-08-28 06:16:05 oh, I guess I want 0= 2024-08-28 06:18:44 hmph, well, it works in Gforth, but not in F83 2024-08-28 06:19:54 hmm, it's trying to redefine ascii 2024-08-28 06:21:03 oh, it starts up in hex 2024-08-28 06:24:11 oh, it wants the name in capitals 2024-08-28 06:27:40 okay, now it's working: http://canonical.org/~kragen/sw/dev3/hanoi.blk 2024-08-28 06:27:43 thanks, unjust! 2024-08-28 06:36:14 it works in PFE too. Which, apparently, includes a WordStar-style screen editor like F-PC 2024-08-28 06:44:34 although I can't figure out how to invoke it 2024-08-28 06:49:01 oh, but I do have the F83 editor running! the full incantation (perhaps some parts unnecessary) was open hanoi.blk 1 list editor install 2024-08-28 06:54:31 and now I've been able to make an actual edit in the F83 screen editor 2024-08-28 06:56:36 I found that forth empty-buffers was effective at discarding my garbage edits 2024-08-28 07:07:18 comparison of F83 with volksForth, F-PC, and CHForth: https://www.youtube.com/watch?v=AU9BuKDVQoU 2024-08-28 07:07:26 just a few minutes 2024-08-28 07:11:30 this is unfortunately getting deep into the retrocomputing though 2024-08-28 11:11:00 aha, Kartik did do some live visualizations of RPN evaluation: https://www.youtube.com/watch?v=E46ORBoig3g&list=PLxyWgjDVNN4oeMRfQ_SbhFtd4_kwdgpLq&index=8 2024-08-28 13:43:12 xentrac: To write a meta compiler without vocabs you would need to hook into the compiler/interpreter loop 2024-08-28 13:43:57 Which is what they're suggesting to add, a standard way of doing this in Forth 200x committee 2024-08-28 13:44:26 But I assume e.g. gforth has a simple way to do this with a DEFER somewhere 2024-08-28 13:45:08 If you write your own Forth then maybe STATE=0 interpreter, STATE=1 compiler, STATE=2 cross-compiler 2024-08-28 13:45:21 Or maybe the compilation words can be redirected, although that's probably too simplistic 2024-08-28 13:45:52 Unless you can reverse-engineer the correct cross-xt's/labels from the given local xt's 2024-08-28 13:46:09 I guess that's not too hard, actually, for most words 2024-08-28 14:45:51 Is there a way of swapping out GForths number parsing routines for a meta-compiler? Writing `literal` after each number in a cross compiled word definition sucks 2024-08-28 16:00:35 nice work, xentrac 2024-08-28 17:40:49 hello-operator: Probably, and probably version-specific now 2024-08-28 17:55:27 veltas: That's probably great then 2024-08-28 21:28:09 /mod: floored or symmetric. debate. 2024-08-28 21:29:21 Why not both? 2024-08-28 21:30:40 Could just return a random result, either floored or symmetric, or to make it fair alternate it every other week. 2024-08-28 21:32:17 i'll make it be random when both operands are positive 2024-08-28 21:32:36 symmetric because my computer does it that way 2024-08-28 21:34:08 I've run xentrac's Hanoi program and it crashes on my ZX Spectrum Forth 2024-08-28 21:34:18 What does your hardware - that presumably you are making yourself because anything else is weak - do? 2024-08-28 21:34:46 Will have to debug see what's going wrong, maybe stack limit? 2024-08-28 21:34:58 veltas: you'll probably want to replace the random number generator 2024-08-28 21:35:04 Don't know how much it recurses 2024-08-28 21:35:06 oh, not hanoi 2024-08-28 21:35:18 hanoi doesn't generate random numbers. I was thinking wmaze 2024-08-28 21:35:53 xentrac do you think there's a good reason Hanoi might crash on an 8-bit computer 2024-08-28 21:36:11 It could be a bug in my Forth though 2024-08-28 21:36:54 nothing obvious. could be a stack limit; its return stack should have 4 3 * 1 + 4 * items on it 2024-08-28 21:37:08 which is 52 2024-08-28 21:37:27 Er I think the return stack is bigger than that 2024-08-28 21:37:29 because each saved local variable binding occupies 3 return stack slots 2024-08-28 21:38:02 does the simpler test decimal : dec. 10 base let! . ; hex 35 dup dec. . .s work? 2024-08-28 21:38:23 that should print 53 35 and an indication of an empty stack 2024-08-28 21:38:23 Yes 2024-08-28 21:38:49 how about 65 66 67 1 hanoi? 2024-08-28 21:39:40 Prints "Move disc 1 from A to Cok" 2024-08-28 21:39:46 that's good! how about 2? 2024-08-28 21:39:55 i.e., 65 66 67 2 hanoi 2024-08-28 21:41:09 https://i.imgur.com/fnp34pE.png 2024-08-28 21:41:20 maybe it's failing to restore the value of n and consequently recursing infinitely? but even the 1 hanoi case recurses 2024-08-28 21:41:37 that looks like a valid solution for 2 discs 2024-08-28 21:42:09 and in particular you can see that it successfully restored all four of the variables after the recursive call to 1 hanoi 2024-08-28 21:42:12 how about 3? 2024-08-28 21:42:52 which Forth implementation is this, by the way? 2024-08-28 21:43:34 https://i.imgur.com/BfnamP8.png 2024-08-28 21:43:49 https://github.com/veltas/zenv 2024-08-28 21:44:11 that also seems like a valid solution for 3 discs 2024-08-28 21:44:29 but it crashes for 4 discs? 2024-08-28 21:45:10 Yup 2024-08-28 21:45:27 How deep does the parameter stack get? 2024-08-28 21:46:29 not very deep; hanoi itself pops everything off of it on entry 2024-08-28 21:48:15 the dup @ over swap 2r> at the beginning of (let!) should add 4 to it, and at the point of invoking n let! it should be 5, so a total of 9 I think 2024-08-28 21:48:48 or 10 if you used my definition of 2r> as : 2r> r> r> r> rot >r swap ; 2024-08-28 21:49:45 I did use that def 2024-08-28 21:49:53 10 isn't very much though 2024-08-28 21:49:57 I feel like the most likely culprit here is something to do with the depth of the return stack 2024-08-28 21:49:58 Just to demonstrate the code works 2024-08-28 21:50:24 I've got only 64 return depth 2024-08-28 21:50:38 52 is less than 64 but still suspiciously close 2024-08-28 21:50:57 Actually 60 or so 2024-08-28 21:51:03 Yeah 2024-08-28 21:51:05 maybe I miscalculated the return stack depth? or maybe the text interpreter has some more items on it? 2024-08-28 21:51:34 You've accounted for return addresses? 2024-08-28 21:51:34 (on the return stack) 2024-08-28 21:52:12 I was trying to, yeah: each level of hanoi should have its return address and four local variables on the stack, and each local variable occupies three stack slots (that part I'm pretty sure about!) 2024-08-28 21:52:28 oh! I was forgetting to count the 0 hanoi level 2024-08-28 21:52:38 so you actually have *5* levels of hanoi on the stack 2024-08-28 21:52:41 not 4 2024-08-28 21:52:49 Ah 2024-08-28 21:53:10 60 or so is generous by the way 2024-08-28 21:53:12 so 13 items per level, times 5, gives 65 items on the return stack 2024-08-28 21:53:23 Older Forths tend to have less 2024-08-28 21:53:24 yeah, 64 is a totally unreasonably large return stack 2024-08-28 21:53:43 Now you know lol 2024-08-28 21:53:51 heh 2024-08-28 21:54:21 well, I already knew it was pretty inefficient 2024-08-28 21:54:30 I never get tired of being able to run code on a cheap 8-bit computer the same as a desktop 2024-08-28 21:54:44 And compile it on said machine 2024-08-28 21:54:47 are you running it on a physical Spectrum? 2024-08-28 21:54:56 No I sold it 2024-08-28 21:55:10 I guess you got tired of it then ;-) 2024-08-28 21:55:11 in runtime, it works out to something like 16 word calls and returns per local variable, which is obviously ridiculous 2024-08-28 21:55:13 I did run it on a real one and it's cool 2024-08-28 21:55:27 Runs fast here 2024-08-28 21:55:59 Sold it to make room, small house and I've got a kid now 2024-08-28 21:56:12 CRT etc 2024-08-28 21:56:18 yeah 2024-08-28 21:56:41 I was thinking this morning that it would be cool to have a mouse whose cable was just a composite video cable with an RCA plug on it 2024-08-28 21:56:48 I'll compile zenv with bigger return stack and try again 2024-08-28 21:57:41 I'm pretty sure that if 3 hanoi works, then 4 hanoi will work too if it doesn't hit a resource limit like that 2024-08-28 21:57:43 xentrac: as in a console / computer in a mouse? 2024-08-28 21:57:54 yeah, exactly 2024-08-28 21:58:25 around here most new TVs still have composite video inputs, dunno if that's true where you are 2024-08-28 21:58:42 yes here too 2024-08-28 21:59:02 have you seen video game systems that are basically just housed in a controller and feature a single game in ROM? 2024-08-28 21:59:18 yeah, although more common is that they have hundreds of games in ROM 2024-08-28 21:59:42 i guess that's newer than what i'm thinking of then 2024-08-28 21:59:51 a single game only makes economic sense if they're complying with copyright law 2024-08-28 22:00:29 and/or riding on some pre-existing brand in an unrelated industry: https://www.amazon.com/Jakks-Pacific-Plug-Play-Games/dp/B00074FYCI 2024-08-28 22:03:47 yeah, possibly! 2024-08-28 22:04:32 or a collectors edition single game thingy 2024-08-28 22:04:35 it's formula that seems to work for this Jakks Pacific company at least: https://plugplaytvgames.fandom.com/wiki/Jakks_Pacific 2024-08-28 22:05:20 "F21 in a Mouse" https://www.ultratechnology.com/scope.htm 2024-08-28 22:05:58 yeah, that 2024-08-28 22:06:50 except, for real 2024-08-28 22:06:52 nice concept 2024-08-28 22:07:33 but no keyboarD? 2024-08-28 22:08:51 well, maybe you could have an optional keyboard, but a keyboard is inevitably enormous compared to a mouse 2024-08-28 22:09:37 GeDaMo: I didn't remember that he did this on an F21! I thought the F21 effort never taped out a working chip 2024-08-28 22:21:58 xentrac: https://i.imgur.com/aaTnvZK.png 2024-08-28 22:22:09 With a larger return stack 2024-08-28 22:23:17 Seems to run quite quick 2024-08-28 22:33:15 About half a second if the frame counter can be trusted 2024-08-28 22:33:28 Including printing 2024-08-28 22:40:25 xentrac: Compiled https://i.imgur.com/FlRiKSR.png 2024-08-28 22:47:39 veltas: awesome! but you have to admit that 16 subroutine calls per local variable is a high price to pay 2024-08-28 22:49:48 (to say nothing of three cells on the return stack) 2024-08-28 22:50:03 I think this is the first time I've looked at a Forth dictionary hex dump 2024-08-28 22:50:32 is 28CD the address of DOCOL? 2024-08-28 22:51:08 or maybe 0828? 2024-08-28 22:51:51 uh, not 0828, that makes no sense 2024-08-28 22:51:57 (referring to https://imgur.com/FlRiKSR) 2024-08-28 22:52:12 CD 28 80 is CALL 0x8028 2024-08-28 22:52:28 so CALL raw_colon or whatever I called it 2024-08-28 22:52:49 oh, it's direct-threaded? 2024-08-28 22:52:59 Tokenised and direct threaded 2024-08-28 22:53:36 You can build regular DTC too 2024-08-28 22:53:45 It's a build option 2024-08-28 22:54:00 I guess that makes it a little harder to guess what the hex dump means 2024-08-28 22:54:00 I prefer extra room 2024-08-28 22:54:14 You don't say lol 2024-08-28 22:55:07 If the byte at IP is under 0x80 it's a token table lookup, otherwise it's the start of big endian word xt 2024-08-28 22:58:08 Because it's loaded in at 0x8000 so any xt's are at least that 2024-08-28 22:59:43 Yeah you can learn a lot about a forth by DUMPing it 2024-08-28 23:03:05 https://i.imgur.com/DVmXjY9.png 2024-08-28 23:07:54 Aha, that makes sense 2024-08-28 23:08:07 the big-endian words were confusing me a lot 2024-08-28 23:08:18 Yeah it's fucky 2024-08-28 23:08:20 But compact 2024-08-28 23:08:55 so how big is let! including (let!) and 2r> in zenv? 2024-08-28 23:09:55 127 words seems like enough for a pretty comprehensive core 2024-08-28 23:11:18 Er around 40 bytes including headers, not including 2r> because I didn't bother writing that out again 2024-08-28 23:11:24 Just confirmed you could write it that way 2024-08-28 23:11:32 oh, you had a 2r> already? 2024-08-28 23:11:36 Of course 2024-08-28 23:11:45 well F83 doesn't! 2024-08-28 23:11:52 wow, 40 bytes is pretty compact 2024-08-28 23:12:15 what does drawing on the screen look like in zenv? You could revector move-disc to something that's more interesting than printing text 2024-08-28 23:14:29 I've not added drawing stuff but yeah it would be nice to animate it 2024-08-28 23:14:56 I basically focused on core words and then stopped 2024-08-28 23:15:28 Anything else was just as needed or for debugging 2024-08-28 23:24:45 https://termbin.com/98qm 2024-08-28 23:25:16 what are you using to assemble it? 2024-08-28 23:25:59 it looks like a pretty decent macro assembler 2024-08-28 23:26:07 https://github.com/z00m128/sjasmplus 2024-08-28 23:27:30 I've barely scratched the surface of what that assembler can do 2024-08-28 23:32:15 veltas: can you recommend a z80 assembler that runs on linux? 2024-08-28 23:32:20 sorry, emulator 2024-08-28 23:35:16 I use fuse for zx spectrum 2024-08-28 23:35:36 Which has a Z80 emulator within somewhere 2024-08-28 23:36:03 It's a very clever/accurate emulator, and works well on old computers 2024-08-28 23:37:11 It's able to play bitbanged speccy music and bitbanged hi res demos, simulates Z80 undocumented instructions and Z80 bugs 2024-08-28 23:37:17 wow 2024-08-28 23:41:00 Looks like it's here, and I don't think it's nice to split out if you really just want Z80 https://sourceforge.net/p/fuse-emulator/fuse/ci/master/tree/z80/ 2024-08-28 23:42:10 fuse-emulator is a great project and the devs are quite nice, back when they had an IRC channel I reported a couple bugs and made a suggestion and they fixed/added it all 2024-08-28 23:42:51 My suggestion was to make the keyboard window resizable, which was very necessary on a 4K screen because it was a tiny bitmap originally 2024-08-28 23:48:12 Looks like #fuse-emulator is registered in OFTC but empty, I'll sit in there in case someone appears, but I doubt it