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