2023-11-05 00:26:59 I think that's a very good point. A lot of the time it's "whatever they're ok with you doing." 2023-11-05 00:28:14 One of my peeves with a lot of folks is that they tend to case by case everything, and it winds up being whatever they want on a case by case basis, instead of having a set of core values and trying to live consistently by them, even if they don't match up with your immediate desires. 2023-11-05 00:29:24 Freedom really is a hard thing to define sometimes, because we do have conflicting desires in a lot of situations, such that not *everyone* can get what they want. 2023-11-05 00:30:04 So there's got to be a process for figuring out where we put the limits. 2023-11-05 00:30:26 How we "allocate the dissatisfaction." 2023-11-05 04:39:12 immibis: I don't think it's fair to call them dangerously stupid, even if it seems like they're missing something basic. Just ideological... 2023-11-05 04:39:24 And there are plenty of ideologies out there 2023-11-05 04:39:57 Well what I mean is I've met intelligent people from every ideology who I all think are missing something basic but they're just too committed to their ideas 2023-11-05 04:45:03 And it's basic in my opinion but just not constructive for me to say so 2023-11-05 05:30:22 Test 2023-11-05 05:30:47 ollephone: test received 2023-11-05 05:30:56 Neat :) 2023-11-05 05:33:49 So, problem deciding what to use here. Need a word fn that does two things. 1) parse-name and echoes next token, 2) creates new word from that token which will echo itself when run 2023-11-05 05:34:09 "SectorC: A C Compiler in 512 bytes" https://xorvoid.com/sectorc.html 2023-11-05 05:34:21 But create 0 , parse-name type will run at once 2023-11-05 05:46:24 ollephone: I'm not clear on what you want to do 2023-11-05 05:46:36 The use case? 2023-11-05 05:47:10 No, what you want this word to do 2023-11-05 05:47:13 A word that writes a new php function to file and then also calls that function when called later. 2023-11-05 05:47:38 Calls = output the php code to file that calls it 2023-11-05 05:48:23 So `fn foo` writes `function foo()` and calling `foo` word later writes `foo(...)`. 2023-11-05 05:48:27 Makes sense? 2023-11-05 05:48:40 But foo would be a PHP function? 2023-11-05 05:49:02 Yea but for forth it's just a string. 2023-11-05 05:49:22 Forth generates php code, basically. 2023-11-05 05:49:40 Oh, I think I get you 2023-11-05 05:50:14 Tried using parse-name and evaluate 2023-11-05 05:50:35 But got address errors 2023-11-05 05:51:32 I don't think there's a standard way of creating using a name from a string 2023-11-05 05:52:00 Doesn't have to be standard :) 2023-11-05 05:52:22 Yeah, I'm just thinking about it :P 2023-11-05 05:52:26 Hm will I be disconnected if I lock phone... 2023-11-05 05:52:33 Phone IRC 2023-11-05 05:58:35 Ugh 2023-11-05 05:59:06 you could manipulate >IN 2023-11-05 05:59:34 save >IN , do a parse-name, restore >IN, do a create 2023-11-05 06:00:14 i've never actually done that, i haven't written much actual forth code 2023-11-05 06:00:36 Hmmm will read up on that, thank you! 2023-11-05 06:19:43 https://stackoverflow.com/questions/77425189/create-a-new-word-from-string-on-stack-in-forth/77425607#77425607 2023-11-05 06:26:12 ollephone: this isn't pretty but it seems to work https://ideone.com/y6ala2 2023-11-05 06:29:27 GeDaMo nailed it! 2023-11-05 06:29:53 You'll be remembered in my prayers and mentioned in my blog post :D 2023-11-05 06:53:41 ollephone: I updated with a slightly better version https://ideone.com/y6ala2 2023-11-05 06:56:07 How long does that link live? 2023-11-05 06:56:25 ollephone: not sure, did you see the update? 2023-11-05 06:57:06 Checking 2023-11-05 06:58:02 Copied locally, +1 <3 2023-11-05 07:26:24 veltas: them being dangerously stupid is a fact. Should we censor facts that might hurt dangerous people's feelings? 2023-11-05 07:27:18 KipIngram: this case-by-case thing you describe is extremely obvious in republicans, which is not to say that other people don't do it 2023-11-05 07:27:36 "the only moral abortion is my abortion" 2023-11-05 07:28:22 people who try to "allocate dissatisfaction" based on principles are various flavours of "left" depending on which principles; people who try to allocate dissatisfaction to "anyone but me" are various flavours of "right" depending on which excuse they use for it 2023-11-05 08:48:33 immibis: I disagree, I don't think they're all stupid. I do think they're incorrect. And yes I would recommend thinking about people's feelings, especially if you think they have dangerous ideas. 2023-11-05 08:49:07 They're incorrect because they are stupid. People who aren't stupid don't hold those ideas long-term. 2023-11-05 08:49:40 they are not dangerous in the sense that they'll come murder me if I insult them. They're dangerous in the sense that they cause a long-term collapse of civilization 2023-11-05 08:50:48 Wow what's happening in here XD 2023-11-05 08:55:16 politics 2023-11-05 08:55:23 immibis: hmm? to me USAian politicans look pretty much the same in certain regard that is quite hard for me to put in english 2023-11-05 08:55:41 thrig: lot of ticks 2023-11-05 08:56:23 something that makes your skin itchy and wanting to dose them off 2023-11-05 08:58:50 GeDaMo: Undefined word s, in your latest solution? 2023-11-05 08:59:00 Using gforth 2023-11-05 08:59:43 >in @ create >in ! here bl parse s, 2023-11-05 09:00:37 immibis: I just mean it's easier to convince people if you don't treat them with disdain, even if their ideas are disdainful. But that's just my experience, I suppose it takes all sorts 2023-11-05 09:02:00 olle: Assuming that's meant to put a string in data dictionary area 2023-11-05 09:02:10 Might have different name in gforth 2023-11-05 09:02:33 Hm 2023-11-05 09:02:40 In gforth 0.7.3 it's S, but in yours it might be str, or something 2023-11-05 09:02:54 Not in the word index 2023-11-05 09:02:56 https://gforth.org/manual/Word-Index.html 2023-11-05 09:03:49 2, ? 2023-11-05 09:04:05 or c, ? 2023-11-05 09:05:58 How does that create work in that string of code a few lines back? 2023-11-05 09:06:10 Looks to me like it would create a new >in 2023-11-05 09:06:43 Also, is your >in an actual address? 2023-11-05 09:06:53 Dunno, GeDaMo wrote it ^^ 2023-11-05 09:06:53 It's usually an index into a buffer. 2023-11-05 09:06:59 It's in his last posted link 2023-11-05 09:07:10 Ah, ok; thanks. 2023-11-05 09:10:21 veltas: they can't be convinced 2023-11-05 09:11:30 immibis: I think we all have a very strong tendency to see the bad aspects of those we disagree and the good apsects of those we agree with. 2023-11-05 09:11:45 if you talk to enough of them, you'll learn i'm right 2023-11-05 09:12:19 I think it takes a lot of effort to avoid that. 2023-11-05 09:15:19 KipIngram: Cognitive bias, we judge ourselves by our intentions and others by the consequences of their actions. :) 2023-11-05 09:15:32 Success means I was good, failure means I had bad luck. Etc. 2023-11-05 09:15:59 Ok, my notion that that code was treating >in as an address; i take that back. 2023-11-05 09:16:31 So it seems like it's running create and then restoring >in to what it was previously? 2023-11-05 09:16:56 Oki. I didn't read it yet fully, have to study those words. 2023-11-05 09:17:20 olle: Yes - easy to find something other than ourselves to blame when we mess up. :-) 2023-11-05 09:20:24 ideone.com looks kind of interesting; i haven't seen that previously. 2023-11-05 09:22:09 Hm can I emit the erase-backwards ascii char? 2023-11-05 09:22:25 Isn't that ascii 8? 2023-11-05 09:22:31 08 yes 2023-11-05 09:22:32 8 emit? 2023-11-05 09:22:56 I want to say that's worked for me. 2023-11-05 09:23:10 Yea seems to work \o/ 2023-11-05 09:23:11 or possibly 127, portability varies 2023-11-05 09:23:13 But it's been a while. 2023-11-05 09:23:38 Yeah, I'm not sure that's completely consistent across systems. 2023-11-05 09:24:14 I think in some situations I've had to move the cursor left a char, emit a space, and then move the cursor again. 2023-11-05 09:24:17 most of the complication is around what the backspace or delete keys do 2023-11-05 09:24:37 There's also some variation around 10 and 13; cr / lf. 2023-11-05 09:27:18 Bash/Linux is good enough for me I think 2023-11-05 09:27:53 Me too. :-) 2023-11-05 09:28:09 I doubt I'll ever use another OS willingly. 2023-11-05 09:28:22 Unless it's something I write myself. 2023-11-05 09:28:26 DragonFlyBSD has some neat stuff too 2023-11-05 09:28:38 HAMMER2 etc 2023-11-05 09:29:04 that's fair - I don't really know BSD but I've heard nice things about it. I may be totally wrong but I've always had the impression it's at least "somewhat similar" to Linux. 2023-11-05 09:29:56 I read some about plan9 once and thought it looked "interesting." 2023-11-05 09:30:17 I liked the way it seemed oriented toward distributed computing kind of from the ground up. 2023-11-05 09:31:00 And acme looked like an interesting approach to things. 2023-11-05 09:31:13 KipIngram: If I know the history somewhat correct, Linux would never have happened if FreeBSD had existed earlier. 2023-11-05 09:31:20 Linux is BSD for x86 2023-11-05 09:31:52 I think that was Linus' motivation to start his OS. 2023-11-05 09:32:08 Interesting. I really ought to learn more about that history. 2023-11-05 09:32:16 I know bits and pieces. 2023-11-05 09:32:39 I got on the Linux bandwagon back in 2002 or so. 2023-11-05 09:33:11 I'd left my previous job and was trying some consulting, and I needed a way to run some schematic capture and PCB layout software without having to pay thousands of dollars for it. 2023-11-05 09:33:41 So I kind of hung around Linux during quite a lot of its "growing pains." Watched it become progressively more stable. 2023-11-05 09:34:35 I used Fedora first, moved to Ubuntu for a pretty long period, and now am back to Fedora. 2023-11-05 09:35:01 Just because Fedora was the Linux Lenovo offered as an option when I bought this computer. 2023-11-05 09:35:15 I started my comp sci studies 2007, some used FreeBSD there which I tried. OpenBSD was easier to setup, I think. But Ubuntu is really easy. 2023-11-05 09:35:40 Yes, Ubuntu seems to lead the pack on "turnkey installation." 2023-11-05 09:35:51 But a lot of them are pretty good on that front now. 2023-11-05 09:36:00 Seems so 2023-11-05 09:36:05 I run Armbian on my RockPro64 2023-11-05 09:36:12 Solid stuff 2023-11-05 09:36:13 At work I've used Rocky Linux most recently. 2023-11-05 09:36:22 Which i think is what used to be CentOS. 2023-11-05 09:38:20 GeDaMo: Btw another user on stackoverflow used <# #> for a similar solution 2023-11-05 09:38:37 https://stackoverflow.com/a/77425607/2138090 2023-11-05 09:38:46 olle: I actually was writing my own s, until I noticed that my gforth (0.7.3) already has one 2023-11-05 09:38:56 Strange 2023-11-05 09:39:03 Somehow I've always gravitated away from using the typiCAL <# # #> words in my number conversions. 2023-11-05 09:39:37 KipIngram: >in is a standard variable with the offset into the input buffer 2023-11-05 09:39:50 I usually wind up with NUMBER itself being the "callable" there, with everything below it just helper words that I prune out of the dictionary once I get NUMBER compiled. 2023-11-05 09:39:55 Yes. 2023-11-05 09:40:17 Which might be "TIB" or might be a disk buffer. 2023-11-05 09:41:42 The historical pattern has been for BLK to contain 0 if you're parsing from TIB and the block number otherwise. I've thought about changing that to an address instead of a block number, to allow parsing from arbitrary buffers (not just disk buffers). 2023-11-05 09:42:23 olle: https://forth.sourceforge.net/mirror/comus/index.html#string, 2023-11-05 09:42:25 I.e., you'd be able to just INTERPRET. 2023-11-05 09:43:52 GeDaMo: I don't see s, there? 2023-11-05 09:43:59 It's called string, there 2023-11-05 09:47:35 GeDaMo: Oh! 2023-11-05 10:34:02 vocabulary pushes nothing on the stack? Boooo. 2023-11-05 10:41:57 How do I find a word list after it's been popped from the order stack? o0 2023-11-05 11:00:08 Why do I need to run `previous` twice to pop the latest wordlist? 2023-11-05 11:01:44 Weird 2023-11-05 11:14:24 Usually vocabulary words just add themselves to the beginning of your search order. 2023-11-05 11:15:06 You just have to know what your vocabulary names are, same as you need to know the names of other words to execute them. 2023-11-05 11:16:02 I'm thinking about auto-complete functionality on this next system; Forth is well-situated to offer that. 2023-11-05 11:19:08 Hm 2023-11-05 11:19:54 As you type it can just find all the words in the search order that start that way, so it's always got an "autocomplete set." 2023-11-05 11:20:08 You'd just have to decide how you wanted the interface to work. 2023-11-05 11:20:29 Most Forth's don't start searching until it's got the whole word, but there's no reason you couldn't search incrementally. 2023-11-05 11:20:51 Although that wouldn't work well for hash-based search. 2023-11-05 11:21:07 Is this largely correct? https://stackoverflow.com/questions/77426417/how-do-i-use-the-vocabulary-in-forth/77426584#77426584 2023-11-05 11:21:17 My plan, though, is to support simple linear search with a potential hash "add on." 2023-11-05 11:22:18 Um, I don't know gforth really well, but I'd say that looks "largely" correct. 2023-11-05 11:22:38 I usually don't require an explicit "add to search order" word like also; in my system just the voc name alone does that. 2023-11-05 11:22:59 But that does leave me with what you were complaining about earlier - voc words leave nothing on the stack. 2023-11-05 11:23:07 Mm 2023-11-05 11:23:59 Sometimes you have the word ONLY, which will remove everything in the search order below the top item. 2023-11-05 11:24:16 And there's always the issue of whether or not it's possible to truly remove the FORTH vocabulary. 2023-11-05 11:24:47 I've always felt like it should be possible, so that you can create "locked down' system that only respond to a chosen set of application commands. 2023-11-05 11:25:51 As noted on other occasions, Forth lets you do "anything," but sometimes you might like to restrict users to a very limited environment. 2023-11-05 11:26:07 Do that right and you can make bulletproof systems. 2023-11-05 11:26:21 Or, applications rather. 2023-11-05 11:27:02 You might include a "secret" word that a tech support person could use to re-enable the full functionality. 2023-11-05 11:44:34 enable or sudomakemeasandwich or something like that 2023-11-05 11:52:56 Yeah. All it would do is just add Forth back to the vocabulary list. :-) 2023-11-05 12:08:23 KipIngram: `seal`? 2023-11-05 12:12:04 You're suggesting that as a word to do that locking down I described? 2023-11-05 12:12:22 I like that for that purpose. 2023-11-05 12:13:24 I'd have to be careful doing that in my system, because the correct operation of my interpreter relies on being able to find a particular word in the search order. It's the word with a zero-length string as its name - the "null" word. 2023-11-05 12:13:44 Execution of that word is what breaks INTERPRET out of its infinite loop when it reaches the end of a string. 2023-11-05 12:14:20 So if I wanted to seal myself into a single vocabulary I'd need to make sure that the null word existed in that vocabulary. 2023-11-05 12:47:59 Can I introspect the "type" of the first stack item? 2023-11-05 12:49:29 It's a cell 2023-11-05 12:51:52 Hm 2023-11-05 12:51:57 Cell or number 2023-11-05 12:52:02 integer* 2023-11-05 12:52:26 natural number* 2023-11-05 12:52:31 or? 2023-11-05 12:52:39 Nop, negative numbers too :) 2023-11-05 12:52:46 a cell 2023-11-05 12:52:46 A cell is a cell :P 2023-11-05 12:53:41 Bah 2023-11-05 12:54:44 olle: Just a 'word', but 'word' has been corrupted to mean all sorts so 'cell' is a good alternative name 2023-11-05 12:54:57 i.e. like a processor word 2023-11-05 12:55:06 and you can use the word TYPE 2023-11-05 13:01:01 No manual entry for gforth 2023-11-05 13:01:05 Seriously? 2023-11-05 13:01:07 ACTION gotta go 2023-11-05 13:03:08 olle: you can use see to show the definition of a word 2023-11-05 13:03:18 LOCATE is better in new gforth 2023-11-05 13:03:30 Get a copy of standard for standard words like TYPE 2023-11-05 13:03:57 ANS Forth: https://www.openfirmware.info/data/docs/dpans94.pdf 2023-11-05 13:04:29 Or checkout and build latest 200x standard here https://github.com/Forth-Standard/forth200x 2023-11-05 13:06:00 Careful, that repo is designed to suck your soul out through your nose 2023-11-05 13:06:25 https://raw.githubusercontent.com/Forth-Standard/forth200x/master/basis/forth.pdf 2023-11-05 13:06:44 Recentish snapshot of Forth 200x 2023-11-05 14:15:46 olle: In basic Forth there really are no types. 2023-11-05 14:16:26 At best you have cells, half cells, etc. - for 64 bits it would be cell, half, word, char/byte. 2023-11-05 14:16:43 And those are relevant because you have variations on ! and @ that work on the different sizes. 2023-11-05 14:16:59 ! h! w! c!, @ h@ w@ c@ 2023-11-05 14:17:06 woe betide getting them wrong 2023-11-05 14:17:13 Indeed. 2023-11-05 14:17:20 This looks like a good video; 2023-11-05 14:17:23 https://www.youtube.com/watch?v=eRzyXg5tWzY 2023-11-05 14:17:39 Gets at the stuff re: dimensional analysis I've complained doesn't get taught well enough anymore. 2023-11-05 14:18:45 olle: I want to do something about the type situation in my next system. I don't plan anything for when the system first starts up, but I want easy to use layers that give me some sort of reasonable type structure. 2023-11-05 14:19:12 I might think about supporting strings out of the box. 2023-11-05 15:32:10 The easiest way to avoid mixing up different data sizes is to not use different data sizes 2023-11-05 18:11:48 Hard to argue with that. 2023-11-05 18:13:15 I was being silly and using an 8-bit rng. one that is the native cell size would probably make more sense 2023-11-05 18:13:19 You know, I understand why the West could feel a need to defend Taiwan against a Chinese invasion - 68% of world semiconductor chips come from Taiwan, and 90% of the fanciest stuff. But China buys that stuff too, and I haven't figured out yet why China actually would risk full scale war to take control of a piddly little island. 2023-11-05 18:13:31 If it's just "pride,' well, that idiocy. 2023-11-05 18:15:07 taiwan was at some point part of china therefore blah blah blah 2023-11-05 18:15:20 Yes, granted. But... so? 2023-11-05 18:15:41 From their side it just looks like a big posturing match. 2023-11-05 18:15:56 I see no economic interest in it. 2023-11-05 18:16:42 And the US is well-positioned (and getting better positioned all the time) to blockade China's imports of oil, food, etc. 2023-11-05 18:17:20 social primates social 2023-11-05 18:17:36 Obviously both countries could just ruin one another, but I'm assuming we'd both refrain from mainland attacks against the other, precisely because of how badly that would end. 2023-11-05 18:17:59 :-) Primates gonna primate... 2023-11-05 18:18:12 Honestly that's how it feels sometimes. 2023-11-05 18:19:38 usually instead you get proxy wars 2023-11-05 18:19:45 Yeah. 2023-11-05 18:20:54 I just learned yesterday that both Russia and Ukraine are in danger of running out of materiele, so Russia's looking at tapping North Korea and Ukraine South Korea (indirectly for now). Turns out the Koreas have been hoarding military stockpiles as hard as they can for like 70 years. 2023-11-05 18:21:10 They're practically drowning in artillery shells, bullets, etc. 2023-11-05 18:22:16 I haven't paid attention to such things in years - it's gotten awfully convoluted and complex. 2023-11-05 18:22:24 technically the korean war never ended 2023-11-05 18:22:48 Same with Taiwan and China. 2023-11-05 18:23:02 Both governments claim to the the legitimate government of all of China. 2023-11-05 18:23:45 Apparently South Korea wants the US to put nuclear weapons back on their territory. 2023-11-05 18:26:12 nuclear weapons should not exists 2023-11-05 18:45:27 Tough question. We don't know what the last 80 years would have been without them. 2023-11-05 18:45:49 How many more conventional world wars might have happened? 2023-11-05 18:46:04 Could have gone either way. I agree with you, aside from that unknown. 2023-11-05 18:46:16 But Pandora's box always gets opened. 2023-11-05 18:46:44 You wind up having to try to open it before your enemies do. 2023-11-05 19:34:49 ACTION notes https://www.openbios.org/data/docs/of1275.pdf down in the public logs of this channel 2023-11-05 19:59:11 Oh, that looks worth noting down. 2023-11-05 20:02:19 Great place for a Forth presence - Forth is so small you can tuck it in almost anywhere. 2023-11-05 20:08:18 alas intel went uefi 2023-11-05 20:57:05 Alas indeed. 2023-11-05 20:57:14 That would have been a real shot in the arm for Forth. 2023-11-05 21:08:22 So, I think my next TV show re-watch will be Castle. I remember really enjoying that. 2023-11-05 21:11:08 I thought the two of them played off of one another just perfectly. 2023-11-05 21:51:22 Correct me if I'm wrong, but apart from passing a negative number to `ALLOT`, there's no way to 'free' memory in any existing Forths, is there. 2023-11-05 21:52:12 (Or using `MARKER`, etc.) 2023-11-05 21:56:26 you FORGET something 2023-11-05 21:57:20 I thought FORGET was obsolete. 2023-11-05 22:20:00 Well, it's "not in the standard." 2023-11-05 22:20:09 But some things never die... 2023-11-05 22:20:34 More modern Forths support a mechanism called "markers." 2023-11-05 22:20:51 you set a marker, and executing it later will trim the dictionary back to there, so it also does free memory. 2023-11-05 22:21:19 I guess if you want to be pedantic then whenever you pop the stack or return from a called word you free memory. 2023-11-05 22:21:28 But that's not quite what you're talking about. 2023-11-05 22:22:07 MARKER ALPHA 2023-11-05 22:22:09 ... 2023-11-05 22:22:11 ... 2023-11-05 22:22:13 ALPHA 2023-11-05 22:25:13 I'm not sure exactly what the reasoning behind the FORGET -> MARKER change was. 2023-11-05 22:25:58 Maybe in order to do a completely proper restoration of everything you need to save some information, and the marker provides a place to do that. 2023-11-05 22:26:20 Whereas FORGET really only lets you restore DP / HERE and you have no information about anything else that might need doing. 2023-11-05 22:27:03 Like perhaps you also want to restore the search path, CURRENT vocabulary, etc. 2023-11-05 23:00:11 https://www.irccloud.com/pastebin/DvBVR247 2023-11-05 23:00:44 extract from ans appendix on marker 2023-11-05 23:56:43 Ah, thank you. Yes, that's saying more elegantly what I was trying to say. MARKER can allocate space as needed to store state information required for a clean forget.