00:24:03
##forth
<xentrac>
As I see it, the one being used by people implementing GForth is, in a certain sense, more real :-)
06:07:40
##forth
<ghodawalaaman>
!gforth s" hello world" TYPE
06:07:41
##forth
<gforth_eval_bot>
hello world
06:09:37
##forth
<ghodawalaaman>
!gforth s" hello world" .
06:09:37
##forth
<gforth_eval_bot>
11
06:09:42
##forth
<ghodawalaaman>
!gforth s" hello world" . .
06:09:42
##forth
<gforth_eval_bot>
11 101729186248544
06:10:53
##forth
<ghodawalaaman>
!gforth s" hello" !
06:11:03
##forth
<ghodawalaaman>
hmm
06:11:10
##forth
<ghodawalaaman>
I want to change the "h" with "H"
06:12:55
##forth
<ghodawalaaman>
!gforth s" firefox" DUP ROT ROT ! TYPE
06:15:14
##forth
<vms14>
!gforth s" oh..." over char H swap 1+ ! type
06:15:14
##forth
<gforth_eval_bot>
oH
06:16:17
##forth
<vms14>
I've lost the dots xd
06:17:08
##forth
<ghodawalaaman>
:D
06:23:51
##forth
<vms14>
!gforth s" oh..." over char H swap 1+ c! type
06:23:52
##forth
<gforth_eval_bot>
oH...
06:23:58
##forth
<vms14>
forgot to use c!
06:25:20
##forth
<ghodawalaaman>
I am thinking about substacting 32 that way it could be a generic function
06:26:49
##forth
<ghodawalaaman>
but it would be quite complex
06:27:10
##forth
<vms14>
everything is complex in forth :D
06:27:17
##forth
<vms14>
you have to factor
06:27:33
##forth
<ghodawalaaman>
yeah, this one I will do it myself
06:27:56
##forth
<vms14>
we are counting on you
06:34:52
##forth
<ghodawalaaman>
it's really complex lol
06:35:15
##forth
<vms14>
you need to get used to forth
06:35:15
##forth
<ghodawalaaman>
I should read "Starting Forth" again
06:35:22
##forth
<vms14>
forth is for masochists
06:36:07
##forth
<vms14>
that's the main appeal I guess
06:36:08
##forth
<ghodawalaaman>
yeah, I need to think in terms of stack and also need to keep track of position of values on stack
06:36:22
##forth
<ghodawalaaman>
but I will master it eventually
06:36:41
##forth
<vms14>
you can cheat with r> >r or variables until you find a better way
06:37:17
##forth
<vms14>
sometimes r> >r is actually the way that makes most sense if you start messing too much with the stack
06:37:36
##forth
<vms14>
but you can also find a better ordering
06:38:18
##forth
<vms14>
a loop that upcases every character should be easy
06:38:39
##forth
<vms14>
as long as we assume that they will always be lovercase
06:38:43
##forth
<ghodawalaaman>
yeah, first define UPCASE and then DO .. LOOP
06:38:56
##forth
<vms14>
lowercase*
06:50:52
##forth
<vms14>
!gforth : upcase dup 0 do over i + dup c@ 32 - swap c! loop ; s" ohmycat" upcase type
06:50:52
##forth
<gforth_eval_bot>
OHMYCAT
06:51:04
##forth
<vms14>
but it will fail for numbers or symbols
07:04:19
##forth
<ghodawalaaman>
:o
07:50:52
##forth
<
ghodawalaaman>
to convert a b c to c b a on stack we have to take this steps: https://0x0.st/8TMe.pdf
07:51:22
##forth
<ghodawalaaman>
I can do this :)
07:52:09
##forth
<ghodawalaaman>
over -> rot -> drop -> rot
07:52:25
##forth
<ghodawalaaman>
!gforth a b c over rot drop rot .s
07:52:37
##forth
<ghodawalaaman>
!gforth 1 2 3 over rot drop rot .s
07:52:38
##forth
<gforth_eval_bot>
<3> 3 2 1
07:52:46
##forth
<ghodawalaaman>
\o/
07:52:56
##forth
<ghodawalaaman>
in the first attempt
08:55:39
##forth
<ghodawalaaman>
ohh I could just do swap rot
08:55:41
##forth
<ghodawalaaman>
lol
08:55:45
##forth
<ghodawalaaman>
I just saw in the answer
08:55:54
##forth
<ghodawalaaman>
!gforth 1 2 3 swap rot
08:56:04
##forth
<ghodawalaaman>
!gforth 1 2 3 swap rot .s
08:56:05
##forth
<gforth_eval_bot>
<3> 3 2 1
09:24:09
##forth
<ghodawalaaman>
wow the exercises in Starting Forth is actually challenging!
09:32:10
##forth
<veltas>
xentrac: gforth hasn't had a release in like 15+ years, Forth 200x was in its infancy at the last release
09:32:22
##forth
<veltas>
The gforth in this channel is like 15+ years old
09:32:44
##forth
<veltas>
So basically an ANS Forth
09:34:29
##forth
<veltas>
Forth standardisation is a total mess and has been for a long time, I think fundamentally Forth is a language that can't be directed nicely by a committee, if any language can be
09:35:48
##forth
<veltas>
I don't have strong opinions on this but the main argument in favor of Forth 200x is "we turned up" and "we released standards", but the standards they have released are not very good, and seem to be far removed from classic Forth in style and principle
09:37:05
##forth
<veltas>
So I merely push back if people call it "the standard", because you're acting like there is any kind of consensus
09:38:18
##forth
<veltas>
I would call it Forth 200x because that's their name
10:09:16
##forth
<user51>
i thought rolling your own was the standard :)
10:33:56
##forth
<pgimeno>
in the Jupiter, I can use FIND <word> and it pushes the address of <word>; if I then use EXECUTE, it executes the word as if you had just typed <word>. However in gforth, find gives a stack underflow and in pforth it unpolitely segfaults.
10:34:33
##forth
<pgimeno>
So I have to questions: what is FIND, and how do I find the execution address of a word.
10:36:47
##forth
<ghodawalaaman>
:o
10:37:21
##forth
<pgimeno>
no, I'm using a package called pforth that is part of debian
10:38:33
##forth
<ghodawalaaman>
oh I see
11:23:42
##forth
<veltas>
ghodawalaaman: That's a good place to start, the only point is that there's no 'one true standard'
11:24:21
##forth
<veltas>
A number of standards have been made that have gotten weirder and weirder over the years, and as programming has changed too
11:24:51
##forth
<veltas>
The original creator of Forth has even deviated significantly from the classic Forths in his own Forth, and significantly from 'standard' attempts
11:25:46
##forth
<veltas>
It's just good to understand it's not like C where the dialect is very homogenous, and people don't necessarily stick to vanilla ISO C (e.g. will use inline assembly, GCC extensions), but generally there's a well founded core that is pretty close to the standard
11:26:48
##forth
<veltas>
For example crc is the operator for this channel, and maintains two significant dialects of Forth, retro and konilo, which are both *very* different to the classic and standard Forths
11:27:57
##forth
<veltas>
And they're much better at doing what I think the Forth 200x committee wished Forth was more like, which is code that uses a lot of inline quotations (basically like lambda functions, or inline functions)
11:36:20
##forth
<xentrac>
veltas: GForth does seem to be changing slowly, but also seems to be somewhat actively maintained despite the lack of releases
11:36:42
##forth
<xentrac>
I agree that there's not much of a consensus
11:40:09
##forth
<xentrac>
pgimeno: Forth-83 and later find expects a counted string on the stack and returns an address and a boolean telling you whether it found the requested word
11:40:54
##forth
<xentrac>
this dialogue with gforth shows how to use it:
11:41:01
##forth
<xentrac>
: c"see" c" see" ; c"see" find . . -1 140004933494720 ok
11:41:01
##forth
<xentrac>
: c"qee" c" qee" ; c"qee" find .s <2> 140004933621104 0 ok
11:42:23
##forth
<xentrac>
of course, as Veltas correctly points out, things like Konilo, Factor, or Kitten are unlikely to be compatible at that level
11:46:39
##forth
<xentrac>
this also works in GForth: c"see" find . xt-see
11:46:56
##forth
<ghodawalaaman>
!gforth c"see" find . xt-see
11:47:15
##forth
<xentrac>
you'll have to define c"see" first as above
11:47:47
##forth
<ghodawalaaman>
!gforth : c"see" c" see" ; c"see" find . .
11:47:47
##forth
<xentrac>
!gforth : c"see" c" see" ; c"see" find . xt-see
11:47:47
##forth
<gforth_eval_bot>
-1 136763498792864
11:47:48
##forth
<gforth_eval_bot>
-1
11:48:08
##forth
<xentrac>
xt
11:48:16
##forth
<ghodawalaaman>
I see
11:48:29
##forth
<xentrac>
so does GForth
11:48:38
##forth
<xentrac>
xt-see is a factor of GForth's implementation of standard see
11:49:05
##forth
<xentrac>
what find leaves on the stack under the true flag is an xt
11:49:53
##forth
<xentrac>
probably I should have chosen a different example word to decompile!
11:50:51
##forth
<xentrac>
!gforth : c"words" c" words" ; c"words" find . xt-see
11:50:51
##forth
<gforth_eval_bot>
-1
11:51:31
##forth
<xentrac>
it's too bad gforth_eval_bot doesn't produce a one-line abbreviated version of such a short output
14:13:27
##forth
<pgimeno>
thanks for the explanations, so isn't there a modern equivalent of Jupiter's find?
14:14:52
##forth
<pgimeno>
it seems to be a FORTH 79 word actually
14:18:51
##forth
<xentrac>
you can do it but it's kind of a pain
14:19:13
##forth
<xentrac>
bl parse will parse a word in the TIB and leave c-addr u on the stack
14:20:05
##forth
<xentrac>
unfortunately find doesn't want c-addr u. It wants a c-addr of a counted string
14:20:52
##forth
<pgimeno>
I haven't seen counted strings, I presume they are strings prefixed with a length?
14:21:17
##forth
<xentrac>
yeah, prefixed with a length byte
14:21:54
##forth
<pgimeno>
so, WORD is suitable for parsing them then?
14:21:54
##forth
<xentrac>
and there's no guarantee that the bytes before and after the string that parse returns a pointer to are unused
14:23:00
##forth
<xentrac>
well, I would say parse if you want to do what the ACE Forth is doing
14:23:53
##forth
<xentrac>
anyway you can convert the return value of parse into a counted string for use with standard find
14:24:05
##forth
<xentrac>
by copying it into a temporary buffer such as pad
14:24:28
##forth
<pgimeno>
!gforth 32 word . find . .
14:24:29
##forth
<gforth_eval_bot>
-1 138363636047376
14:24:51
##forth
<xentrac>
but in GForth for example an easier thing to do is to call sfind
14:25:06
##forth
<xentrac>
which is a factor of find that takes the count on the stack
14:25:17
##forth
<pgimeno>
!gforth 56 32 word . find drop execute
14:25:17
##forth
<gforth_eval_bot>
56
14:25:21
##forth
<pgimeno>
works
14:25:46
##forth
<xentrac>
!gforth bl parse words sfind drop xt-see
14:27:04
##forth
<xentrac>
!gforth : acefind bl parse sfind ; acefind words drop xt-see
14:27:27
##forth
<xentrac>
is that helpful?
14:28:05
##forth
<pgimeno>
I don't know what parse does
14:28:11
##forth
<xentrac>
sfind isn't in the Standard (any version!), which I think is a mistake, but probably most Forths have something similar
14:28:39
##forth
<xentrac>
parse consumes a string (in this case, "words") from the input stream, returning its start and length
14:29:05
##forth
<xentrac>
here bl tells it when to stop: when it sees a space
14:29:12
##forth
<pgimeno>
so much like words except in a different format
14:29:22
##forth
<xentrac>
you mean much like find?
14:29:34
##forth
<pgimeno>
much like word
14:29:37
##forth
<pgimeno>
sorry
14:29:41
##forth
<xentrac>
words just lists all the defined words
14:30:55
##forth
<xentrac>
yes, I think it's common to implement word using bl parse, though GForth doesn't
14:31:56
##forth
<pgimeno>
in the test code of the jupiter I use the Forth79 verison of find quite often, it's useful to pass callbacks to a function
14:32:39
##forth
<xentrac>
oh, for that you want ' or [']
14:32:51
##forth
<xentrac>
I should have thought of that at the beginning
14:33:00
##forth
<xentrac>
parse takes the delimiter so you can use it to define things like ." or .(
14:33:04
##forth
<xentrac>
!gforth : .{ [char] } parse type ; immediate .{ okay}
14:33:05
##forth
<gforth_eval_bot>
okay
14:34:00
##forth
<pgimeno>
oh it seems that ' is the actual equivalent of Forth79's find, right?
14:34:31
##forth
<xentrac>
I don't know! Does Forth79's find not push a flag on the stack?
14:34:39
##forth
<vms14>
it just returns the xt of the word
14:34:53
##forth
<pgimeno>
that's right, it pushes 0 if the word is not found
14:35:01
##forth
<pgimeno>
otherwise the address
14:35:05
##forth
<vms14>
!gforth : oh 1 2 3 ; ' oh execute .s
14:35:06
##forth
<gforth_eval_bot>
<3> 1 2 3
14:35:25
##forth
<pgimeno>
yeah so it seems it was renamed
14:35:34
##forth
<xentrac>
' or ['] will throw undefined word instead of pushing 0
14:35:46
##forth
<vms14>
!gforth : oh ." oh..." cr ; defer meh ' oh is meh meh
14:35:47
##forth
<gforth_eval_bot>
oh...
14:35:51
##forth
<xentrac>
!gforth : foo ['] jioagjog ;
14:36:27
##forth
<xentrac>
we're missing the error output, but in interactive GForth it says :54: Undefined word
14:37:26
##forth
<vms14>
ghodawalaaman the bot is super cool
14:37:49
##forth
<vms14>
it's already giving a lot of value into this channel
14:37:53
##forth
<xentrac>
inside a definition ['] is for passing a word supplied at compile time, like jiaoagjog above, while ' will parse a word from the input when you run the definition containing it
14:38:13
##forth
<pgimeno>
well, pushing 0 or erroring out doesn't matter much for my purposes; certainly ' is what I'd regard as the modern equivalent of the old version of find
14:38:31
##forth
<xentrac>
vms14: I agree! I hope it lasts; I suspect it won't withstand the first attack for griefers
14:38:34
##forth
<xentrac>
*by
14:39:00
##forth
<pgimeno>
xentrac: understood, I wondered about the difference myself
14:39:06
##forth
<vms14>
yeah that's why it's fine for the bot to not answer private stuff
14:39:13
##forth
<xentrac>
pgimeno: I'm sorry I didn't mention it at the very beginning! I guess I assumed you wanted to be able to handle undefined words
14:39:20
##forth
<vms14>
so at least we can see here who is the one messing with the bot
14:39:24
##forth
<pgimeno>
thanks for the explanation
14:39:27
##forth
<vms14>
and hate him forever
14:39:43
##forth
<xentrac>
that's what griefers are shooting for
14:40:03
##forth
<xentrac>
liberal tears
14:40:10
##forth
<xentrac>
or male tears or whatever their outgroup is
14:40:46
##forth
<vms14>
seems to use a counted string
14:41:16
##forth
<xentrac>
vms14: yeah, that's the problem I was talking about 16 minutes ago
14:41:27
##forth
<vms14>
!gforth : oh 1 ; s" oh" find .s
14:41:34
##forth
<vms14>
:0
14:41:38
##forth
<xentrac>
you want c"
14:41:42
##forth
<vms14>
ah lol
14:41:51
##forth
<xentrac>
and you have to put it inside a colon definition
14:42:16
##forth
<xentrac>
because in interpret state it isn't clear where you'd store the bytes of the string or how long they'd last
14:42:50
##forth
<xentrac>
I think c" and this design of find were mistakes
14:43:04
##forth
<xentrac>
the old name for s" was just "
14:43:24
##forth
<vms14>
might be useful because the string is something "dynamic"
14:44:46
##forth
<pgimeno>
it's a shame you have to necessarily put it inside a colon definition
14:45:02
##forth
<vms14>
!gforth : f find ; : oh 1 ; c" oh" f .s
14:45:12
##forth
<vms14>
:/
14:45:31
##forth
<pgimeno>
it could just enclose the string in the current word when not compiling
14:46:02
##forth
<pgimeno>
so you could do e.g.: create mystr c" string"
14:47:07
##forth
<xentrac>
vms14: you have to put the c" inside a colon dfinition
14:47:33
##forth
<xentrac>
pgimeno: that's an interesting idea
14:47:33
##forth
<vms14>
yeah I'm trying in my "machine"
14:48:21
##forth
<xentrac>
not having to think about string lifetimes was probably a significant advantage for BASIC over FORTH in the 01980s
14:49:50
##forth
<vms14>
wasn't a word to convert a string + count to a counted string?
14:49:55
##forth
<vms14>
the reverse of "count"
14:50:52
##forth
<xentrac>
no, because it isn't clear where you'd store the bytes of the string or how long they'd last, so you have to think about string lifetimes, which is a significant disadvantage of Forth
14:51:19
##forth
<xentrac>
you could write a word that does that if you supply it a buffer address to build it in, at the risk of buffer overflows, but there isn't a standard one
14:53:09
##forth
<vms14>
place
14:54:15
##forth
<xentrac>
yeah, GForth has place
14:54:54
##forth
<vms14>
:D
14:55:13
##forth
<xentrac>
you can write it too without relying on any GForthisms:
14:55:28
##forth
<xentrac>
!gforth : decount dup pad c! pad 1+ swap cmove pad ; : unicorns s" unicorns" ; unicorns decount count type
14:55:29
##forth
<gforth_eval_bot>
unicorns
14:56:23
##forth
<xentrac>
no word in the standard writes to pad so user code can safely use it without worrying that the implementation will overwrite it
14:56:52
##forth
<xentrac>
the implementation of place in GForth is just over >r rot over 1+ r> move c!
14:57:44
##forth
<vms14>
I remember something like that in reddit or alike
14:58:01
##forth
<vms14>
because I ended trying to implement place not knowing it existed
14:59:03
##forth
<xentrac>
yeah, that's what I just did :-)
14:59:42
##forth
<xentrac>
it doesn't necessarily exist, though pForth does also have it
15:37:10
##forth
<ghodawalaaman>
vms14: Thank you
15:37:23
##forth
<vms14>
we thank you instead :D
15:37:29
##forth
<vms14>
I asked for that bot in the past
15:37:44
##forth
<ghodawalaaman>
owever bot won't be possible without the help of people in #bash and emanuele6, thanks to them too :)
15:37:47
##forth
<vms14>
you made my dream become true
15:38:05
##forth
<ghodawalaaman>
:3
15:39:30
##forth
<vms14>
I would not recommend you to make it work in private until it's really hardened
15:39:56
##forth
<vms14>
at least if it only works here we can know who is messing with it
15:40:44
##forth
<ghodawalaaman>
yeah, I will keep that in mind, the bot might have a lot of vulnerabilities which we don't know yet
15:40:50
##forth
<vms14>
the cool thing is that channel is relatively small so there are less chances to find someone who will actually want to cause harm
15:41:26
##forth
<vms14>
but you never know
15:42:05
##forth
<vms14>
I guess most members here will appreciate the bot since it's quite useful to show forth concepts
15:42:25
##forth
<vms14>
the perl bot for example is very cool for explaining perl concepts
15:42:49
##forth
<vms14>
but the perl bot is properly hardened
15:42:59
##forth
<ghodawalaaman>
right now it only supports gforth but we can also run other dialects of forth too
15:43:07
##forth
<ghodawalaaman>
I will add that feature after I get some free time
15:43:10
##forth
<vms14>
the author even encourages you to try to mess with it
15:43:54
##forth
<ghodawalaaman>
I joined #perl some time ago to make a bot in perl
15:43:59
##forth
<ghodawalaaman>
#perl community is great
15:48:32
##forth
<user51>
ghodawalaaman: bot source available?
15:49:39
##forth
<ghodawalaaman>
user51: yeah but it's very messy
15:49:53
##forth
<ghodawalaaman>
it's just 54 lines of bash :)
15:50:52
##forth
<user51>
awful, bash gets messy after 50 lines :)
15:51:02
##forth
<ghodawalaaman>
user51: part of the reason is that I don't have much experience in bash :)
16:55:20
##forth
<vms14>
pff it has coconut
16:56:17
##forth
<user51>
!gforth s" pwd" system
16:56:18
##forth
<gforth_eval_bot>
/src
16:56:40
##forth
<vms14>
!gforth s" ls -a" system
16:56:41
##forth
<gforth_eval_bot>
.
16:56:48
##forth
<user51>
!gforth s" make -j666" system
16:56:57
##forth
<vms14>
I have been trolled
16:57:24
##forth
<user51>
should've used ..
16:57:27
##forth
<crc>
more evil might be: s" :(){ :|:& };:" system
16:57:29
##forth
<GeDaMo>
!gforth s" id" system
16:57:30
##forth
<gforth_eval_bot>
uid=0(root) gid=0(root) groups=0(root)
16:57:43
##forth
<veltas>
!gforth s" ip link" system
16:57:43
##forth
<gforth_eval_bot>
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqu
16:57:45
##forth
<user51>
!gforth s" ls -a .." system
16:57:46
##forth
<gforth_eval_bot>
.
16:58:02
##forth
<vms14>
!gforth s" cat oh... > oh.txt" system s" ls" system
16:58:08
##forth
<crc>
!gforth s" uname -a" system
16:58:09
##forth
<gforth_eval_bot>
Linux d6786b92e9d1 6.8.0-51-generic #52-Ubuntu SMP
16:58:14
##forth
<vms14>
oh no redirection
16:59:21
##forth
<crc>
does the docker environment get replaced with each query or is it persistent?
17:00:03
##forth
<veltas>
!gforth s" touch test" system
17:00:09
##forth
<veltas>
!gforth s" ls" system
17:00:22
##forth
<vms14>
it died?
17:00:30
##forth
<veltas>
No it just doesn't reply if there's no lines
17:00:33
##forth
<veltas>
Or it died
17:00:41
##forth
<veltas>
!gforth ." hoya"
17:00:42
##forth
<gforth_eval_bot>
hoya
17:00:44
##forth
<vms14>
oh
17:00:55
##forth
<vms14>
then it cannot write
17:00:58
##forth
<user51>
abandon channel its escaping containment
17:01:03
##forth
<veltas>
So it gets replaced every query
17:01:33
##forth
<veltas>
Assuming it can write to that dir anyway...
17:01:55
##forth
<veltas>
!gforth s" touch test" system s" ls" system
17:01:56
##forth
<gforth_eval_bot>
test
17:02:06
##forth
<user51>
!gforth s" touch hello; ls" system
17:02:06
##forth
<gforth_eval_bot>
hello
17:02:12
##forth
<user51>
crap
17:02:23
##forth
<vms14>
it is what it should I guess
17:02:24
##forth
<user51>
oh wait
17:02:37
##forth
<user51>
!gforth s" touch hello2; ls" system
17:02:38
##forth
<gforth_eval_bot>
hello2
17:02:46
##forth
<crc>
probably better for security to have a fresh environment for every query, but wasteful in computing resources
17:03:07
##forth
<veltas>
I'm under impression this is just how docker works
17:03:08
##forth
<user51>
i think i know how to crash it
17:03:23
##forth
<GeDaMo>
!gforth s" ls -l ." system
17:03:24
##forth
<gforth_eval_bot>
total 0
17:03:33
##forth
<GeDaMo>
!gforth s" ls -ld ." system
17:03:34
##forth
<gforth_eval_bot>
drwxr-xr-x 2 root root 4096 Mar 14 2021 .
17:03:47
##forth
<user51>
well, maybe not crash but make it hang pretty badly. bash allocates a whole string for concatenations, so it quickly becomes a huge allocation
17:03:49
##forth
<GeDaMo>
2021, eh :P
17:04:00
##forth
<veltas>
!gforth s" ping 143.244.198.13" system
17:04:01
##forth
<gforth_eval_bot>
PING 143.244.198.13 (143.244.198.13) 56(84) bytes
17:04:05
##forth
<crc>
!gforth s" find / -name docker.sock 2>/dev/null" system
17:04:31
##forth
<veltas>
ghodawalaaman: network's not disabled
17:04:38
##forth
<user51>
for i in {0..1} ; do echo $i; done # now add more {0..1} to the loop
17:09:54
##forth
<crc>
ghodawalaaman: feel free to bring it back, but please add some mitigations to prevent it from potentially being used for nefarious purposes
17:10:52
##forth
<user51>
aw, just missed my chance to run fortune :D
17:10:54
##forth
<veltas>
I think ghodawalaaman meant to disable networking before, but obviously it's not worked. But yeah that particular issue is wide open to abuse.
17:16:53
##forth
<vms14>
why did you kick it lol
17:17:35
##forth
<vms14>
kick the user who misuses it instead
17:17:48
##forth
<thrig>
naughty hacker abuses bot getting their IP address into spam blacklists, etc
17:18:52
##forth
<vms14>
I would just : system ." never gonna give you up" cr ;
17:19:15
##forth
<vms14>
but gforth has sockets
17:20:36
##forth
<vms14>
!gforth ." muahahaha" cr
17:20:37
##forth
<gforth_eval_bot>
muahahaha
17:20:57
##forth
<ghodawalaaman>
!gforth s" ping 8.8.8.8" system
17:21:07
##forth
<ghodawalaaman>
:)
17:21:10
##forth
<vms14>
ok that was fast
17:21:33
##forth
<ghodawalaaman>
I forgot to add --network none to the docker command
17:21:53
##forth
<crc>
thanks for correcting that
17:22:05
##forth
<ghodawalaaman>
:-)
17:27:31
##forth
<veltas>
Where's my bug Bounty?
17:28:02
##forth
<vms14>
your coconut chocolate bar?
17:28:08
##forth
<vms14>
it's better to eat air
20:48:10
##forth
<veltas>
xentrac: gforth has had loads of development but they've not done a release in something like 15+ years, so it seems to just be 2-3 peoples' hobby at this point
20:49:21
##forth
<veltas>
There's been some discussion about this on their mailing list, apparently they have a checklist of things before releasing and the next release will be 1.0, but it feels too ivory tower to me
20:49:30
##forth
<veltas>
They should just do an 0.8 to tide us over
21:00:18
##forth
<xentrac>
they should
21:02:01
##forth
<user51>
gforth -1 :P
23:03:02
##forth
<veltas>
!gforth : DROP DROP ;
23:03:42
##forth
<veltas>
!gforth : DROP DROP ; .( X)
23:04:39
##forth
<veltas>
!gforth : T ." X" ; T
23:04:40
##forth
<gforth_eval_bot>
X
23:05:05
##forth
<veltas>
!gforth .( X)
23:05:06
##forth
<gforth_eval_bot>
X
23:05:17
##forth
<veltas>
!gforth WARNINGS OFF : DROP DROP ; .( X)
23:05:17
##forth
<gforth_eval_bot>
X
23:05:37
##forth
<veltas>
Some rough edges to figure out there with stderr
23:11:18
##forth
<veltas>
!gforth ' SORT .
23:13:54
##forth
<veltas>
!gforth ' TH .
23:13:55
##forth
<gforth_eval_bot>
128918359437160
23:20:44
##forth
<veltas>
!gforth 1 LIST
23:20:45
##forth
<gforth_eval_bot>
Screen 1 not modified
23:21:43
##forth
<veltas>
Also looks like \r and \n are both being converted to \n or something
23:27:31
##forth
<veltas>
!gforth TIME&DATE .S
23:27:32
##forth
<gforth_eval_bot>
<6> 32 27 22 22 2 2025
23:28:28
##forth
<veltas>
!gforth TIME&DATE <# # # # # #S #> TYPE
23:28:29
##forth
<gforth_eval_bot>
37354656749261842022402
23:28:40
##forth
<veltas>
!gforth TIME&DATE 0 <# # # # # #S #> TYPE
23:28:41
##forth
<gforth_eval_bot>
02025
23:28:51
##forth
<veltas>
Hey see gforth can speak like xentrac
23:28:56
##forth
<xentrac>
♥
23:29:54
##forth
<xentrac>
!gforth : .d 0 <# # # # # # #s #> type ." -" . ." -" . ." " 0 <# # # #> type ." :" <# # # #> type drop ; time&date .d .s
23:31:44
##forth
<xentrac>
!gforth : 2.d 0 <# # # #> type ; : .d 0 <# # # # # # #s #> type ." -" 2.d ." -" 2.d ." " 2.d ." :" 2.d drop ; time&date .d .s
23:31:45
##forth
<gforth_eval_bot>
002025-02-22 22:31<0>
23:32:00
##forth
<xentrac>
!gforth : 2.d 0 <# # # #> type ; : .d 0 <# # # # # #s #> type ." -" 2.d ." -" 2.d ." " 2.d ." :" 2.d drop ; time&date .d .s
23:32:00
##forth
<gforth_eval_bot>
02025-02-22 22:32<0>
23:32:36
##forth
<veltas>
!gforth warnings off 2025.02.22 d.
23:32:36
##forth
<gforth_eval_bot>
20250222
23:32:46
##forth
<xentrac>
haha
23:33:37
##forth
<veltas>
polyforth you can write 2025-02-22
23:33:45
##forth
<xentrac>
oh?
23:34:02
##forth
<veltas>
Yeah it accepts a few punctuators, and will allow them anywhere
23:34:22
##forth
<xentrac>
_ and ' are becoming common
23:34:28
##forth
<xentrac>
1_048_576
23:34:31
##forth
<veltas>
The standard assumes the least support by asking for . at the end
23:34:45
##forth
<xentrac>
!gforth 2025.02.22 : .d <# # # [char] - hold # # [char] - hold # # # # # #> type ; .d
23:34:46
##forth
<gforth_eval_bot>
02025-02-22
23:34:48
##forth
<veltas>
But typically I think forths support more
23:35:05
##forth
<xentrac>
yeah, bizarrely the standard doesn't standardize dpl
23:35:42
##forth
<xentrac>
which you kind of need if you're going to be feeding double-precision numbers into the Forth outer interpreter
23:35:49
##forth
<xentrac>
!gforth see dpl
23:38:22
##forth
<veltas>
TIME&DATE should output 2 doubles like 22:38:00 2025-02-22
23:38:55
##forth
<xentrac>
not a bad idea
23:39:33
##forth
<xentrac>
but it should consume the time to represent thus from the stack as seconds since the epoch
23:40:09
##forth
<veltas>
That's a good idea until 2038
23:40:59
##forth
<xentrac>
02038 could be a problem for 16-bit Forths if the seconds count is only double-precision
23:41:52
##forth
<veltas>
And this is the problem with the standard
23:42:00
##forth
<veltas>
There's no one-size-fits-all solution
23:46:17
##forth
<xentrac>
ddefer morse : thue 1- dup if recurse morse else ." ·" then 1+ ; : great 1- dup if thue thue morse else ." -" then 1+ ; ' great is morse 8 thue
23:46:23
##forth
<xentrac>
!gforth defer morse : thue 1- dup if recurse morse else ." ·" then 1+ ; : great 1- dup if thue thue morse else ." -" then 1+ ; ' great is morse 8 thue
23:46:23
##forth
<gforth_eval_bot>
·-··-·-·-··-·-··-·-··-·-·-··-·-
23:46:36
##forth
<xentrac>
hmm, looks like a charset problem
23:47:42
##forth
<xentrac>
!gforth defer morse : thue 1- dup if recurse morse else ." o" then 1+ ; : great 1- dup if thue thue morse else ." -" then 1+ ; ' great is morse 8 thue
23:47:42
##forth
<gforth_eval_bot>
o-oo-o-o-oo-o-oo-o-oo-o-o-oo-o-oo-o-o-oo-o-oo-o-o-
23:48:19
##forth
<xentrac>
(that's approximately the simplest nonrepeating sequence)
23:51:05
##forth
<veltas>
cool
23:51:52
##forth
<xentrac>
you could definitely render a 2-D fractal in 50×n ASCII art in less than the 512 bytes of an IRC line
23:52:34
##forth
<xentrac>
though you can't do animation probably
23:52:46
##forth
<xentrac>
(but not because of the character limit)
23:53:56
##forth
<vms14>
great is worse
23:54:54
##forth
<xentrac>
it's an in-browser emulator for the Canon Cat, which was programmed I think in SwiftForth
23:55:14
##forth
<vms14>
it's funny how the bot is making this channel so active
23:55:36
##forth
<vms14>
I like that
23:56:01
##forth
<vms14>
if we keep like this, the channel will end being really helpful to learn forth
23:57:27
##forth
<xentrac>
Swyft was the other portable computer Raskin did, so maybe I was even more confused than I thought
23:59:16
##forth
<veltas>
!gforth : FACTORIAL ( n1 - $n2) DUP 2 < IF DROP 1. ELSE DUP 1- RECURSE ROT 1 M*/ THEN ; 30 FACTORIAL D.
23:59:16
##forth
<gforth_eval_bot>
265252859812191058636308480000000