2025-02-19 07:43:53 !gforth 1 2 + . 2025-02-19 07:43:53 3 2025-02-19 07:45:21 !gforth : TEST 10 0 DO CR ." Hello " LOOP ; TEST 2025-02-19 07:45:25 https://0x0.st/8b6r.txt 2025-02-19 07:45:56 the first line was just "\r" that's why it didn't print it 2025-02-19 10:14:41 !gforth 1 1 2 2 D2 .s 2025-02-19 10:14:59 !gforth 1 1 2 2 D+ .s 2025-02-19 10:15:00 <2> 3 3 2025-02-19 10:15:17 !gforth 1 2 3 4 D+ .s 2025-02-19 10:15:18 <2> 4 6 2025-02-19 10:15:30 !gforth 1 2 3 4 D* .s 2025-02-19 10:21:54 !gforth VARIABLE DATE @ . 2025-02-19 10:22:36 !gforth VARIABLE DATE ; 12 DATE ? 2025-02-19 10:27:05 is the variable we define using VARIABLE word stored in heap? 2025-02-19 10:27:23 I am confused because they don't specified where it gets stored 2025-02-19 10:27:37 currenly reading this: https://www.forth.com/starting-forth/8-variables-constants-arrays/ 2025-02-19 10:34:04 oh wait 2025-02-19 10:34:10 I found the answer 2025-02-19 10:34:19 it's stored as a WORD 2025-02-19 10:34:25 sorry for the dumb question 2025-02-19 10:45:11 The main allocation in Forth is dictionary allocation 2025-02-19 10:45:46 Which is basically like a stack allocation, either advancing HERE to allocate, and retreating HERE to deallocate 2025-02-19 10:46:02 With words like ALLOT , and defining words like CREATE VARIABLE : 2025-02-19 10:54:24 -100 allot 2025-02-19 10:57:21 veltas: I see thank you for the reply 2025-02-19 10:57:28 !gforth -100 allot 2025-02-19 10:57:37 !gforth HERE . -100 allot HERE . 2025-02-19 10:57:37 125616817271952 125616817271852 2025-02-19 10:57:57 hmm so it decremented HERE by 100 2025-02-19 10:58:10 !gforth HERE . 100 allot HERE . 2025-02-19 10:58:10 123965385569424 123965385569524 2025-02-19 10:59:26 That's how things like MARKER work 2025-02-19 10:59:51 Remember the value of HERE then restore it to 'forget' definitions since 2025-02-19 11:01:26 I see 2025-02-19 11:01:52 !gforth HERE . CREATE MY-VARIABLE 20 ALLOT HERE . 2025-02-19 11:01:52 123951286416528 123951286416596 2025-02-19 11:03:56 !gforth marker gedamo : test ." a test" ; test 2025-02-19 11:03:57 a test 2025-02-19 11:04:05 !gforth gedamo test 2025-02-19 11:04:31 yeah, if you -100 allot, you are deallocating the last 100 bytes of the dictionary 2025-02-19 11:04:40 so the next few definitions you make will overwrite them 2025-02-19 11:04:43 Did I break it? I expected an error :| 2025-02-19 11:04:55 !gforth 3 4 + . 2025-02-19 11:04:55 7 2025-02-19 11:05:19 Maybe the bot isn't capturing stderr? 2025-02-19 11:05:41 probably gforth will crash eventually if you deallocate 100 bytes of random things. but it's perfectly fine if you just did create foo 200 allot 2025-02-19 11:06:07 GeDaMo: yeah, it silently fails, I will fix it ASAP 2025-02-19 11:06:27 It's OK, I was just worried I broke it :P 2025-02-19 11:06:43 !gforth HERE . create foo 200 allot HERE . 2025-02-19 11:06:43 139956823880848 139956823881088 2025-02-19 11:07:05 see, now you can safely -100 allot 2025-02-19 11:07:16 and foo will be an array of 100 bytes instead of 200 2025-02-19 11:07:23 !gforth see allot 2025-02-19 11:07:25 https://0x0.st/8blo.txt 2025-02-19 11:07:30 I expect the difference of the values of HERE should be 200 but it's more than 200 2025-02-19 11:08:21 well, once you create foo, you are advancing here by enough space for the header of foo 2025-02-19 11:08:41 ohk so total size would be 200 + header size 2025-02-19 11:08:43 I see 2025-02-19 11:08:56 !gforth 139956823880848 dup 139956823881088 200 - swap - dump 2025-02-19 11:09:11 !gforth 139956823880848 dup 139956823881088 200 - swap - . . 2025-02-19 11:09:11 40 139956823880848 2025-02-19 11:09:20 40 bytes apparently 2025-02-19 11:09:30 the header size if 40 bytes 2025-02-19 11:09:32 !gforth 139956823880848 dup 139956823881088 200 - swap - type 2025-02-19 11:09:34 s/if/is 2025-02-19 11:09:52 I was trying to see those 40 bytes but I'm doing something wrong 2025-02-19 11:10:02 You could use dump 2025-02-19 11:10:52 I tried that without any luck 2025-02-19 11:11:02 dp @ 100 - 16 dump 2025-02-19 11:11:03 !gforth dp @ 100 - 16 dump 2025-02-19 11:11:04 https://0x0.st/8blX.txt 2025-02-19 11:12:44 seems like maybe there are some problems with the output 2025-02-19 11:13:26 yes, when the first char is \r it doesn't print any value 2025-02-19 11:13:29 eg, 2025-02-19 11:13:42 !gforth CR ." hello world" 2025-02-19 11:13:43 https://0x0.st/8blK.txt 2025-02-19 11:13:47 xentrac: see 2025-02-19 11:14:25 !gforth 10 emit ." hello world" 2025-02-19 11:14:26 https://0x0.st/8blK.txt 2025-02-19 11:14:31 or \n 2025-02-19 11:19:53 btw a convention I didn't know about in Forth is that normally cr comes at the beginning of a line rather than, as in Unix, its end 2025-02-19 11:21:07 :o 2025-02-19 13:02:50 veltas: I'll try to look at the patches tonight or tomorrow (been travelling for work, so am away from my dev box w/X11 at present) 2025-02-19 13:20:00 xentrac: Yes, and getting your Forth system to do that (under an OS) requires some definite mucking about. When my system starts up I save my current termios and make some changes on that front, then restore the termios on exit. The default in Linux is that once you call for keyboard input you don't get control back until the user hits Enter, and by then the system has already done the CR so 2025-02-19 13:20:03 you're down on the next line. 2025-02-19 13:20:52 So in that setup your output will be on the line after your input. You have to change things to take more control if you want that otherwise. 2025-02-19 13:23:00 I wanted to receive input character by character, and I also disabled a number of things like ctrl-c break. 2025-02-19 13:23:24 As much as I could arrange I wanted ctrl- to just return an ascii code like everything else. 2025-02-19 13:24:23 I think ctrl-v may be the only one I'm missing. 2025-02-19 13:24:41 Because my terminal emulator uses it for paste. 2025-02-19 13:27:08 Maybe there's an option to change that? My terminal emulator uses shift+ctrl+V 2025-02-19 13:28:28 Yes, I could if I wanted to. But I'm pretty used to it - shift-ctrl-v introduces friction into my other work. 2025-02-19 13:28:35 I keep forgetting. :-( 2025-02-19 13:29:24 I tend to use the mouse for pasting :P 2025-02-19 13:29:29 But if I ever start using my Forth more than doing other things I'll likely change it. 2025-02-19 13:29:37 I do an awful lot in the console. 2025-02-19 13:30:53 In the Forth env, though, I just wanted to purge as many aspects of the underlying OS as possible. 2025-02-19 13:33:57 #guile 2025-02-19 13:36:13 keeping os dependencies minimal is good :) 2025-02-19 13:51:45 No worries crc, no rush or even any need, it's all there if you want it 2025-02-19 13:52:01 I don't expect you to integrate it, you might not care about SDL anyway 2025-02-19 13:52:05 Just sharing in case it was interesting 2025-02-19 14:13:11 !gforth cell . 2025-02-19 14:13:12 8 2025-02-19 14:16:51 I care about the SDL version since it gives me a fairly easy path to graphics in systems w/o X11 (mainly Windows, macOS, and Haiku, for me) 2025-02-19 14:46:02 I think keyboard events still need some work to not respond inappropriately to the Alt or other Mod keys 2025-02-19 14:46:10 But I leave that as an exercise for the reader 2025-02-19 14:46:40 I think the conditional just needs more comparisons 2025-02-19 14:48:10 do we have some kind of game or program that uses forth as a configuring language like we have Elisp in Emacs 2025-02-19 14:51:02 I guess Open Firmware 2025-02-19 14:51:12 Closest thing I can think of 2025-02-19 14:52:39 I feel like there were a few video games on older home computers 2025-02-19 15:03:37 GeDaMo: that's looking awesome! 2025-02-19 15:03:54 veltas: I can't use it though :-( 2025-02-19 15:04:22 There's also the Canon Cat 2025-02-19 15:05:26 this one? https://en.wikipedia.org/wiki/Canon_Cat 2025-02-19 15:05:42 Yeah 2025-02-19 15:06:09 https://archive.org/details/jefraskin 2025-02-19 15:07:28 I don't feel like having a few assembly words really means you're not still working with Forth - writing critical words in assembly is just "part of how Forth works." 2025-02-19 15:07:52 I mean, I expect what they really mean is that they added some custom primitives to their Forth, right? 2025-02-19 15:08:06 http://oldvcr.blogspot.com/2024/07/pretty-pictures-bootable-floppy-disks.html 2025-02-19 15:08:18 KipIngram: I expect so 2025-02-19 15:09:22 GeDaMo: thank you for the links! 2025-02-19 15:09:27 :) 2025-02-19 15:09:52 I just installed a couple of Python packages (opencv and mediapipe) and ran a little demo I got online. It opened a window with my webcam image. Whenever I hold my hand up in front of it, it slaps a wireframe image onto my hand that tracks the motions. Works extremely well - I was impressed given how easy it was to put together. 2025-02-19 15:10:51 It tracks 21 location in each hand, and you can do whatever you like with that information. 2025-02-19 15:11:07 There was a hardware synthesizer add-on for the BBC micro which had a stack language called AMPLE 2025-02-19 15:11:24 I was mulling over the possibilities of a hand motion UI and just decided to poke around to see what's out there. 2025-02-19 15:11:33 http://colinfraser.com/m5000/m5000.htm 2025-02-19 15:23:30 GeDaMo: I was more trying to answer the question 2025-02-19 15:23:35 About configuring 2025-02-19 15:23:47 I know, I just like linking things :P 2025-02-19 15:27:35 But Forth I would say is adequate for configuring 2025-02-19 15:32:09 Link addiction - serious business. 2025-02-19 17:10:52 GeDaMo is the linkmeister 2025-02-19 17:10:52 And the URLbudsman 2025-02-19 17:12:34 he is 2025-02-19 17:12:50 he is my target audience for a bookmark page I want to create 2025-02-19 17:48:47 Heh. Urlbudsman - that's great veltas. 2025-02-19 17:49:15 Oh, wait - vms14. 2025-02-19 17:49:22 Ooops. :-| 2025-02-19 17:49:36 No, I was right to start with. Geez. 2025-02-19 18:08:50 I have days like that 2025-02-19 18:20:26 I was on a work phone call at the time, so I plead distraction. 2025-02-19 19:38:02 I have to admit the first few times someone mentioned the canon cat here I thought they meant this thing https://en.m.wikipedia.org/wiki/CueCat 2025-02-19 19:39:24 KipIngram: I imagine they weren't coding custom primitives but instead writing whole functions in assembly. That's what the 6502 forth guys talk about and what C programmers did before compilers got better 2025-02-19 19:45:51 I still write whole functions in assembly 2025-02-19 19:46:13 there's lots of whole functions in Linux and glibc written in assembly 2025-02-19 19:46:31 but sure, inline asm is probably more common nowadays 2025-02-19 19:48:48 a lot of people seem to like inline assembly which I never quite got since it seems to go wrong a lot when you embed it in a C function. a separate function seems much easier 2025-02-19 20:12:26 But those show up as words, surely? 2025-02-19 20:12:56 I'm just using "primitive" to mean a dictionary word written in machine code. 2025-02-19 20:13:04 I.e., "not a definition." 2025-02-19 20:13:18 well, a definition, just not a colon definition. 2025-02-19 20:13:28 That's fair. 2025-02-19 20:13:53 CODE words, a lot of the older literature calls them. 2025-02-19 20:14:27 I've seen them called "definitions" and "primitives" at least here and there. I grant, though, that anything that's in a dictionary should really be thought of as a definition. 2025-02-19 20:14:47 Slang has a way of creeping in, though. 2025-02-19 20:15:19 Like calling a copy machine a "xerox machine" even if it's not a *Xerox* machine. 2025-02-19 20:15:40 When I was a kid it was common where I grew up to use "coke" to mean "soda." 2025-02-19 20:16:28 in spain there is no term for soda 2025-02-19 20:16:37 Oh, that's fun. 2025-02-19 20:17:00 Then I went to college and the dude from Michigan in the dorm room next to mine called it "pop." 2025-02-19 20:17:03 we named it coke "coca-cola" is the spanish name actually 2025-02-19 20:17:39 Yeah, if someone said coca-cola, then that meant that specific one. 2025-02-19 20:17:47 No one used that generically. 2025-02-19 20:18:05 'baking code' definietly sounds more dangerous than useful 2025-02-19 20:18:20 we tend to use trademarks to name things 2025-02-19 20:18:42 Yeah, when there's a particularly dominant company in a tech's early period. 2025-02-19 20:19:25 now that i tihnk about it, rc cola might be release canditate coca cola :D 2025-02-19 20:19:35 Photocopiers were already fairly entrenched by the time I was old enough to notice, but I bet they really seemed incredible to people when they first appeared. 2025-02-19 20:19:39 Magic. 2025-02-19 20:20:11 for example white loaf bread is called "bimbo bread" 2025-02-19 20:20:34 :-) 2025-02-19 20:20:41 ("Bimbo" is a brand) 2025-02-19 20:20:47 yeah 2025-02-19 20:20:59 (it's not a reference to stupid women) 2025-02-19 20:21:06 but we do not have a term for while loaf bread 2025-02-19 20:21:20 white* 2025-02-19 20:22:21 well not true 2025-02-19 20:22:27 KipIngram: a lot of tech stuff can be incredible at first when it removes a constraint.. i used to burn cd drives, but when i got my first usb drive i was a amazed, easily portable AND rewriteable? holy cow! 2025-02-19 20:22:29 "pan de molde" is the term 2025-02-19 20:23:49 KipIngram: transferring stuff through sshfs was also incredible at first 2025-02-19 20:24:33 oh, and using a scripting language after starting with c :) 2025-02-19 20:26:36 I didn't know that soda spans for more drinks than coke so I was spreading missinformation :/ 2025-02-19 20:41:39 veltas: I'm having trouble applying the patches; can you pastebin or email me the full file? 2025-02-19 20:44:40 "coke" in parts of the US is used to mean the whole range of "soda" 2025-02-19 20:45:03 "What kind of coke do you want, hon?" "Sprite?" "Sure thing!" 2025-02-19 20:47:41 Yeah, I'm from one of those. 2025-02-19 23:27:23 crc: https://pastebin.com/raw/pqHWCu1V 2025-02-19 23:59:42 MrMobius: I do agree, easier to write a separate assembly function than inline