2025-03-01 01:45:08 ForthBot: : FIBONACCI 1 + DUP 1 = IF DROP 0 EXIT THEN DUP 2 = IF DROP 1 EXIT THEN 0 1 ROT 0 DO OVER + SWAP LOOP NIP ; 2025-03-01 01:45:42 : recunacci 0 DO I FIBONACCI LOOP .S ; 2025-03-01 01:45:50 ForthBot: recunacci 2025-03-01 01:45:51 Unknown word: recunacci 2025-03-01 01:46:21 : toto 0 DO I FIBONACCI LOOP .S ; 2025-03-01 01:46:38 ForthBot: : recunacci 0 DO I FIBONACCI LOOP .S ; 2025-03-01 01:46:46 ForthBot: recunacci 2025-03-01 01:46:47 Stack: 0 2025-03-01 01:47:08 ForthBot: 10 FIBONACCI . 2025-03-01 01:47:09 55 2025-03-01 01:47:53 ForthBot: FLUSH 20 recunacci 2025-03-01 01:47:54 Stack: 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 2025-03-01 01:50:53 ForthBot: WORDS 2025-03-01 01:50:53 SUM_SQUARE ? X FIBONACCI recunacci 2025-03-01 08:33:05 xentrac: The architecture's not been a huge focus but I am inspired by local building a little. For instance I live in a terraced house, I never see that in a city sim 2025-03-01 08:33:33 So I will definitely generate terraces of different lengths 2025-03-01 08:34:06 And I want buildings to fill arbitrary plots better than most sims do 2025-03-01 08:34:19 Call it Grand Theft Fortho 2025-03-01 08:34:22 But I also can't 'shape' skyscrapers much, they're usually simple shapes 2025-03-01 08:34:31 So I won't 2025-03-01 08:35:53 user51: I had thought about using Forth, but currently am not using it at all because I'm not as productive in it 2025-03-01 08:36:09 And the point of this exercise is not playing with Forth, but actually getting stuff done 2025-03-01 08:36:45 I think Forth would be great for a retro programming puzzles game though 2025-03-01 08:37:24 as a scripting lang 2025-03-01 08:37:28 Arguably a sort of higher-level 'runtime-checked' Forth would be decent for scripting, if you had scripters on a project 2025-03-01 08:38:08 I don't presently have any scripters planned or necessary for this city sim, if I needed that I'd use Lua, but I don't think it will be necessary at all 2025-03-01 08:38:09 Come on, it needs to be statically-checked formally-verified and provably-terminating :P 2025-03-01 08:38:12 luajit specifically 2025-03-01 08:48:06 Also I'm not saying Forth is always less productive, but for me it's not been that productive. Arguably classic Forth isn't that productive, inherently. 2025-03-01 08:48:34 And this is why I'm always more interested in what people like crc have done, because they put their own dialects into practice and have demonstrated more 2025-03-01 08:50:53 e.g. retro and konilo's environments are quite featured, and crc seems to be able to put stuff together relatively quickly in his environments 2025-03-01 08:50:53 Although that could be an illusion! 2025-03-01 08:54:09 But also we're all different, I could just be bad at it 2025-03-01 11:01:25 helllo 2025-03-01 11:05:24 Hi 2025-03-01 11:06:37 ForthBot: WORDS 2025-03-01 11:06:37 SUM_SQUARE ? X FIBONACCI recunacci HAMLET 2025-03-01 11:07:25 ForthBot: SEE HAMLET 2025-03-01 11:07:25 : HAMLET (OP_42) (OP_42) (OP_42) ; 2025-03-01 11:07:58 ForthBot: FORGET HAMLET 2025-03-01 11:10:53 ForthBot: FORGET FORGET 2025-03-01 11:10:53 FORGET: Unknown word: FORGET 2025-03-01 11:14:25 ForthBot: SEE HAMLET 2025-03-01 11:14:26 SEE: Unknown word: HAMLET 2025-03-01 11:14:42 ForthBot: WORDS 2025-03-01 11:14:42 SUM_SQUARE ? X FIBONACCI recunacci 2025-03-01 11:16:26 Does it do regex? FORGET .* :P 2025-03-01 11:30:56 I'm looking for a specific quote -- I believe it's from Chuck, it's about quantisizing your code or data, can't remember which. Does anyone have a clue? 2025-03-01 12:40:54 ForthBot: 5 3 AND . 2025-03-01 12:40:54 1 2025-03-01 12:42:27 ForthBot: 5 3 & . 2025-03-01 12:42:28 1 2025-03-01 12:43:13 ForthBot: 5 3 | . 2025-03-01 12:43:13 7 2025-03-01 12:44:05 ForthBot: 5 3 ~ . 2025-03-01 12:44:05 Unknown word: ~ . 2025-03-01 12:44:25 ForthBot: 5 3 ~ . 2025-03-01 12:44:26 -4 2025-03-01 12:45:31 ForthBot: 5 LSHIFT . 2025-03-01 12:45:31 160 2025-03-01 12:45:50 ForthBot: 5 2 LSHIFT . 2025-03-01 12:45:50 20 2025-03-01 12:56:26 ForthBot: 2 16 LSHIFT . 2025-03-01 12:56:26 131072 2025-03-01 12:56:48 bizarre 2025-03-01 12:56:59 ForthBot: FLUSH 2025-03-01 12:57:07 ForthBot: 2 16 LSHIFT . 2025-03-01 12:57:08 131072 2025-03-01 12:57:20 ForthBot: 1 16 LSHIFT . 2025-03-01 12:57:20 65536 2025-03-01 12:57:25 c'st mieux 2025-03-01 13:55:32 ForthBot: : test 0 BEGIN 1+ DUP 5 = UNTIL . ; 2025-03-01 13:55:32 Unknown word: 1+ 2025-03-01 13:55:39 ForthBot: : test 0 BEGIN 1 + DUP 5 = UNTIL . ; 2025-03-01 13:55:39 Unknown word: UNTIL 2025-03-01 13:56:11 ForthBot: : test 0 BEGIN 1 + DUP 5 <> WHILE REPEAT . ; 2025-03-01 13:56:12 Unknown word: <> 2025-03-01 13:56:18 ForthBot: : test 0 BEGIN 1 + DUP 5 = 0 = WHILE REPEAT . ; 2025-03-01 13:56:26 ForthBot: test 2025-03-01 13:56:44 ForthBot: .S 2025-03-01 13:56:44 Stack empty 2025-03-01 13:58:10 That should be 5, shouldn't it? 2025-03-01 13:58:27 yes but nothing came up 2025-03-01 13:58:41 I was testing if loops worked 2025-03-01 13:59:29 ForthBot: 0 5 = . 5 5 = . 2025-03-01 13:59:29 0 2025-03-01 14:02:16 ForthBot: test .S 2025-03-01 14:02:16 Stack empty 2025-03-01 14:02:29 I was wondering if the stack was cleared afor eah line 2025-03-01 14:03:08 ForthBot: 1 2025-03-01 14:03:11 ForthBot: .S 2025-03-01 14:03:11 Stack: 1 2025-03-01 14:03:18 GeDaMo: nope it doesn't 2025-03-01 14:03:19 yet there is still some bugs , i am working on them for now 2025-03-01 14:03:41 .S does not empty the stack 2025-03-01 14:08:30 I wanted to write a Collatz length finder, taking advantage of the bignum support, but I don't want to make it recursive, so it can't be done without loops 2025-03-01 14:18:40 pgimeno: http://0x0.st/8mhp.forth 2025-03-01 14:19:08 ForthBot: : COUNTDOWN DUP BEGIN DUP . CR 1 - DUP 0 > WHILE REPEAT DROP DROP ; 2025-03-01 14:19:17 ForthBot: 3 COUNTDOWN 2025-03-01 14:19:17 3 2025-03-01 14:19:32 ForthBot: 3 COUNTDOWN 2025-03-01 14:19:32 3 2025-03-01 14:19:49 pgimeno: extra credit if you make it memoize numbers to avoid recalculations. 2025-03-01 14:20:15 ForthBot: FORGET COUNTDOWN 2025-03-01 14:20:32 cleobuline: does ForthBot have variables or values? 2025-03-01 14:20:45 yes it have 2025-03-01 14:20:55 ForthBot: VARIABLE X 2025-03-01 14:21:03 ForthBot: 0 VALUE T 2025-03-01 14:21:03 Unknown word: VALUE 2025-03-01 14:21:33 ForthBot: 123456789123456789 X ! 2025-03-01 14:21:43 ForthBot: X @ . 2025-03-01 14:21:43 123456789123456789 2025-03-01 14:22:28 ForthBot: : COUNTDOWN DUP BEGIN DUP . CR 1 - DUP 0 > WHILE REPEAT DROP DROP ; 2025-03-01 14:22:38 ForthBot: 3 COUNTDOWN 2025-03-01 14:22:38 3 2025-03-01 14:22:43 bug 2025-03-01 14:24:22 ForthBot: : COUNTDOWN DUP BEGIN DUP . CR 1 - DUP 0 > WHILE REPEAT DROP DROP ; 3 COUNTDOWN . 2025-03-01 14:24:23 3 2025-03-01 14:24:23 Stack empty 2025-03-01 14:24:34 seem some memory corruption 2025-03-01 14:24:49 ForthBot: VARIABLE DOWN : COUNTDOWN ( N -- ) DOWN ! BEGIN DOWN @ 0 > WHILE DOWN ? DOWN @ 1 - DOWN ! DOWN @ REPEAT ; 5 COUNTDOWN 2025-03-01 14:24:49 Unknown word: ( 2025-03-01 14:25:03 ForthBot: VARIABLE DOWN : COUNTDOWN DOWN ! BEGIN DOWN @ 0 > WHILE DOWN ? DOWN @ 1 - DOWN ! DOWN @ REPEAT ; 5 COUNTDOWN 2025-03-01 14:25:03 Unknown word: ? 2025-03-01 14:25:11 no ( ) for now 2025-03-01 14:25:13 oh come on. the bot is ddosing me 2025-03-01 14:25:57 gforth_eval_bot: VARIABLE DOWN : COUNTDOWN ( N -- ) DOWN ! BEGIN DOWN @ 0 > WHILE DOWN ? DOWN @ 1 - DOWN ! DOWN @ REPEAT ; 5 COUNTDOWN 2025-03-01 14:26:13 !gforth VARIABLE DOWN : COUNTDOWN ( N -- ) DOWN ! BEGIN DOWN @ 0 > WHILE DOWN ? DOWN @ 1 - DOWN ! DOWN @ REPEAT ; 5 COUNTDOWN 2025-03-01 14:26:14 5 4 3 2 1 2025-03-01 14:26:20 user51: I don't think there's much value in memoizing for Collatz sequences. Ackermann on the other hand... 2025-03-01 14:26:43 pgimeno: never seen ackerman in the wild outside of SICP 2025-03-01 14:27:20 ForthBot: VARIABLE DOWN : COUNTDOWN DOWN ! BEGIN DOWN @ 0 > WHILE DOWN ? DOWN @ 1 - DOWN ! DOWN @ REPEAT ; 5 COUNTDOWN 2025-03-01 14:27:40 ForthBot: WORDS 2025-03-01 14:27:47 oh quit 2025-03-01 14:27:50 leaving . 2025-03-01 14:27:53 cleobuline: maybe the bot should scan for !prefix like gforth_eval_bot 2025-03-01 14:28:25 ForthBot: VARIABLE DOWN : COUNTDOWN DOWN ! BEGIN DOWN @ 0 > WHILE DOWN ? DOWN @ 1 - DOWN ! DOWN @ REPEAT ; 5 COUNTDOWN 2025-03-01 14:28:25 Unknown word: ? 2025-03-01 14:28:35 ForthBot: : ? @ . ; 2025-03-01 14:29:05 FORGET COUNTDOWN 2025-03-01 14:29:13 ForthBot: FORGET COUNTDOWN 2025-03-01 14:29:21 ForthBot: WORDS 2025-03-01 14:29:21 DOWN 2025-03-01 14:29:25 : COUNTDOWN DOWN ! BEGIN DOWN @ 0 > WHILE DOWN ? DOWN @ 1 - DOWN ! DOWN @ REPEAT ; 5 COUNTDOWN 2025-03-01 14:29:39 ForthBot: .S 2025-03-01 14:29:39 Stack: 0 0 4 0 3 0 2 0 1 0 0 2025-03-01 14:29:44 lol 2025-03-01 14:29:44 good thing i didn't use 1- there :D 2025-03-01 14:31:38 are there any known Forth implementations that interleave the data and return stacks? 2025-03-01 14:33:31 pgimeno: what does that mean in practice? 2025-03-01 14:36:32 I mean having the even words be the return stack and the odd words be the data stack or vice versa 2025-03-01 14:36:47 so both can grow down 2025-03-01 14:39:22 that implies possibly better cache locality, and no need to allocate one of them separately from the other or move it around 2025-03-01 14:41:34 Might be wasteful if you're pushing more to the data stack than return 2025-03-01 14:41:52 In that case, it also wouldn't be better for locality 2025-03-01 14:45:01 trying to have multiple stacks in limited memory is a headache. for a stack with types, you can add them in any order you like as long as speed isn't critical 2025-03-01 14:58:38 Any good tests for word parsing? Specifically, getting the next word from the scanned line. I figured there aren't that many cases since since we have 2 types of characters (parsed and skipped), that's one bit, and with some wishful thinking on my end I could generate some bit pattern tests that might cover enough cases to give some confidence it works well. Or I'm probably being too perfectionist here, 2025-03-01 14:58:44 also a good answer :) 2025-03-01 15:37:40 corrected some bugs 2025-03-01 15:38:15 ForthBot: : ? @ . ; 2025-03-01 15:38:38 ForthBot: ForthBot: VARIABLE DOWN 2025-03-01 15:38:38 Unknown word: ForthBot: 2025-03-01 15:38:52 ForthBot: VARIABLE DOWN 2025-03-01 15:39:12 ForthBot: : COUNTDOWN DUP DOWN ! BEGIN DOWN @ 0 > WHILE DOWN ? DOWN @ 1 - DOWN ! REPEAT DROP ; 2025-03-01 15:39:20 ForthBot: 3 COUNTDOWN 2025-03-01 15:39:21 3 2025-03-01 15:39:26 nice 2025-03-01 15:40:00 5 COUNTDOWN 2025-03-01 15:40:10 ForthBot: 5 COUNTDOWN 2025-03-01 15:40:10 5 2025-03-01 15:40:14 :o 2025-03-01 15:40:27 ForthBot: : FACT DUP 1 > IF DUP 1 - FACT * ELSE DROP 1 THEN ; 2025-03-01 15:40:27 100000000000 COUNTDOWN :> 2025-03-01 15:40:35 noooooo !!!! 2025-03-01 15:40:43 lol 2025-03-01 15:40:57 ForthBot: 20 FACT . 2025-03-01 15:40:57 2432902008176640000 2025-03-01 15:41:02 nice 2025-03-01 15:41:21 ForthBot: : TEST ( n -- ) DOWN ! DOWN @ 0 > IF DOWN ? DOWN @ 1 - DOWN ! RECURSE THEN ; 5 TEST 2025-03-01 15:41:22 Unknown word: ( 2025-03-01 15:41:27 ForthBot: FORGET 2025-03-01 15:41:28 FORGET requires a word name 2025-03-01 15:41:38 ForthBot: FORGET COUNTDOWN 2025-03-01 15:41:52 ForthBot: 5 COUNTDOWN 2025-03-01 15:41:52 Unknown word: COUNTDOWN 2025-03-01 15:41:55 il ha not implemented comment ( ) 2025-03-01 15:42:14 not recurse too 2025-03-01 15:42:29 just call the definition directly 2025-03-01 15:42:37 did you make it from scratch? 2025-03-01 15:42:46 yes 2025-03-01 15:42:56 that's cool :o 2025-03-01 15:43:03 ForthBot: : test zozo ; 2025-03-01 15:43:04 Unknown word: zozo 2025-03-01 15:43:14 ForthBot: WORDS 2025-03-01 15:43:15 DP ? DOWN 2025-03-01 15:43:43 before there was undefined words dangling in the disctionnary i fix it 2025-03-01 15:45:45 i'm 66 retired programing is a hobbie for me to spend some time 2025-03-01 15:48:43 ForthBot: : FIBONACCI DUP 0 = IF DROP 0 EXIT THEN DUP 1 = IF DROP 1 EXIT THEN DUP 2 = IF DROP 1 EXIT THEN 1 1 ROT 2 - 0 DO OVER + SWAP LOOP DROP ; 2025-03-01 15:49:00 : RECUNACCI 0 DO I FIBONACCI LOOP DROP ; 2025-03-01 15:49:11 10 RECUNACCI .S 2025-03-01 15:49:15 lol 2025-03-01 15:49:29 seem in a llop 2025-03-01 15:49:36 ForthBot: SEE recunacci 2025-03-01 15:49:36 SEE: Unknown word: recunacci 2025-03-01 15:49:44 ForthBot: SEE RECUNACCI 2025-03-01 15:49:44 SEE: Unknown word: RECUNACCI 2025-03-01 15:49:48 oopsie. 2025-03-01 15:50:00 ForthBot: WORDS 2025-03-01 15:50:00 DP ? DOWN FIBONACCI 2025-03-01 15:50:53 ForthBot: 10 FIBONACCI . 2025-03-01 15:50:53 55 2025-03-01 15:51:11 ForthBot: FLUSH 2025-03-01 15:51:20 ForthBot: 0 FIBONACCI 2025-03-01 15:51:24 ForthBot: . 2025-03-01 15:51:24 0 2025-03-01 15:51:46 ForthBot: 1 FIBONACCI . 2025-03-01 15:51:46 1 2025-03-01 15:51:51 veltas: being able to put things together fairly quickly is, for me, the result of spending 25 years working on my dialects, building up the vocabulary, and getting comfortable working with the stacks 2025-03-01 15:52:24 ForthBot: FLUSH 2025-03-01 15:52:57 ForthBot: SEE RECUNACCI 2025-03-01 15:52:57 : RECUNACCI 0 DO I FIBONACCI LOOP DROP ; 2025-03-01 15:53:52 ForthBot: 10 RECUNACCI .S 2025-03-01 15:53:52 Stack: 0 1 1 2 3 5 8 13 21 2025-03-01 15:54:08 ForthBot: 11 RECUNACCI .S 2025-03-01 15:54:08 Stack: 0 1 1 2 3 5 8 13 21 0 1 1 2 3 5 8 13 21 34 2025-03-01 15:54:25 mmm 2025-03-01 15:54:40 something wrong in the loop 2025-03-01 15:55:32 : RECUNACCI 2 + 0 DO I FIBONACCI LOOP DROP ; 2025-03-01 15:55:46 ForthBot: : RECUNACCI 2 + 0 DO I FIBONACCI LOOP DROP ; 2025-03-01 15:55:57 ForthBot: 10 RECUNACCI .S 2025-03-01 15:55:58 Unknown word: RECUNACCI 2025-03-01 15:56:17 merde ! 2025-03-01 15:57:22 ForthBot: : test DO I LOOP ; 2025-03-01 15:57:34 ForthBot: FLUSH 2025-03-01 15:57:47 ForthBot: 10 0 test .S 2025-03-01 15:57:47 Stack: 10 0 2025-03-01 15:57:59 loop is broken 2025-03-01 15:58:22 back to the store .... 2025-03-01 16:02:35 ForthBot: : test DO I LOOP ; 10 0 test .S 2025-03-01 16:02:36 Stack: 0 1 2 3 4 5 6 7 8 9 2025-03-01 16:03:10 something is corrupting .... 2025-03-01 16:08:01 !gforth : test DO I LOOP ; 10 0 test .S 2025-03-01 16:08:04 <10> 1 2 3 4 5 6 7 8 9 2025-03-01 16:32:22 crc: I think also your dialect is more orthogonal and convenient than classic Forths 2025-03-01 16:32:42 Although I just get that impression from the programs I've seen, I've still not actually learned it myself 2025-03-01 16:35:09 veltas: retro? 2025-03-01 16:39:56 Yeah retro, I do know classic forth and have used it a fair amount 2025-03-01 16:40:03 retro and konilo 2025-03-01 17:54:14 ForthBot: : FACT DUP 1 > IF DUP 1 - RECURSE * ELSE DROP 1 THEN ; 2025-03-01 17:54:14 Defined: FACT 2025-03-01 17:54:31 ForthBot: SEE FACT 2025-03-01 17:54:31 : FACT DUP 1 > IF DUP 1 - RECURSE * ELSE DROP 1 THEN ; 2025-03-01 18:33:50 Still a huge bloody mess, but threading seems to work.. for now. 2025-03-01 18:34:01 http://0x0.st/8aA_.c 2025-03-01 18:37:45 Here's a sample input/output, first line is the input http://0x0.st/8aA6.txt 2025-03-01 20:41:12 f 2025-03-01 20:42:01 Maybe I could prevent my client from sending one letter messages, not idea how tho. 2025-03-01 20:58:41 ForthBot: : RECUNACCI 0 DO I FIBONACCI LOOP DROP ; 2025-03-01 20:58:42 Unknown word: FIBONACCI 2025-03-01 20:58:51 ForthBot: WORDS 2025-03-01 20:58:51 DP FACT 2025-03-01 20:59:22 ForthBot: : FIBONACCI DUP 0 = IF DROP 0 EXIT THEN DUP 1 = IF DROP 1 EXIT THEN DUP 2 = IF DROP 1 EXIT THEN 1 1 ROT 2 - 0 DO OVER + SWAP LOOP DROP ; 2025-03-01 20:59:23 Defined: FIBONACCI 2025-03-01 20:59:32 ForthBot: : RECUNACCI 0 DO I FIBONACCI LOOP DROP ; 2025-03-01 20:59:38 ForthBot: : RECUNACCI 0 DO I FIBONACCI LOOP DROP ; 2025-03-01 20:59:38 Defined: RECUNACCI 2025-03-01 20:59:53 ForthBot: 10 RECUNACCI 2025-03-01 21:00:04 ForthBot: .S 2025-03-01 21:00:04 Stack: 0 0 1 1 2 3 5 8 13 21 2025-03-01 21:00:30 mm 2025-03-01 21:00:45 ForthBot: 1 FIBONACCI . 2025-03-01 21:00:45 1 2025-03-01 21:01:07 ForthBot: FLUSH 2025-03-01 21:01:15 ForthBot: 10 RECUNACCI 2025-03-01 21:01:20 ForthBot: .S 2025-03-01 21:01:20 Stack: 0 1 1 2 3 5 8 13 21 2025-03-01 21:01:46 ForthBot: 11 RECUNACCI .S 2025-03-01 21:01:46 Stack: 0 1 1 2 3 5 8 13 21 0 1 1 2 3 5 8 13 21 34 2025-03-01 21:03:27 ForthBot: FLUSH 2025-03-01 21:04:39 ForthBot: : RECUNACCI 1 + 0 DO I FIBONACCI LOOP DROP ; 2025-03-01 21:04:40 Defined: RECUNACCI 2025-03-01 21:04:58 ForthBot: 10 RECUNACCI .S 2025-03-01 21:04:58 Stack: 0 1 1 2 3 5 8 13 21 34 2025-03-01 21:06:58 ForthBot: : RECUNACCI 2 + 0 DO I FIBONACCI LOOP DROP ; 2025-03-01 21:06:58 Defined: RECUNACCI 2025-03-01 21:07:04 ForthBot: 10 RECUNACCI .S 2025-03-01 21:07:05 Stack: 0 1 1 2 3 5 8 13 21 34 0 1 1 2 3 5 8 13 21 34 55 2025-03-01 21:07:16 wright 2025-03-01 21:07:45 ForthBot: FLUSH 2025-03-01 21:08:28 f(0)...f(10) 2025-03-01 21:11:33 ForthBot: WORDS 2025-03-01 21:11:33 DP FACT FIBONACCI RECUNACCI 2025-03-01 21:12:02 ForthBot: DP @ . 2025-03-01 21:12:02 4 2025-03-01 21:31:37 ForthBot: 72 EMIT 73 EMIT CR 2025-03-01 21:31:38 Unknown word: EMIT 2025-03-01 21:31:44 ah 2025-03-01 21:32:00 zut