01:03:22
##forth
<vms14>
where do s" and c" store the string in memory?
01:03:30
##forth
<vms14>
they do not seem to increment here
01:03:44
##forth
<vms14>
I'm incrementing here with both
01:05:36
##forth
<vms14>
they do not store it in the pad either
01:05:42
##forth
<vms14>
at least in gforth
01:06:57
##forth
<vms14>
it is wrong to increment here for s" and c"?
01:25:45
##forth
<forthBot>
Environment for cleobuli_ inactive, freeing...
02:26:33
##forth
<xentrac>
vms14: typically they store it in the colon definition
02:26:35
##forth
<xentrac>
: hello s" goodbye" ; ' hello 48 dump
02:26:35
##forth
<xentrac>
7F7BF76C34A8: BC 7E 10 34 CA 55 00 00 - 00 00 00 00 00 00 00 00 .~.4.U..........
02:26:38
##forth
<xentrac>
7F7BF76C34B8: D9 80 10 34 CA 55 00 00 - D0 34 6C F7 7B 7F 00 00 ...4.U...4l.{...
02:26:41
##forth
<xentrac>
7F7BF76C34C8: 67 6F 6F 64 62 79 65 20 - BE 82 10 34 CA 55 00 00 goodbye ...4.U..
02:28:44
##forth
<xentrac>
(in gforth)
02:38:28
##forth
<vms14>
yeah but outside them they seem to use what they call "a transient buffer" which is not pad and will be reused the next time s" or c" are called
02:39:05
##forth
<vms14>
my pad is actually from 0 to 300 since memory is just an array, here starts at 300
02:39:29
##forth
<vms14>
and colon definitions do not reside in memory, they are just a perl subroutine xd
02:40:19
##forth
<vms14>
I should think about making a dictionary in memory, but for now I will keep having memory only for the rest of stuff and the dictionary be a hash table
02:47:08
##forth
<vms14>
it launches a repl if you load that with perl
02:52:25
##forth
<vms14>
I should create DUMP
02:53:13
##forth
<xentrac>
s" is called " in F83
02:53:29
##forth
<xentrac>
in compilation state it stores the characters in the colon definition, same as GForth
02:54:43
##forth
<xentrac>
in interpretation state it appends them to the dictionary anyway
02:54:54
##forth
<xentrac>
just not as part of a dictionary entry necessarily
03:01:22
##forth
<vms14>
then it increments HERE like I do
03:01:38
##forth
<vms14>
cool
03:01:54
##forth
<vms14>
I like it that way more because they can persist
03:02:25
##forth
<vms14>
but maybe they shouldn't and that's why the space gets reused in gforth
03:02:40
##forth
<xentrac>
well also it doesn't work
03:03:30
##forth
<vms14>
what does not work
03:03:42
##forth
<xentrac>
it doesn't push the address and length on the stack in interpret state
03:03:55
##forth
<vms14>
in f83?
03:03:57
##forth
<xentrac>
yeah
03:04:02
##forth
<vms14>
oh
03:04:05
##forth
<xentrac>
so there's no way to use the string you've thus stored
03:04:08
##forth
<xentrac>
well
03:05:53
##forth
<xentrac>
maybe if you saved the value of here from before storing the string you could find the counted string from it
03:07:39
##forth
<xentrac>
like here " hello vms14" 2 + count type says "hello vms14 ok"
03:08:57
##forth
<vms14>
I have ," for that
03:10:52
##forth
<vms14>
" pushes the string directly on the stack or definition and the others work like in forth
03:11:18
##forth
<vms14>
I have accept too xd
03:11:48
##forth
<vms14>
I will try to see how much of starting forth code I can evaluate in this thing
03:11:55
##forth
<vms14>
the F example works already
03:12:32
##forth
<vms14>
although that was simple
03:15:28
##forth
<xentrac>
this works in F83: here " yer mom" ' type , ' unnest , constant where : whoa where >r ; whoa printing "yer mom"
03:16:12
##forth
<xentrac>
whoa is arranging to return into the code appended to the dictionary by " and the two calls to ,
03:16:22
##forth
<xentrac>
whose location is at the constant where
14:23:18
##forth
<cleobuline>
forthBot: LOAD "ini.fth"
14:23:18
##forth
<forthBot>
File ini.fth loaded
14:23:34
##forth
<cleobuline>
forthBot: MICRO 123456789123457 FPRIME? . MICRO SWAP - .
14:23:35
##forth
<forthBot>
1
14:23:35
##forth
<forthBot>
886487
14:23:50
##forth
<cleobuline>
forthBot: MICRO 123456789123457 FPRIME2? . MICRO SWAP - .
14:23:50
##forth
<forthBot>
1
14:23:51
##forth
<forthBot>
604963
14:24:11
##forth
<cleobuline>
less than 1 second
14:25:00
##forth
<cleobuline>
forthBot: MICRO 123456789123457 PRIME? . MICRO SWAP - .
14:25:00
##forth
<forthBot>
1
14:25:01
##forth
<forthBot>
47
16:01:13
##forth
<cleobuline>
bon
16:04:10
##forth
<vms14>
I'm learning forth by implementing words
16:05:16
##forth
<vms14>
but I should change the dictionary and have proper headers and body for words
16:16:03
##forth
<cleobuline>
vms14: with assembler ?
16:16:08
##forth
<cleobuline>
of c ?
16:16:17
##forth
<cleobuline>
or c
16:19:37
##forth
<vms14>
in perl xd
16:20:18
##forth
<vms14>
@memory[$addr .. $addr + $times] = ($element) x $times;
16:20:25
##forth
<vms14>
that's the implementation for FILL
16:20:45
##forth
<vms14>
0 30 32 FILL
16:25:00
##forth
<forthBot>
Environment for cleobuline inactive, freeing...
19:37:06
##forth
<cleobuline>
forthBot: LOAD "ini.fth"
19:37:06
##forth
<forthBot>
File ini.fth loaded
19:37:17
##forth
<cleobuline>
forthBot: CREDIT
21:37:17
##forth
<forthBot>
Environment for cleobuline inactive, freeing...
21:55:19
##forth
<vms14>
I have created m" which is like s" but expects an address on the stack and puts the strirng there
21:56:01
##forth
<xentrac>
huh, interesting!
21:56:19
##forth
<xentrac>
so you can pad m"
21:56:27
##forth
<vms14>
yes
21:56:41
##forth
<vms14>
I should make a version with limit I guess
21:56:50
##forth
<vms14>
but does not make sense
21:57:14
##forth
<vms14>
at the end you are creating a literal string so you should know if it fits or not
21:57:32
##forth
<vms14>
I assume it can be useful for data structures and alike
21:57:54
##forth
<vms14>
I was starting to read Object-Oriented Forth: Implementation of Data Structures
21:57:57
##forth
<xentrac>
I agree
21:58:23
##forth
<vms14>
it shows a very simple way to create records with constants and does> + ;
21:58:56
##forth
<xentrac>
I suppose that in compile mode it will be copying the characters of the string into the location it gets from the stack
21:59:03
##forth
<xentrac>
from the colon definition
21:59:37
##forth
<vms14>
0 constant name 20 constant phone : record create 40 allot does> + ;
22:00:38
##forth
<vms14>
record john-doe name john-doe m" John Doe"
22:00:47
##forth
<vms14>
should work
22:00:52
##forth
<xentrac>
you could imagine a simpler way to define the record structure
22:01:02
##forth
<vms14>
yeah it will explain it later
22:01:08
##forth
<vms14>
(the book)
22:01:22
##forth
<vms14>
but it lead to the m" word which is cool
22:03:17
##forth
<vms14>
should I name it !" ?
22:03:18
##forth
<xentrac>
like : field create , does> @ + ; : record create 40 allot ; for example
22:03:26
##forth
<xentrac>
!" sounds like a good name to me
22:03:27
##forth
<vms14>
I used m" because of memory
22:03:33
##forth
<vms14>
but store is !
22:03:36
##forth
<xentrac>
yeah
22:03:51
##forth
<xentrac>
should it return the address and length or not?
22:04:01
##forth
<vms14>
does not return anything
22:04:02
##forth
<xentrac>
I feel like it should at least return the length
22:04:26
##forth
<vms14>
or put a counted string
22:04:33
##forth
<xentrac>
counted strings were a mistake
22:04:41
##forth
<vms14>
I was thinking on a variation for the counted string
22:04:44
##forth
<vms14>
oh
22:05:14
##forth
<xentrac>
but without returning the string length somewhere, if you want to have Forth type out the string, you have to count the bytes yourself and say name john-doe 8 type
22:05:52
##forth
<vdupras>
In Dusk, I call it cmove" ( dstaddr -- a u ) because it does pretty much like cmove
22:06:13
##forth
<xentrac>
is a dstaddr?
22:07:07
##forth
<vms14>
why they were a mistake
22:07:33
##forth
<vms14>
returning a number it's sad because it requires me to store it somewhere although you are right
22:07:39
##forth
<vms14>
but a counted string solves both problems
22:07:49
##forth
<vms14>
name john-doe count type
22:08:03
##forth
<xentrac>
because if you have a regular string and you want to pass it to a word that wants a counted string, you have to allocate a buffer somewhere and copy the count and the string into it
22:08:15
##forth
<xentrac>
also you have a bug if a string grows past 255 bytes
22:08:30
##forth
<xentrac>
so I think it's a mistake to create words that want counted strings
22:08:37
##forth
<xentrac>
unfortunately there is one of them in the Forth standard
22:08:47
##forth
<xentrac>
find
22:09:26
##forth
<vms14>
so the problem is wanting a counted string
22:09:28
##forth
<xentrac>
the standard punched-card way to store variable-length strings in a fixed-width field is Forth's -trailing
22:09:54
##forth
<xentrac>
you pad out the buffer with spaces and pass the buffer's address and size to -trailing
22:10:53
##forth
<xentrac>
then you can type it
22:10:54
##forth
<xentrac>
as a trivial example: : hi s" example " -trailing type ; hi example ok
22:10:56
##forth
<xentrac>
oops
22:10:57
##forth
<vms14>
like expect does
22:11:03
##forth
<xentrac>
as a trivial example: : hi s" example " -trailing type ; hi example ok
22:11:23
##forth
<vms14>
I was implementing expect today, filling the rest with spaces
22:11:47
##forth
<vms14>
that's why in part I was wondering about expecting a limit for m"
22:11:51
##forth
<xentrac>
I think accept obsoletes expect
22:11:53
##forth
<vms14>
so it fills with spaces
22:12:01
##forth
<vms14>
I have both accept and expect
22:13:58
##forth
<vms14>
I guess m" should return a number or expect a limit and fill with spaces
22:14:20
##forth
<vms14>
and I also want the counted string because it makes sense for john doe's name
22:15:03
##forth
<vms14>
name john-doe m" John" name john-doe count type
22:15:22
##forth
<xentrac>
what I did for string handling in Forth last millennium was to reimplement DJB's stralloc in Forth, on top of malloc/free
22:15:29
##forth
<xentrac>
which I think are called allocate and free
22:15:29
##forth
<vms14>
I guess I will use only the counted version for now and name it !"
22:15:39
##forth
<xentrac>
yes
22:15:47
##forth
<vms14>
because it's weird to not see ! when setting values
22:16:05
##forth
<xentrac>
you will regret having used counted strings
22:16:08
##forth
<xentrac>
;)
22:16:09
##forth
<vms14>
:/
22:16:29
##forth
<vms14>
well right now I have to experiment with things so it's fine
22:16:40
##forth
<vms14>
the next month all this code will likely not exist anymore
22:20:09
##forth
<cleobuline>
hello at night here !
22:20:20
##forth
<vms14>
hi cleobuline
22:20:32
##forth
<xentrac>
somehow that makes me sad
22:20:39
##forth
<cleobuline>
L'heure locale pour Paris, Île-de-France, France métropolitaine, France est : 2025-05-22 22:20:24 (Fuseau horaire : Europe/Paris)
22:20:55
##forth
<xentrac>
c'est un fuseau!
22:21:06
##forth
<vms14>
I think a counted string makes sense in this case because it embeds the number, but I will remember to avoid expecting them and using count always
22:21:07
##forth
<xentrac>
in Spanish it's an "huso"
22:21:37
##forth
<vms14>
xentrac sad that I will throw everything? it means I will rewrite it changing what I have learned experimenting now
22:21:39
##forth
<xentrac>
which sounds exactly like "uso", as in "usage"
22:21:53
##forth
<xentrac>
yes, probably I am unreasonably attached to things
22:22:02
##forth
<xentrac>
thank God my wife makes me throw things out
22:22:07
##forth
<vms14>
I cannot have attachment to a prototype
22:22:25
##forth
<vms14>
when I learn what I'm doing and have a proper design then ok
22:22:41
##forth
<vms14>
but now the code and the design suck and really has to change
22:23:13
##forth
<vms14>
it is my playground where I learn, has been like that for a while
22:23:40
##forth
<cleobuline>
forthBot: STRING TOTO
22:24:07
##forth
<cleobuline>
forthBot: "S This is a string "S TOTO !
22:24:07
##forth
<forthBot>
Unknown word: This
22:24:07
##forth
<forthBot>
Unknown word: is
22:24:08
##forth
<forthBot>
Unknown word: a
22:24:08
##forth
<forthBot>
Unknown word: string
22:24:08
##forth
<forthBot>
Error: STORE: Stack underflow for string value
22:24:20
##forth
<cleobuline>
forthBot: S" his is a string "S TOTO !
22:24:39
##forth
<cleobuline>
forthBot: TOTO @ PRINT CR
22:24:40
##forth
<forthBot>
his is a string
22:24:40
##forth
<xentrac>
cleobuline: you really need to fix that bug where it can generate multiple lines of error messages for a single line of input
22:25:37
##forth
<cleobuline>
it's not a bug it just evaluate a string
22:26:07
##forth
<cleobuline>
i can't predict that the input is buggy
22:26:19
##forth
<cleobuline>
forthBot: prout
22:26:20
##forth
<forthBot>
Unknown word: prout
22:29:19
##forth
<xentrac>
it is a bug
22:29:24
##forth
<xentrac>
forthBot: a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
22:29:24
##forth
<forthBot>
Unknown word: a
22:29:24
##forth
<forthBot>
Unknown word: a
22:29:24
##forth
<forthBot>
Unknown word: a
22:29:25
##forth
<forthBot>
Unknown word: a
22:29:25
##forth
<forthBot>
Unknown word: a
22:29:25
##forth
<forthBot>
Unknown word: a
22:29:26
##forth
<forthBot>
Unknown word: a
22:29:26
##forth
<forthBot>
Unknown word: a
22:29:27
##forth
<forthBot>
Unknown word: a
22:29:27
##forth
<forthBot>
Unknown word: a
22:29:27
##forth
<forthBot>
Unknown word: a
22:29:28
##forth
<forthBot>
Unknown word: a
22:29:28
##forth
<forthBot>
Unknown word: a
22:29:29
##forth
<forthBot>
Unknown word: a
22:29:29
##forth
<forthBot>
Unknown word: a
22:29:30
##forth
<xentrac>
a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
22:29:30
##forth
<forthBot>
Unknown word: a
22:29:36
##forth
<xentrac>
a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
22:29:39
##forth
<xentrac>
see?
22:29:41
##forth
<forthBot>
Unknown word: a
22:29:42
##forth
<forthBot>
Unknown word: a
22:29:42
##forth
<forthBot>
Unknown word: a
22:29:43
##forth
<forthBot>
Unknown word: a
22:29:43
##forth
<forthBot>
Unknown word: a
22:29:44
##forth
<forthBot>
Unknown word: a
22:29:44
##forth
<forthBot>
Unknown word: a
22:29:45
##forth
<forthBot>
Unknown word: a
22:29:45
##forth
<forthBot>
Unknown word: a
22:29:46
##forth
<forthBot>
Unknown word: a
22:29:47
##forth
<forthBot>
Unknown word: a
22:29:47
##forth
<forthBot>
Unknown word: a
22:29:47
##forth
<forthBot>
Unknown word: a
22:29:48
##forth
<forthBot>
Unknown word: a
22:29:48
##forth
<forthBot>
Unknown word: a
22:29:49
##forth
<forthBot>
Unknown word: a
22:29:49
##forth
<forthBot>
Unknown word: a
22:29:50
##forth
<forthBot>
Unknown word: a
22:30:55
##forth
<forthBot>
Unknown word: a
22:30:55
##forth
<forthBot>
Unknown word: a
22:32:16
##forth
<cleobuline>
il will try