IRC Log - 2025-02-27 - ##forth

Channel: ##forth
Total messages: 374
Time range: 08:22:03 - 23:54:01
Most active: cleobuline (120), xentrac (101), veltas (50)
08:22:03 ##forth <ghodawalaaman> ForthBot: .S
08:22:20 ##forth <ghodawalaaman> Oh it's gone
09:47:50 ##forth <veltas> !gforth .S
09:47:51 ##forth <gforth_eval_bot> <0>
09:48:20 ##forth <veltas> Oh there was a ForthBot in here
09:48:31 ##forth <veltas> That makes abundantly more sense as gforth_eval_bot is your bot lol
11:27:11 ##forth <xentrac> cleobuline: I'm not a huge fan of string buffers on the stack but at least you're snprintfing
11:28:33 ##forth <xentrac> I'm not a huge fan of initializing `stack->top = -1;` but it is correct in context
11:29:50 ##forth <xentrac> similarly I'm not a huge fan of strtok() but at least you're using strtok_r()
11:29:59 ##forth <xentrac> overall it seems solid
11:31:31 ##forth <veltas> Strings on the stack makes as much sense as MP integers on stack
11:31:50 ##forth <veltas> Oh you mean the C code?
11:31:58 ##forth <xentrac> yeah
11:32:04 ##forth <user51> that's better than stacks in strings, no? :)
11:32:11 ##forth <xentrac> aren't stacks always in strings?
11:32:46 ##forth <xentrac> I think at some point you probably want to make compileToken table-driven instead of a long chain of ifs
11:32:59 ##forth <veltas> stack->top = -1 is solved by using a stack that grows downwards
11:33:34 ##forth <veltas> In konilo it's solved by adding a dummy object at the start of the stack array
11:33:52 ##forth <xentrac> well, or by using stack->top++ and --stack->top instead of vice versa
11:34:21 ##forth <veltas> So top is incorrect 100% of the time?
11:35:12 ##forth <user51> xentrac: maybe the right word is 'sequential'?
11:35:32 ##forth <xentrac> so top points to the first word above the current stack rather than the last word on the stack
11:35:59 ##forth <veltas> AKA top points to one above the top
11:36:14 ##forth <xentrac> maybe you could call it "size"
11:36:23 ##forth <veltas> That would work
11:36:33 ##forth <veltas> My complaint is about the name 'top'
11:37:04 ##forth <veltas> But then accessing the top you need size-1
11:37:11 ##forth <xentrac> looking at a particular primitive FLUSH, it gets assigned a bytecode on line 26, interpreted by the inner interpreter at line 374, compiled at line 770, and interpreted by the outer interpreter at line 1162
11:37:52 ##forth <xentrac> so to add a new primitive you need to modify four things. I think those should all be consulting a single table so you can add a new primitive in one place
11:38:09 ##forth <xentrac> also I think newly defined words should go in that table
11:39:34 ##forth <xentrac> (in traditional Forths that table is the dictionary, but I don't think its particular choice of structure is as important as eliminating the bug-prone duplication)
11:40:04 ##forth <veltas> I think top-down stack pointer is easiest: empty(){sp = stack+LEN;} TOS = *sp, next = sp[1], etc. pop = *sp++ *--sp = push etc
11:40:44 ##forth <xentrac> that's certainly valid. and the way cleobuline is doing it is valid too
11:42:54 ##forth <xentrac> but it's more to my taste to represent an empty stack as -1 instead of 0 or LEN and to represent 2 items on the stack as 2 instead of 1 or LEN-2
11:43:02 ##forth <xentrac> or &stack[LEN-2]
11:44:05 ##forth <xentrac> interestingly I learned about a new CPU whose call stack grows upwards in memory. the only one I knew about before was the IBM 360, but it turns out the Padauk 3¢ microcontrollers like the PMS150C have upward-growing stacks too
11:44:48 ##forth <xentrac> the combination of downward-growing call stacks, stack-allocated locals, and upward-growing strings seems like it was a mistake
11:45:03 ##forth <xentrac> on for example amd64
11:46:43 ##forth <xentrac> irrelevant to Forth operand stacks of course, I was just reminded
11:47:16 ##forth <veltas> It feels like the reason we have downwards growing stacks as a convention is because it's easier to address the top of stack, and because it gives more room combined with upwards-growing data break / HERE
11:47:32 ##forth <veltas> Less and less relevant on modern CPUs
11:48:00 ##forth <veltas> With virtual memory and good negative immediate/register indexing
11:48:47 ##forth <veltas> Whichever direction, you would want the machine code to keep the address or index of the top element for performance
11:49:03 ##forth <veltas> But writing in C do what makes sense, it's not the optimised version anyway
11:50:53 ##forth <xentrac> I think ARM's register+immediate adressing only supports positive immediates?
11:51:18 ##forth <xentrac> I might be confusing ARM, Thumb, ARM64 ("aarch64"), and RISC-V, but I think RISC-V always sign-extends its immediates in order to help out very small implementations
11:51:39 ##forth <veltas> I mean convention is a good reason too
11:51:55 ##forth <veltas> Yeah could be in ARM there's a consequence to using upwards-growing stacks
11:52:22 ##forth <xentrac> yeah, you might need a frame-pointer register
11:53:03 ##forth <xentrac> if you're putting your heap and your stack in the same small address space you probably want one of them to grow downwards
11:53:12 ##forth <veltas> Exactly
11:54:02 ##forth <veltas> And given we want to add sequentially to the dictionary, and with unknown size entries, a constrained Forth pretty much needs to use a downards growing stack
11:54:13 ##forth <pgimeno> I don't recall that restriction on R+imm on ARM even in thumb
11:54:24 ##forth <veltas> I think it's just thumb
11:54:26 ##forth <pgimeno> but I've forgotten a good part of it
11:56:23 ##forth <veltas> I don't know, I've not written ARM by hand so I only know how to read the instructions, not what their restrictions are
11:56:41 ##forth <veltas> Their website docs aren't working for me, links aren't doing anything
11:57:02 ##forth <xentrac> it might be RISC-V's thumb actually. RV32C
11:57:04 ##forth <veltas> So I can't check their definition of offsets for the main ARM arch, but thumb does seem to restrict to offsets 0-31
11:57:35 ##forth <veltas> This is why you should provide a PDF manual, ARM seem to be allergic to doing a nice PDF manual
11:57:44 ##forth <xentrac> you can get old ones
11:58:04 ##forth <veltas> Yeah and older x86 manuals are easier to read too
11:58:09 ##forth <xentrac> yeah, a conventional Forth necessarily needs to grow its dictionary upwards in order to implement ,
11:58:16 ##forth <veltas> Why does everything get worse over time
11:58:19 ##forth <xentrac> the ARM3 manual from VLSI is pretty good
11:58:56 ##forth <pgimeno> I misremembered, only positive offsets allowed in thumb, sorry
11:59:13 ##forth <veltas> No need to apologise
11:59:28 ##forth <xentrac> not *everything* gets worse over time. we have electric cars, reusable space rockets, artificial intelligence, pocket supercomputers
11:59:43 ##forth <veltas> I am being a bit tongue in cheek
11:59:47 ##forth <xentrac> pgimeno: you just said "I don't recall that restriction", not "that restriction doesn't exist, you idiot"
11:59:56 ##forth <veltas> But most of that list isn't actually better lol
11:59:58 ##forth <pgimeno> :D
12:00:04 ##forth <xentrac> so you shouldn't apologize unless you're Canadian
12:01:12 ##forth <xentrac> most of the ARM3 manual from VLSI is concerned with things like pinouts, timing, and electrical characteristics
12:01:30 ##forth <xentrac> but it also has a complete description of the ARM3 instruction set as one of its chapters, about 30 pages
12:01:52 ##forth <pgimeno> this one is not half bad: http://kib.kiev.ua/x86docs/ARM/ARMARMv5/DDI0100I.pdf
12:03:16 ##forth <xentrac> it was the ARM ARM where they actually nailed down what the architecture guaranteed would happen in the future when you do things like modify the same register twice in the same instruction (in that case, I think the answer is just "no security violation")
12:03:49 ##forth <xentrac> but I feel like earlier versions of the ARM ARM were still better
12:04:35 ##forth <xentrac> this version is 1138 pages and painfully repetitive
12:05:26 ##forth <pgimeno> well, it helped me to write the Advance C standard library
12:06:43 ##forth <xentrac> this version of the ARM ARM did?
12:06:55 ##forth <pgimeno> yes
12:07:04 ##forth <pgimeno> https://codeberg.org/pgimeno/ACSL
12:07:47 ##forth <veltas> With the amazing compute resources of my phone, advertisers and state actors find it a lot easier to spy on me
12:08:07 ##forth <xentrac> nice
12:08:18 ##forth <veltas> The future is awesome
12:08:48 ##forth <xentrac> yeah, it would be pretty painful to try to write a C standard library without an instruction set manual
12:09:00 ##forth <xentrac> veltas: that's a huge problem, yeah
12:09:56 ##forth <pgimeno> I mean, I didn't find that manual particularly painful while writing the library
12:10:52 ##forth <xentrac> you might have enjoyed the version from 01996 more, though
12:10:52 ##forth <veltas> Very nice footprint pgimeno
12:10:55 ##forth <pgimeno> thanks
12:11:12 ##forth <xentrac> how big is the footprint?
12:11:52 ##forth <pgimeno> well only the formatting routines footprint is specified
12:12:25 ##forth <pgimeno> less than 4K for sprintf and friends
12:12:49 ##forth <xentrac> yeah, I saw that
12:12:51 ##forth <pgimeno> well it depends
12:12:53 ##forth <xentrac> which is pretty decent!
12:13:14 ##forth <pgimeno> the rest depends on what routines you compile in , but since the library is written in thumb assembler, it's generally short
12:14:11 ##forth <pgimeno> sprintf is far more complex than any other routine
12:15:20 ##forth <xentrac> makes sense
13:40:00 ##forth <cleobuline> hello xentrac
13:40:22 ##forth <cleobuline> i see you a have a look on my source :)
13:40:33 ##forth <xentrac> I did!
13:41:26 ##forth <cleobuline> for now i solve much of the bugs
13:42:09 ##forth <cleobuline> what is pleasant that is a autonomous bot
13:42:22 ##forth <cleobuline> i does all the job
13:43:01 ##forth <cleobuline> if you please you can add if here to play with
13:43:09 ##forth <cleobuline> it
13:45:16 ##forth <xentrac> :-)
13:45:28 ##forth <xentrac> I hope my French slang wasn't too annoying
13:45:37 ##forth <xentrac> I know it was badly done
13:45:57 ##forth <xentrac> c'est vachement mal mon français, putain
13:46:51 ##forth <xentrac> mauvais? mauvais
13:47:09 ##forth <cleobuline> to français n'est pas pire que mn anglais xentrac
13:47:46 ##forth <xentrac> :)
13:47:59 ##forth <cleobuline> yes my few comments is in french sorry
13:48:59 ##forth <cleobuline> !gforth 2 1000 POW
13:49:00 ##forth <gforth_eval_bot> https://0x0.st/8mXz.txt
13:50:53 ##forth <cleobuline> !gforth : POW DUP 0 = IF DROP 1 ELSE OVER SWAP 1 SWAP DO OVER * LOOP SWAP DROP THEN ; 2 1000 POW
13:50:53 ##forth <gforth_eval_bot> https://0x0.st/8mXi.txt
13:50:55 ##forth <cleobuline> !gforth : POW DUP 0 = IF DROP 1 ELSE OVER SWAP 1 SWAP DO OVER * LOOP SWAP DROP THEN ; 2 1000 POW .
13:50:57 ##forth <gforth_eval_bot> https://0x0.st/8mXi.txt
13:52:16 ##forth <pgimeno> it terminates after 4 seconds I think
14:33:43 ##forth <cleobuline> i'm using gmp library in my bot
14:35:18 ##forth <cleobuline> so limited only by the mem
14:36:35 ##forth <cleobuline> ForthBot: 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 1 + .
14:36:35 ##forth <ForthBot> 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000001
15:00:34 ##forth <pgimeno> !gforth : POW SWAP 1 ROT BEGIN ?DUP WHILE DUP 1 RSHIFT SWAP 1 AND IF -ROT OVER * -ROT ELSE ROT THEN DUP * -ROT REPEAT NIP ; 9 3712831918231 POW .
15:00:35 ##forth <gforth_eval_bot> -4135640842385761799
15:00:58 ##forth <pgimeno> !gforth : POW SWAP 1 ROT BEGIN ?DUP WHILE DUP 1 RSHIFT SWAP 1 AND IF -ROT OVER * -ROT ELSE ROT THEN DUP * -ROT REPEAT NIP ; 9 3712831918231 POW U.
15:00:59 ##forth <gforth_eval_bot> 14311103231323789817
15:01:51 ##forth <pgimeno> speed at the expense of code complexity
15:02:29 ##forth <veltas> But can you run your Forth on a ZX Spectrum cleobuline?
15:02:45 ##forth <pgimeno> commented version http://www.formauri.es/personal/pgimeno/pastes/pow.4th
15:02:51 ##forth <veltas> Because the code I posted earlier would run on multiple speccy forths
15:09:09 ##forth <xentrac> pgimeno: should be pretty easy to get gforth_eval_bot to mod 2**128
15:09:50 ##forth <cleobuline> !gforth : SIGMANCUBE 1 + 0 DO I + LOOP DUP * ; 0 10 SIGMANCUBE .
15:09:51 ##forth <gforth_eval_bot> 3025
15:09:56 ##forth <cleobuline> bien
15:10:52 ##forth <xentrac> ForthBot: 10 FACT .
15:10:54 ##forth <cleobuline> il est parti :)
15:11:55 ##forth <cleobuline> xentrac: you want it to be back ?
15:13:03 ##forth <veltas> pgimeno: repeated squares?
15:13:25 ##forth <xentrac> I'm happy to wait
15:14:18 ##forth <veltas> I don't much fancy writing a multi-precision library for Z80, although there's nothing stopping you
15:16:03 ##forth <cleobuline> ForthBot: : FACT DUP 1 > IF DUP 1 - FACT * ELSE DROP 1 THEN ;
15:16:21 ##forth <cleobuline> ForthBot: : SUM_SQUARE 1 + 0 DO I + LOOP DUP * ;
15:16:45 ##forth <cleobuline> ForthBot: 10 SUM_SQUARE .
15:16:45 ##forth <ForthBot> Error: Stack underflow
15:16:56 ##forth <cleobuline> ForthBot: 0 10 SUM_SQUARE .
15:16:56 ##forth <ForthBot> 3025
15:18:30 ##forth <cleobuline> ( 0 + 1 + ...n ) ^2
15:20:37 ##forth <xentrac> ForthBot: 10 FACT .
15:20:38 ##forth <ForthBot> 3628800
15:20:53 ##forth <xentrac> ForthBot: 100 FACT 2 FACT / 98 FACT / .
15:20:53 ##forth <ForthBot> 4950
15:21:12 ##forth <xentrac> ForthBot: 1000 FACT 2 FACT / 998 FACT / .
15:21:12 ##forth <ForthBot> Error: Stack overflow
15:21:21 ##forth <cleobuline> :)
15:21:58 ##forth <xentrac> ForthBot: : x >R DUP . R> + ; 3 4 x .
15:21:59 ##forth <ForthBot> Unknown word: >R
15:22:14 ##forth <cleobuline> actually the stack is limited to 1000 , i should create a dynamic stack
15:22:15 ##forth <xentrac> hmm, no return-stack manipulation. do we have variables?
15:22:32 ##forth <xentrac> ForthBot: VARIABLE MENT
15:22:40 ##forth <cleobuline> nope >R and R>
15:22:50 ##forth <xentrac> ForthBot: 3 MENT ! .S
15:22:50 ##forth <ForthBot> Error: Stack overflow
15:22:57 ##forth <xentrac> ForthBot: .S
15:23:18 ##forth <cleobuline> seem a bug now :)
15:23:19 ##forth <xentrac> hmm, possibly you will want to empty the stack when there's an error
15:23:25 ##forth <cleobuline> yes
15:23:58 ##forth <xentrac> I was going to try to rewrite factorial with a DO LOOP
15:24:52 ##forth <cleobuline> ready
15:25:14 ##forth <cleobuline> yes VARIABLE is implemented
15:25:33 ##forth <xentrac> ForthBot: 3 MENT !
15:25:33 ##forth <ForthBot> Unknown word: MENT
15:25:46 ##forth <xentrac> ForthBot: VARIABLE MENT MENT ?
15:25:47 ##forth <ForthBot> Unknown word: ?
15:25:52 ##forth <xentrac> ForthBot: @ .
15:25:53 ##forth <ForthBot> 0
15:25:56 ##forth <cleobuline> ForthBot: VARIABLE MENT
15:25:57 ##forth <xentrac> ForthBot: : ? @ . ;
15:26:04 ##forth <xentrac> ForthBot: MENT ?
15:26:04 ##forth <ForthBot> 0
15:26:12 ##forth <xentrac> ForthBot: 3 MENT ! .S
15:26:12 ##forth <ForthBot> Error: STORE: Invalid variable index
15:26:32 ##forth <cleobuline> ForthBot: MENT .
15:26:33 ##forth <ForthBot> 1
15:29:13 ##forth <cleobuline> ForthBot: VARIABLE X
15:29:31 ##forth <cleobuline> ForthBot: 1234 X !
15:29:31 ##forth <ForthBot> Error: STORE: Invalid variable index
15:29:42 ##forth <xentrac> ForthBot: X .
15:29:42 ##forth <ForthBot> 2
15:29:51 ##forth <cleobuline> bizarre ....
15:31:43 ##forth <cleobuline> ForthBot: FLUSH
15:31:51 ##forth <user51> ForthBot: X 1234 ! 1234 .
15:31:52 ##forth <ForthBot> 1234
15:32:03 ##forth <user51> ForthBot: X 1234 ! 1234 @ .
15:32:04 ##forth <ForthBot> Error: FETCH: Invalid variable index
15:32:17 ##forth <cleobuline> ForthBot: 1234 X !
15:32:17 ##forth <ForthBot> Error: STORE: Invalid variable index
15:32:21 ##forth <cleobuline> bug
15:32:31 ##forth <user51> ForthBot: VARIABLE V V V ! V . V @ .
15:32:32 ##forth <ForthBot> 3
15:32:51 ##forth <user51> ForthBot: VARIABLE V V V ! V . V @ .
15:32:51 ##forth <ForthBot> 4
15:34:36 ##forth <xentrac> ZARRO BOOGS FOND
15:44:47 ##forth <cleobuline> ForthBot: VARIABLE X
15:44:57 ##forth <cleobuline> ForthBot: X .
15:44:57 ##forth <ForthBot> 0
15:45:22 ##forth <veltas> I feel like maybe we need a bot playground channel if all this noise continues
15:45:40 ##forth <xentrac> seems plausible
15:45:59 ##forth <cleobuline> yes i will modifie to private only veltas
15:46:08 ##forth <xentrac> OTOH we're definitely having more Forth content than in a while
15:46:10 ##forth <cleobuline> ForthBot: 1234 X !
15:46:10 ##forth <ForthBot> Error: STORE: Invalid variable index
15:46:12 ##forth <veltas> The bots are great but maybe we shouldn't have all this experimentation whenever someone wants to learn about the bot specifically
15:46:22 ##forth <veltas> Well it's up to crc and KipIngram
15:46:26 ##forth <veltas> They're the mods
15:46:34 ##forth <xentrac> electrobot on ##electronics has a rate limit of something like 5 messages per 5 minutes
15:46:37 ##forth <veltas> I'm just thinking aloud
15:46:41 ##forth <xentrac> which might be a reasonable compromise
15:46:59 ##forth <veltas> Maybe ##forth-bots
15:47:03 ##forth <xentrac> if you trigger it more than 5 times in a row it ignores you for 5 minutes
15:47:13 ##forth <cleobuline> yes :)
15:47:19 ##forth <xentrac> I think it's valuable to be able to do things like this though:
15:47:43 ##forth <xentrac> 14:49 < xentrac> van der Horst defined a word called co that can be used for cleanup (not original to him, but this is a good example)
15:47:45 ##forth <veltas> It doesn't need that kind of limit, I think it's probably sufficient just to nudge people in that direction if they start to play around loads
15:47:46 ##forth <xentrac> 14:49 < xentrac> https://home.hccnet.nl/a.w.m.van.der.horst/forthlecture6.html
15:47:49 ##forth <xentrac> 14:50 < xentrac> !gforth : (let!) dup @ over swap 2r> rot >r rot >r >r >r ! ; : let! (let!) 2r> ! ; ( example usage: ) decimal : dec. 10 base let! . ; hex 53 dup dec. .
15:47:52 ##forth <xentrac> 14:50 < gforth_eval_bot> redefined dec. 83 53
15:47:54 ##forth <xentrac> 14:50 < deadmarshal_> thanks
15:48:40 ##forth <veltas> I don't think anyone, even the mods, wants to limit what people can do in here, but just for organisation's sake of the log it might be worth having a more noisy channel for bot experimentation
15:49:04 ##forth <veltas> It's good to keep them in here regardless because that's what they're for, and this is where we all are
15:49:30 ##forth <xentrac> oh, then I agree completely
15:49:38 ##forth <veltas> And it's all on good faith because anyone can ignore the bots if they annoy them generally
16:39:15 ##forth <cleobuline> ok i have corrected
16:41:37 ##forth <cleobuline> ForthBot: VARIABLE X 123456 X ! X @ .
16:41:37 ##forth <ForthBot> 123456
16:41:50 ##forth <cleobuline> finished
16:43:15 ##forth <cleobuline> thanks for your contributions :)
16:45:43 ##forth <cleobuline> may be i will work on saving the created dictionnary for further use
16:49:23 ##forth <cleobuline> thinking ........
16:52:31 ##forth <veltas> Something like that would be interesting
17:12:46 ##forth <cleobuline> i'm just working on the word SEE to print a definition next , write to a file :)
17:14:15 ##forth <xentrac> ForthBot: : fac 1 SWAP 0 DO I * LOOP ; 10 fac .
17:14:39 ##forth <xentrac> hmm, seems like it had a problem
17:17:12 ##forth <xentrac> !gforth : fac 1 swap 1+ 1 do i * loop ; 10 fac .
17:17:13 ##forth <gforth_eval_bot> 3628800
17:17:39 ##forth <xentrac> !gforth : fac 1 swap 1+ 1 do i * loop ; 100 fac .
17:17:40 ##forth <gforth_eval_bot> 0
17:17:46 ##forth <xentrac> !gforth : fac 1 swap 1+ 1 do i * loop ; 20 fac .
17:17:47 ##forth <gforth_eval_bot> 2432902008176640000
17:17:56 ##forth <xentrac> !gforth : fac 1 swap 1+ 1 do i * loop ; 20 fac 18 fac / 2 fac / .
17:17:57 ##forth <gforth_eval_bot> 190
17:23:48 ##forth <cleobuline> ForthBot: : fac 1 SWAP 0 DO I * LOOP ; 10 fac .
17:23:50 ##forth <cleobuline> lol
17:24:20 ##forth <cleobuline> ForthBot: : fac 1 SWAP 0 DO I * LOOP ; 10 fac .
17:24:56 ##forth <cleobuline> Executing: : fac 1 SWAP 0 DO I * LOOP ; 10 fac .
17:24:56 ##forth <cleobuline> [3]+ Segmentation fault (core dumped) nohup ./libera
17:24:56 ##forth <cleobuline> Segmentation fault (core dumped)
17:26:59 ##forth <xentrac> I didn't notice the bug when I looked at the code earlier, but that shouldn't be a surprise
17:27:51 ##forth <cleobuline> it does nothing on the console version ...
17:28:06 ##forth <cleobuline> Stack: 0
17:30:55 ##forth <cleobuline> something is broken ;)`
17:34:19 ##forth <cleobuline> maybe somewhere I = 0
17:34:36 ##forth <xentrac> I, too, am O
17:34:43 ##forth <user51> Now that I think about it, I dunno what to do with my finished forth. Maybe advent of code or project euler, or maybe it was just have fun and move on.
17:35:36 ##forth <xentrac> user51: train an LLM to program it. translate the compiler into miniKANREN and see if you can get it to generate a quine. add metacompilation if you haven't.
17:38:02 ##forth <cleobuline> DO I LOOP gives > 0 1 2 3 4 5 6 7 8 9
17:38:23 ##forth <cleobuline> 10 DO I LOOP
17:38:30 ##forth <cleobuline> 10 0
17:38:51 ##forth <user51> xentrac: Logic programming.. never done it. Might be worth exploring some day.
17:44:35 ##forth <cleobuline> you can explore cellular automata
17:45:05 ##forth <cleobuline> write a test bed with automana programmed in forth
17:45:12 ##forth <cleobuline> automata
17:48:31 ##forth <user51> Thanks, still a maybe for now.
17:51:08 ##forth <cleobuline> xentrac: ca marche mieux comme ça : fac 1 SWAP 1 DO I * LOOP ;
17:53:41 ##forth <cleobuline> ForthBot: : fac 1 SWAP 1 DO I * LOOP ; 10 fac .
17:53:45 ##forth <cleobuline> zut
18:22:52 ##forth <xentrac> mdr
18:41:32 ##forth <GeDaMo> !gforth : fib 1 1 rot 0 do tuck over . + loop 2drop ; 10 fib
18:41:32 ##forth <gforth_eval_bot> 1 1 2 3 5 8 13 21 34 55
19:33:55 ##forth <cleobuline> la foire aux bots :)
19:34:30 ##forth <cleobuline> ForthBot: : FIBONACCI DUP 0 = IF DROP 0 ELSE DUP 1 = IF DROP 1 ELSE 0 1 ROT 0 DO OVER + SWAP LOOP THEN THEN ;
19:35:02 ##forth <cleobuline> ForthBot: 10 FIBONACCI
19:35:08 ##forth <cleobuline> ForthBot: .
19:35:08 ##forth <ForthBot> 34
19:38:06 ##forth <cleobuline> ForthBot: FORGET FIBONACCI
19:38:12 ##forth <cleobuline> ForthBot: : FIBONACCI DUP 0 = IF DROP 0 ELSE DUP 1 = IF DROP 1 ELSE 0 1 ROT 1 DO OVER + SWAP LOOP DROP THEN THEN ;
19:38:22 ##forth <cleobuline> ForthBot: 10 FIBONACCI .
19:38:23 ##forth <ForthBot> 34
19:38:27 ##forth <cleobuline> pff
19:39:38 ##forth <cleobuline> ForthBot: 11 FIBONACCI .
19:39:38 ##forth <ForthBot> 55
19:39:47 ##forth <cleobuline> ya un décalage ...
19:39:58 ##forth <user51> ForthBot: 10 10 FIBONACCI FIBONACCI
19:40:14 ##forth <cleobuline> ForthBot: .S
19:40:14 ##forth <ForthBot> Stack: 55 10 3524578
19:40:23 ##forth <user51> yeah, im getting tired
19:41:08 ##forth <cleobuline> ForthBot: VARIABLE X 123456789 X ! X @ .
19:41:08 ##forth <ForthBot> 123456789
19:41:33 ##forth <cleobuline> it works in the right way now
19:42:34 ##forth <user51> !gforth 0 value t : recunacci ( n -- ) t 0 > if tuck + . recurse then ; : fibonacci to t 1 1 recunacci ; 10 fibonacci .s
19:42:35 ##forth <gforth_eval_bot> https://0x0.st/8maY.txt
19:43:44 ##forth <user51> !gforth 0 value t : recunacci ( n -- ) t 0 > if tuck + dup . recurse then ; : fibonacci to t 1 1 recunacci ; 10 fibonacci .s
19:43:44 ##forth <gforth_eval_bot> 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040
19:43:45 ##forth <gforth_eval_bot> https://0x0.st/8mag.txt
19:43:59 ##forth <cleobuline> :)
19:44:01 ##forth <user51> oh no.
19:44:14 ##forth <cleobuline> lol
19:44:34 ##forth <cleobuline> nice playing with forth on irc ;)
19:44:58 ##forth <user51> !gforth 0 value t : recunacci ( n -- ) t 0 > if tuck + dup t 1 - to t . recurse then ; : fibonacci to t 1 1 recunacci ; 10 fibonacci .s
19:44:59 ##forth <gforth_eval_bot> 2 3 5 8 13 21 34 55 89 144 <2> 89 144
19:45:24 ##forth <user51> who needs gpt when you have irc bots
19:46:06 ##forth <cleobuline> grok is more than chatGPT
19:47:04 ##forth <xentrac> ForthBot: CREATE FOO 100 ALLOT
19:47:04 ##forth <ForthBot> Unknown word: CREATE
19:47:11 ##forth <xentrac> cleobuline: no arrays, eh?
19:47:20 ##forth <user51> now we just need to do a fibonacci matrix
19:47:20 ##forth <cleobuline> not yet :)
19:47:36 ##forth <user51> ForthBot: HERE .
19:47:37 ##forth <ForthBot> Unknown word: HERE
19:47:59 ##forth <user51> ForthBot: ' ' .
19:47:59 ##forth <ForthBot> Unknown word: '
19:49:36 ##forth <cleobuline> it may be trick to do array with gmp numbers in it
19:50:21 ##forth <cleobuline> recunacci :)
19:51:22 ##forth <cleobuline> maybe an array of pointers
19:53:22 ##forth <cleobuline> ForthBot: : fac 1 SWAP 1 DO I * LOOP ; 10 fac .
19:53:22 ##forth <ForthBot> 362880
19:53:36 ##forth <cleobuline> have fix the do loop bug
20:00:13 ##forth <user51> recursion time
20:04:12 ##forth <user51> ForthBot: 100 100 dump
20:04:12 ##forth <ForthBot> Unknown word: dump
20:04:16 ##forth <user51> ForthBot: 100 100 DUMP
20:04:16 ##forth <ForthBot> Unknown word: DUMP
20:06:04 ##forth <cleobuline> lol
20:06:29 ##forth <cleobuline> why not pick and poke !!!!
20:06:49 ##forth <cleobuline> you what tu ack my machine ?
21:02:28 ##forth <cleobuline> ForthBot: CREATE ZOZO 100 ALLOT
21:02:47 ##forth <cleobuline> ForthBot: 123456789123456789 ZOZO !@
21:02:47 ##forth <ForthBot> Error: Stack underflow
21:03:03 ##forth <cleobuline> ForthBot: 123456789123456789 99 ZOZO !@
21:03:22 ##forth <cleobuline> ForthBot: 99 ZOZO @@ .
21:03:22 ##forth <ForthBot> 123456789123456789
21:04:36 ##forth <cleobuline> ForthBot: 123456789123456789123456789123456789123456789123456789 10 ZOZO !@
21:05:05 ##forth <cleobuline> ForthBot: 10 ZOZO @@ .
21:05:06 ##forth <ForthBot> 123456789123456789123456789123456789123456789123456789
21:06:03 ##forth <cleobuline> xentrac: happy ?
21:07:16 ##forth <cleobuline> ForthBot: 99 ZOZO @@ 10 ZOZO @@ * .
21:07:17 ##forth <ForthBot> 15241578780673678530864199530864199530864199530864199515622620750190521
23:15:15 ##forth <xentrac> cleobuline: neat, so now you have arrays I guess?
23:15:47 ##forth <xentrac> but you can't define something like ? that operates on either variables or array elements
23:38:44 ##forth <cleobuline> yes xentrac
23:39:12 ##forth <cleobuline> ForthBot: CREATE ZOZO 100 ALLOT
23:39:39 ##forth <cleobuline> ForthBot: 123456789123456789 55 ZOZO !@
23:40:00 ##forth <cleobuline> ForthBot: 55 ZOZO @@ .
23:40:00 ##forth <ForthBot> 123456789123456789
23:40:12 ##forth <cleobuline> happy xentrac ?
23:41:23 ##forth <cleobuline> 0 ZOZO @@ .
23:41:36 ##forth <cleobuline> ForthBot: 0 ZOZO @@ .
23:41:37 ##forth <ForthBot> 0
23:41:50 ##forth <cleobuline> all initiated to 0
23:44:10 ##forth <cleobuline> xentrac: is it what you expect ?
23:44:58 ##forth <cleobuline> i have to work for n dimensions array next ?
23:45:24 ##forth <cleobuline> lol
23:46:26 ##forth <cleobuline> nice array accept big numbers
23:46:56 ##forth <xentrac> well, the usual way of doing it is that a variable is in a sense a one-item array
23:47:44 ##forth <cleobuline> that's an idea :)
23:51:17 ##forth <cleobuline> i will do that next , thank for your contribution xentrac
23:51:49 ##forth <cleobuline> ForthBot: CREATE ZAZA 1 ALLOT
23:54:00 ##forth <cleobuline> ForthBot: WORDS
23:54:01 ##forth <ForthBot> ZOZO ZAZA