IRC Log - 2025-03-06 - ##forth

Channel: ##forth
Total messages: 148
Time range: 00:37:57 - 23:19:13
Most active: vms14 (75), cleobuline (23), ForthBot (12)
00:37:57 ##forth <cleobuline> ForthBot: LOAD "test.fth"
00:37:57 ##forth <ForthBot> mot definis :
00:39:48 ##forth <cleobuline> ForthBot: : FACTLOOP DUP 0 = IF DROP 1 EXIT THEN DUP 1 = IF DROP 1 EXIT THEN 1 SWAP 1 DO I * LOOP ;
00:39:56 ##forth <vms14> cleobuline hey
00:40:04 ##forth <vms14> my :D has colors
00:40:06 ##forth <vms14> https://i.imgur.com/0J5AsCr.png
00:41:32 ##forth <cleobuline> nice :)
00:42:23 ##forth <vms14> ForthBot: :D
00:42:24 ##forth <ForthBot> :D
00:43:39 ##forth <cleobuline> ForthBot: 500 FACTLOOP .
00:43:39 ##forth <ForthBot> <overflow>
00:43:48 ##forth <cleobuline> :(
00:46:54 ##forth <cleobuline> vms14: and the cat ?
00:47:03 ##forth <vms14> what cat
00:47:12 ##forth <vms14> ah
00:47:13 ##forth <cleobuline> ForthBot: CAT
00:47:13 ##forth <ForthBot> /_/
00:47:23 ##forth <vms14> I should implement it
00:47:27 ##forth <cleobuline> ForthBot: SEE CAT
00:47:27 ##forth <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 ;
00:47:36 ##forth <vms14> :0
00:47:54 ##forth <vms14> I'll steal some cat
00:48:19 ##forth <cleobuline> :)
01:15:45 ##forth <cleobuline> ForthBot: WORDS
01:15:45 ##forth <ForthBot> DP HELLO DOUBLE FACT POW FIBONACCI COUNTDOWN TUCK 2DROP SUM_SQUARE CUBE SUM_CUBES RECUNACCI CAT :D TRIPLE POW2 TEST-CASE FACTLOOP
01:16:27 ##forth <cleobuline> ForthBot: 0 20 SUM_SQUARE 0 20 SUM_CUBES .S
01:16:27 ##forth <ForthBot> Stack: 44100 44100
01:25:42 ##forth <cleobuline> ForthBot: SEE SUM_SQUARE SEE SUM_CUBES
01:25:43 ##forth <ForthBot> : SUM_SQUARE 1 + 0 DO I + LOOP DUP * ;
01:57:47 ##forth <ghodawalaaman> ForthBot: CAT
01:57:48 ##forth <ForthBot> /_/
01:57:53 ##forth <ghodawalaaman> Meow!
01:58:00 ##forth <ghodawalaaman> Nyah!
02:14:59 ##forth <vms14> cleobuline I have a cat
02:15:03 ##forth <vms14> :D
02:15:04 ##forth <vms14> https://i.imgur.com/3JnoRKW.png
02:16:40 ##forth <vms14> the code for nyan
02:16:41 ##forth <vms14> https://i.imgur.com/eqPqZWr.png
02:17:06 ##forth <vms14> the face is scary though
02:17:30 ##forth <vms14> oh and I broke the _______ xd
02:18:16 ##forth <cleobuline> it seem to be a wolf your cat vms14
02:18:57 ##forth <cleobuline> :)
02:19:15 ##forth <KipIngram> Aw, I thought maybe it was a real picture of your cat, vms14.
02:21:47 ##forth <vms14> now it's fixed
02:21:49 ##forth <vms14> https://i.imgur.com/r6SGWdb.png
02:22:18 ##forth <vms14> yeah the face is weird :/
02:23:29 ##forth <cleobuline> :)
02:25:07 ##forth <vms14> https://pastebin.com/raw/r8qEdWgD
04:04:33 ##forth <vms14> now it is cooler
04:04:34 ##forth <vms14> https://imgur.com/cqC4Dx4
04:30:56 ##forth <cleobuline> ForthBot: : test ( n ... 2n ) DUP + ;
04:35:14 ##forth <cleobuline> ForthBot: 2 test .
04:35:15 ##forth <ForthBot> 4
04:38:04 ##forth <cleobuline> ForthBot: LOAD "test.fth"
09:59:01 ##forth <veltas> Not seen siraben around for a while
15:57:26 ##forth <cleobuline> ForthBot: WORDS
15:57:27 ##forth <ForthBot> DP test HELLO DOUBLE FACT POW FIBONACCI COUNTDOWN TUCK 2DROP SUM_SQUARE CUBE SUM_CUBES RECUNACCI CAT :D TRIPLE POW2 TEST-CASE FACTLOOP
15:57:51 ##forth <cleobuline> ForthBot: SEE TEST-CASE
15:57:51 ##forth <ForthBot> : TEST-CASE CASE 1 OF ." UN " CR ENDOF 2 OF ." DEUX " CR ENDOF 3 OF ." TROIS " CR ENDOF ." Others " CR ENDCASE ;
16:03:10 ##forth <cleobuline> https://i.ibb.co/Mkzy1WY8/image.png
16:25:19 ##forth <veltas> Yep I can smell blood in the water today lads
16:28:01 ##forth <cleobuline> oxyde de fer
16:30:54 ##forth <cleobuline> iron oxyd
17:27:12 ##forth <vms14> user51 is your forth going forth?
17:35:37 ##forth <user51> vms14: Can't code much currently, nothing for now.
17:36:33 ##forth <vms14> I think that making your own language, no matter the kind of language or its design, is a very rewarding process
17:37:09 ##forth <vms14> and if you can make the language exactly as you wanted, I guess there is no better language than that
17:37:57 ##forth <vms14> you can choose to simplify things in order to learn and have something working, like focusing on what you want to see
17:39:07 ##forth <vms14> the fact that you are writing in c is also cool, it will have reasonable performance and it will be able to use any c library
17:39:30 ##forth <vms14> which means that you can interact with the system, web services, databases, etc
17:39:39 ##forth <vms14> and even compile it with emscripten
17:40:36 ##forth <vms14> that gives you a language that can do a lot of things
17:41:15 ##forth <vms14> but c is not good for prototyping
17:41:18 ##forth <user51> Honestly one of the bigger issues is that I can see different way sof writing it.
17:41:42 ##forth <vms14> yeah you might have to try several and see which one you like most
17:42:08 ##forth <vms14> in my case for example sticking to a real forth system does not make sense
17:42:28 ##forth <vms14> I'm using perl and js to implement it which come with a gc
17:42:52 ##forth <vms14> and sticking to a real forth will not allow me to take advantage of what they offer
17:43:06 ##forth <xentrac> funny thing, after you make a language exactly as you think you want, you discover it isn't what you actually want
17:43:07 ##forth <vms14> in c you can stick to a real forth somehow
17:43:26 ##forth <xentrac> I feel like C is fine for prototyping, especially for Forth
17:43:50 ##forth <vms14> compared to scripting languages is not
17:44:16 ##forth <vms14> it's better to make a prototype in a language that gives you more abstractions and then port it to c once the design is good
17:44:20 ##forth <xentrac> depends on what you're doing
17:44:22 ##forth <vms14> but more work I guess
17:44:56 ##forth <vms14> for example to make a linked list in most other languages you just type: []
17:45:07 ##forth <vms14> and it has push pop etc
17:45:16 ##forth <vms14> in c you do it yourself
17:45:18 ##forth <user51> My personal issue with one thing being theoretically better is that I make plenty -- heck, more than plenty -- a shameful amount of logic errors.
17:45:20 ##forth <xentrac> JS and Python don't have linked lists; [] gives you an array
17:45:30 ##forth <xentrac> I mean you can implement linked lists in them
17:45:35 ##forth <xentrac> but they aren't a built-in feature
17:45:37 ##forth <xentrac> same with Perl
17:46:55 ##forth <user51> So the language doesn't matter if I write the wrong code :)
17:47:10 ##forth <vms14> it matters how much time did you spend writing the wrong code
17:47:25 ##forth <vms14> because at the end you have to write wrong code to realize it wasn't good
17:48:37 ##forth <xentrac> I don't think it takes significantly more time or code to implement Forth in C than in JS
17:49:49 ##forth <vms14> a real forth does not want to be implemented in js
17:50:53 ##forth <vms14> you will be emulating a vm first or stuff like that
17:51:19 ##forth <vms14> user51 get a simple core and expand in the direction you want
17:51:30 ##forth <vms14> that's the cool thing about making it actually
17:51:40 ##forth <vms14> rpn and the stack simplify a lot of stuff
17:51:49 ##forth <vms14> after that you can do whatever pleases you
17:52:04 ##forth <vms14> like drawing nyan cats
17:52:15 ##forth <user51> But I'd prefer focusing on QOL issues first, like error handling. Things like KEY can be a touch tricky in the terminal, something about cooked or raw, can't remember.
17:52:37 ##forth <vms14> in my case I just took the rpn and the stack, everything else I have taken it from lisp
17:55:21 ##forth <vms14> also the first thing you need to be aware of is that this language is yours and you do not have to comply to anyone
17:55:52 ##forth <vms14> you decide everything and do not have to give explanations to anyone
17:56:40 ##forth <vms14> unless you want to follow a standard
17:57:32 ##forth <user51> I dunno about standards, but it seems reasonable to me that if my program has 'forth' in it, it should probably run 'forth' code you might find on say github.
17:58:03 ##forth <vms14> yeah that would be cool
17:58:51 ##forth <vms14> I'm happy with my abomination though
17:59:02 ##forth <vms14> and I guess a real forth is not what I wanted anyways
18:00:04 ##forth <vms14> in some way I do enjoy the raw memory access and how I can make my own data structures and accessors by just messing with the memory
18:00:08 ##forth <user51> I'm a bit unsure what kind of threading I used, it should be DTC but instead of ENTER I simply checked if the xt offset is greater than a predefined offset for the builtin words.
18:00:26 ##forth <vms14> but on the other hand as long as I have lists and hash tables I can do a lot
18:01:38 ##forth <xentrac> vms14: indirect threaded code is perfectly happy to be implemented in pretty much any language
18:01:41 ##forth <user51> I'd be interested in a stringly-threaded forth as well, which can have its own complications. That might work great in perl, tho.
18:02:03 ##forth <xentrac> a stringly-threaded forth would be easier in Perl than in C for sure
18:02:47 ##forth <vms14> strings would be slow
18:03:05 ##forth <vms14> and they look like a bad hack
18:03:09 ##forth <vms14> a lazy hack
18:04:13 ##forth <vms14> just use pointers to functions and that's it
18:04:43 ##forth <vms14> at the end you could just use a giant switch case
18:04:55 ##forth <vms14> and some bytecode format
18:08:37 ##forth <veltas> I'm not sure you can really call that 'threaded' ;)
18:09:41 ##forth <vms14> if you mean the switch case, it would be called "bytecode interpreter"
18:10:52 ##forth <GeDaMo> Have you seen https://github.com/rswier/c4/blob/master/c4.c ? An implementation of a subset of C
18:10:53 ##forth <vms14> I want to add some string format word that interpolates stuff from the stack
18:12:58 ##forth <GeDaMo> The bytecode interpreter starts at line 475
18:13:04 ##forth <user51> If you're feeling hacky, you can stringify stuff with snprintf and sscanf, that's similar to storing and loading to some degree.
18:19:22 ##forth <vms14> I wonder if use temp vars or just word definitions to alter the behavior of format
18:20:38 ##forth <vms14> newline :separator. => That would set a temp var to the value "\n", then format would use that to join elements of a list: (1 2 3) "~a" format => "1\n2\n3"
18:21:01 ##forth <vms14> but for example I could define a word named iterator that format could use to iterate a list
18:21:46 ##forth <vms14> if I redefine it format will use that new definition
18:22:31 ##forth <vms14> since I have lexical scope I can have children definitions in a word that will only exist there, so that could be used to create those words and when format is executed in his scope will use that
18:23:00 ##forth <vms14> in forth it could be done anywas
18:23:11 ##forth <vms14> anyways*
19:02:44 ##forth <veltas> Okay I've got go-ahead to start recruting for a $200k/year plus benefits Forth role
19:02:47 ##forth <veltas> If only right
19:02:57 ##forth <xentrac> haha
22:13:17 ##forth <veltas> crc: *ListenerAndBuffering has a typo half way "wil do this"
22:13:50 ##forth <crc> Thanks; I'll correct this
22:14:01 ##forth <veltas> No problem
23:06:47 ##forth <veltas> *Numbers typo line c "Number in *Konilo are signed..."
23:11:19 ##forth <veltas> There was a critical error LED that someone missed at work because it was flashing between green and red
23:11:25 ##forth <veltas> And they were colour blind
23:19:13 ##forth <veltas> What does the + mean as a prefix for words in the konilo manual?