2025-03-02 19:44:07 I think I'll go for NUL-terminated strings in my forth, arguments for/against NUL-terminated/counted welcome. 2025-03-02 19:45:26 while I do not share your preference, I doubt it's because I know something you don't ;) 2025-03-02 19:46:21 I think that counted strings are more of a pain in C, where you don't have multiple return values, than in Forth 2025-03-02 19:50:51 Yeah, using C is probably a factor. I even ran into problems with strncmp which may or may not be relevant. 2025-03-02 19:53:21 The problems were (1) it's a string function, so it terminates on the first NUL (2) but it also takes n, but NUL has precedence (3) it checks the prefix, so it might return 0 implying equality for different strings (4) what do you think strncmp(s1,s2,0) should do? and finally (5) it's on the same manpage as strcmp, despite being significantly different 2025-03-02 20:14:42 yeah, there's no standard library support for counted strings in C 2025-03-02 20:21:40 you also have to pick a maximum size with counted strings or use a variable encoding for the length 2025-03-02 20:23:41 oh, I definitely do not endorse the count-byte representation used by C" introduced in Forth-83 2025-03-02 20:23:57 by "counted string" I only meant c-addr u on the stack 2025-03-02 20:24:08 or in a 2variable or whatever 2025-03-02 20:24:17 then your maximum size is the size of memory 2025-03-02 20:25:28 xentrac: there's some 2025-03-02 20:26:25 but yeah there's no counted atoi for example afaik 2025-03-02 20:27:23 also no counted strcmp, no counted strcpy, no counted strcat, etc. 2025-03-02 20:27:35 you might think memcmp is a counted strcmp 2025-03-02 20:28:13 i mean counted strcpy is memcpy 2025-03-02 20:28:17 but no, if you have two counted strings of different lengths, memcmp will not tell you which of them comes first asciibetically. it doesn't even have enough arguments to take both of their lengths 2025-03-02 20:28:47 how does strcmp deal with different lengths? 2025-03-02 20:29:04 doesn't memcmp perform similarly to strncmp, except without a nul terminator check? 2025-03-02 20:29:07 or more specifically, if one string is a prefix of the other, which one comes first? 2025-03-02 20:29:08 if one string is a prefix of the other, that one is considered to be "less than" 2025-03-02 20:29:37 so memcmp the shorter string against the same length of the other string 2025-03-02 20:29:44 memcpy, like memcmp, doesn't have enough arguments to take the lengths of both arguments 2025-03-02 20:30:56 yes, you can of course write your own counted strcmp and strcpy and so on with the C primitives 2025-03-02 20:30:56 what I'm saying is that you have to 2025-03-02 20:32:04 in current C, which has by-value struct arguments, it's even a practical thing to do; it wasn't in early versions of C, where struct arguments were by reference 2025-03-02 21:15:29 ForthBot: STRING HELLO 2025-03-02 21:15:56 ForthBot: HELLO " Hello World !" 2025-03-02 21:16:14 ForthBot: HELLO @ PRINT 2025-03-02 21:16:46 ForthBot: HELLO " Hello World !" S! 2025-03-02 21:16:52 ForthBot: HELLO @ PRINT 2025-03-02 21:16:52 Hello World ! 2025-03-02 21:17:26 ForthBot: 72 EMIT 73 EMIT CR 2025-03-02 21:17:26 HI 2025-03-02 21:17:54 ready to print ascii art :) 2025-03-02 21:19:04 ForthBot: LOAD 'test.fth" 2025-03-02 21:19:04 LOAD expects a quoted filename 2025-03-02 21:19:17 ForthBot: LOAD "test.fth" 2025-03-02 21:19:17 Unknown word: RECURSE 2025-03-02 21:19:18 Definition failed for FACT: compilation error 2025-03-02 21:20:25 ForthBot: LOAD "test.fth" 2025-03-02 21:20:25 Unknown word: RECURSE 2025-03-02 21:20:25 Definition failed for FACT: compilation error 2025-03-02 21:36:39 something is broke :( 2025-03-02 21:56:58 ForthBot: LOAD 'test.fth" 2025-03-02 21:56:58 LOAD expects a quoted filename 2025-03-02 21:57:03 ForthBot: LOAD "test.fth" 2025-03-02 21:57:04 MOT DEFINIS : 2025-03-02 21:57:04 HELLO DOUBLE FACT POW FIBONACCI COUNTDOWN TUCK 2DROP SUM_SQUARE CUBE SUM_CUBES RECUNACCI 2025-03-02 21:57:05 Stack: 30 2025-03-02 21:57:05 Others 2025-03-02 21:57:05 MOTS DEFINI : 2025-03-02 21:57:06 HELLO DOUBLE FACT POW FIBONACCI COUNTDOWN TUCK 2DROP SUM_SQUARE CUBE SUM_CUBES RECUNACCI TRIPLE POW2 TEST-CASE 2025-03-02 21:57:07 test2.fth loaded ! 2025-03-02 21:57:13 kool 2025-03-02 21:57:36 ForthBot: SEE FACT 2025-03-02 21:57:45 lol 2025-03-02 23:16:21 ForthBot: LOAD "test.fth" 2025-03-02 23:16:21 MOT DEFINIS : 2025-03-02 23:16:21 Stack: 30 2025-03-02 23:16:22 Others 2025-03-02 23:16:22 MOTS DEFINI : 2025-03-02 23:16:23 HELLO DOUBLE FACT POW FIBONACCI COUNTDOWN TUCK 2DROP SUM_SQUARE CUBE SUM_CUBES RECUNACCI TRIPLE POW2 TEST-CASE 2025-03-02 23:16:24 test2.fth loaded ! 2025-03-02 23:16:39 ForthBot: SEE FIBONACCI 2025-03-02 23:16:40 : FIBONACCI DUP 0 = IF DROP 0 EXIT DUP 1 = IF DROP 1 EXIT DUP 2 = IF DROP 1 EXIT 1 1 ROT 2 - 0 DO OVER + SWAP LOOP DROP THEN ; 2025-03-02 23:18:44 ForthBot: ." :D" 2025-03-02 23:18:44 :D 2025-03-02 23:19:09 ForthBot: : :D ." :D" ; 2025-03-02 23:19:16 ForthBot: :D 2025-03-02 23:19:16 :D 2025-03-02 23:19:17 yay! see! 2025-03-02 23:19:22 ForthBot: SEE :D 2025-03-02 23:19:22 : :D ." :D" ; 2025-03-02 23:19:30 :D 2025-03-02 23:22:23 yes ! 2025-03-02 23:28:52 ForthBot: : CAT 32 EMIT 32 EMIT 32 EMIT 47 EMIT 95 EMIT 47 EMIT 32 EMIT CR 40 EMIT 32 EMIT 111 EMIT 46 EMIT 111 EMIT 32 EMIT 41 EMIT CR 32 EMIT 32 EMIT 62 EMIT 32 EMIT 94 EMIT 32 EMIT 60 EMIT CR ; 2025-03-02 23:29:04 ForthBot: CAT 2025-03-02 23:29:04 /_/ 2025-03-02 23:35:09 vms14 they may be some bugs still 2025-03-02 23:35:16 lol 2025-03-02 23:35:33 it has cats, what else could we ask for 2025-03-02 23:35:44 yes ! 2025-03-02 23:36:13 it's funny how we had 0 bots and now we have 3 2025-03-02 23:36:37 if my abomination wasn't so different I would add mine too 2025-03-02 23:36:47 it's funny to build forthbot :) 2025-03-02 23:38:05 until you do not make word to read and write the host memory :) 2025-03-02 23:43:53 if you do that it can be turned in a nightmare