2024-01-15 02:17:13 It's been quite a number of years since I've actually had to fit something into a confined space. and even then it was usually not the REALLY small devices. 2024-01-15 02:44:11 it's not just about saving space. it's about not shipping code that isn't relevant to the application 2024-01-15 02:45:44 if a word is defined twice and only the second definition is needed, why would i want to deploy the first one? 2024-01-15 05:31:05 Sure, I get that. Generally speaking, why deploy code used for compiling code when all you need to ship is the compiled code? When Forth was invented it had a particular puspose in mind. It was intended to be as much an operating system as an application. 2024-01-15 05:34:56 If you're wanting to deploy a self-contained stand-alone application, then a different tool approach is in order. 2024-01-15 05:35:06 One more like mecrisp-across. 2024-01-15 05:35:37 Which gives you all of Forth's OS-like features while you're developing, but then will burn just your code, well-optimized, to the target device. 2024-01-15 06:02:38 So the idea is that you do need all of that code, because it's assumed you'll be doing what the system was intended to do. 2024-01-15 14:39:23 Also, regarding the renaming of a word, the definitions compiled using the first definition of the word still need that definition; it's only the header part that becomes no longer useful. We can assume that first definition did get used, or else it wouldn't have been included at all. 2024-01-15 14:40:23 The basic point still remains, though - if your end goal is to run a small application that doesn't use the main resources of the system, then those resources do represent overhead if they remain present. 2024-01-15 14:54:22 "We can assume that first definition did get used, or else it wouldn't have been included at all." -- nope. i'm planning to have an include system where you can write a portable common version of a library, then refine it with a target overlay which can redefine some words with implementations more optimized for the given target 2024-01-15 14:55:57 or it could have been a word that was only used by the interpreter before redifinition 2024-01-15 14:58:06 I see. Ok. If the new definition is an improved version of the old one that does the same thing, then it would be nice to have a way to get old definitions to use the new code. 2024-01-15 14:58:25 I can do that in my current system if I want to, but I can't recover the space the old definition consumed. 2024-01-15 14:59:00 It doesn't happen by default if I just colon-define a new version, but it's not terribly hard to make it happen. 2024-01-15 15:03:35 That would be a neat capability for bringing up new platforms - you could begin with a version of things that was a portable as possible, but perhaps not terribly performant. Then you could gradually replace inefficient words with new efficient definitions, after you were running on the new platform. 2024-01-15 15:03:53 Of course, that does imply your system on the new platform has all the edit and compile tools. 2024-01-15 15:12:05 "then it would be nice to have a way to get old definitions to use the new code." no, i don't plan to support that 2024-01-15 15:13:12 Ok. In my system it just means changing the pfa pointer in the word's header. Compiled references to the word work through that pointer, so if I modify it it affects everything. 2024-01-15 15:14:36 https://github.com/AntonErtl/garbage-collection 2024-01-15 15:14:39 gc in forth :) 2024-01-15 16:19:55 oh no! not a library! keep it away :P 2024-01-15 16:26:24 Hm? 2024-01-15 16:48:06 "When Forth was invented it had a particular puspose in mind. It was intended to be as much an operating system as an application." -- i still don't fully grok this, despite all that i've read about forth's history 2024-01-15 16:48:52 how would you save code? how would you recover space for code you didn't want anymore? 2024-01-15 16:50:21 i've read liz rather and CM anecdotes about what a joy it was to develop software directly on the target system, gettig to change things in place, but i've never seem them talk about back-patching previous definitions 2024-01-15 16:51:04 which means when you define something new, you have to redefine everything that depends on it before you see it take effect 2024-01-15 16:51:48 which, in my mind, is the same thing (or worse, even) than just editing a source file and recompile 2024-01-15 16:53:14 Well, I'm not "expertly familiar with Chuck's early work, but as far as I know he saved source code in disk blocks, which he could compile using the LOAD word. 2024-01-15 16:53:59 If you didn't want a particular batch of source on disk anymore, you'd just manually use those block for something else. The user did all the block number allocation and management themselves, manually. 2024-01-15 16:54:34 filesystems were "controversial" around the time when "Starting Forth" was written 2024-01-15 16:54:56 As far as compiled code in RAM goes, he had the FORGET word. FORGET would prune the dictionary back to where it was just before that word was defined. 2024-01-15 16:55:31 You can use defer to enable redefining of words in place 2024-01-15 16:55:42 It's hard to overstate how "minimalist" Chuck is. 2024-01-15 16:56:15 At the time disks were small, so he'd only have a few hundred 1kb blocks on a disk. Not terribly hard to make a manual plan for managing that. 2024-01-15 16:58:52 so when he sat down to move a telescope or whatever, did he type "2 load 5 load ..." every time? 2024-01-15 16:59:08 how did it work when he was't around? 2024-01-15 17:00:28 when you guys use forth, how are you using it without the features i described yesterday? 2024-01-15 17:01:25 are all of your applications only interpreted, or if you're targetting something embeddded, do you just centrally manage the entire code base and so it all goes to the target? 2024-01-15 17:05:19 in practice, a lot of people store the text on their PC and just retransmit the whole thing as necessary 2024-01-15 17:05:42 you can still test new words but then you need to copy them to your text file when youre done 2024-01-15 17:06:00 I mean you can still test new words interactively 2024-01-15 17:07:13 right. so in that case, for a given project, you centrally manage your entire codebase, so if some module has a word you don't need, you just delete it from your source 2024-01-15 17:10:56 maybe i would be happier with this if i could convince myself to move to that sort of development model 2024-01-15 17:17:05 i have such a long history with c, it's difficult for me to break the habbit of wanting to write everything modular and portable. but now i'm starting to rethink everything. maybe i should just plan to have a new forth compiler and completely new codebase for everything i ever do... 2024-01-15 17:17:21 Usually you set it up so you just say 1 LOAD. 2024-01-15 17:17:36 Block 1 then loads other things - it nests. 2024-01-15 17:18:15 and if you like you can write the system to do 1 LOAD automatically. 2024-01-15 17:18:51 Often the core system won't even include the whole language; the missing parts get loaded from source at startup. 2024-01-15 17:19:42 On my next system I plan to put each vocabulary in its own RAM region, so I'll be able to load stuff, use it, and then discard it if it's no longer needed. 2024-01-15 17:20:10 Historically that wasn't done - there was just one big glob of ram and it was managed "linearly." 2024-01-15 17:20:47 It's common practice to make block 1 kind of a "directory" that's human readable and documents your disk usage plan. 2024-01-15 17:27:10 Just to be clear, I think this was fine for the old floppy disk days, but the size of modern drives makes it pretty non-feasible. I think at least a simple file system is a fairly important thing to have these days. 2024-01-15 17:27:32 Most Forth systems just give you some sort of access to the underlying OS file system. 2024-01-15 17:28:43 I'm planning a "real" native file system, though - the idea is for it to initially be pretty much as simple as possible, but with hooks for improving its performance later. 2024-01-15 17:30:26 Someday I hope to build a full computer system with mass storage built out of NAND flash chips. 2024-01-15 17:30:42 I've learned a few tricks at work over the years. 2024-01-15 17:44:48 that kind of stuff is how they did it originally and is still interesting to think about of course. these days, you can just put it all in text files 2024-01-15 17:45:02 just FYI since beginners dont always get that blocks are not inextricable from forth 2024-01-15 17:45:38 Yeah, if you're never planning to be out from under an OS you can take that path. 2024-01-15 17:48:02 The real painful part of thinking about building my own system is how complex interfacing the outside world has gotten. 2024-01-15 17:48:31 Just to get a basic browser operational is such a big job. 2024-01-15 17:53:47 BBS 2024-01-15 17:53:54 That French thing 2024-01-15 17:54:05 https://en.wikipedia.org/wiki/Minitel 2024-01-15 17:55:59 Is that still operational? 2024-01-15 17:56:19 I don't expect IRC and that sort of thing to be much of a problem. 2024-01-15 17:56:37 I mean, I don't know if it'll be EASY, but I figure it's within reaosnable reach. 2024-01-15 18:51:12 I think IPfs is something worth integrating into as well. 2024-01-15 18:51:35 And probably Gopher and all the other similar "primitive systems" that still have a footprint out there. 2024-01-15 18:57:19 ACTION likes gopher 2024-01-15 19:01:13 I rather like it too, though I've only explored it "lightly." 2024-01-15 19:01:51 I definitely think it's worth keeping such things around, because if we ever did have some sort of really bad situation, they're the things we could bring back online fastest. 2024-01-15 19:02:11 And they would be useful for getting the world back up on its feet. 2024-01-15 19:02:17 I feel the same way about ham radio. 2024-01-15 19:02:44 I mean, it's pretty pointless except as a hobby, given the internet. But it can work without any infrastructure whatsoever. 2024-01-15 19:03:18 I used to really enjoy shortwave radio listening when I was in high school. But the internet pretty much just killed that. 2024-01-15 19:04:23 Voice of America, BBC, Radio France International (iirc), Radio Moscow, etc. - I knew right where to find all of them. 2024-01-15 19:05:06 And all it took was a wire between a couple of trees in my back yard. 2024-01-15 19:06:01 "Good' antenna systems for such low frequencies aren't particularly easy to put up, but fortunately you didn't really need a good one for those sources. 2024-01-15 19:07:10 It was always fun learning about where various sources were actually aiming their signal at - they definitely all had parts of the world they most wanted to influence. 2024-01-15 19:07:57 And it pretty much went without saying that VoA and Radio Moscow had one another's population on their target list. 2024-01-15 20:03:13 stepped out for lunch and had some reflection. i think i've gone off into the weeds, way overcomplicating everything. 2024-01-15 20:04:30 for some reason (i think i know why, but that's not important) i couldn't get past this idea that i needed to create a single all-purpose interpreter environment, and it was to be self-hosting and portable, and that would be my development environment for all things going forward 2024-01-15 20:04:40 it just doesn't have to be that way LOL 2024-01-15 23:57:54 I am seeking to create something I use going forward for most everything. But I have no idea how diverse your "everything in the future" is.