2023-08-23 04:57:21 Ew. SmithForth's ." ends up compiling a bunch of junk into the data area if used interactively. 2023-08-23 05:02:49 If we're interpreting, I think COMPILE, should eat an xt and be a noop, right? 2023-08-23 05:05:08 Oh. Interpretation semantics are undefined for ." 2023-08-23 05:19:35 xelxebar: Standard interactive print is .( ....) 2023-08-23 05:20:06 Old Forths would treat ." specially but with the standard they (initially) tried to make words less smart about STATE .... which I agree with in principle 2023-08-23 05:20:10 I don't like STATE-smart words 2023-08-23 05:20:36 i.e. .( Hello, world!) CR 2023-08-23 05:20:45 I keep saying i.e. when I mean e.g. 2023-08-23 05:22:44 Just now got to the point in SmithForth's library where .( is defined. I see. It's literally just : .( [CHAR] ) PARSE TYPE ; IMMEDIATE. 2023-08-23 05:22:50 Cool. 2023-08-23 05:23:26 Surprised it's marked IMMEDIATE. I guess it's helpful for printing messages at compile time? 2023-08-23 05:30:47 Oh, cool. : FILL ( addr u char -- ) OVER IF 2 PICK C! ( addr u ) 1- OVER 1+ ( addr u-1 addr+1 ) SWAP CMOVE ELSE DROP DROP DROP THEN ; 2023-08-23 05:31:58 This is a clever use of CMOVE. It falls back to the movs instruction, so this usage just copies one initial seed value and then movs propagates that forward. 2023-08-23 05:57:24 Yeah that's how my FILL is implemented 2023-08-23 05:57:44 I learned that trick from Z80 where LDIR was often used as memset 2023-08-23 06:01:45 FILL ME 2023-08-23 06:02:13 Funny that I can almost say anything in caps and will be forth code 2023-08-23 06:57:00 LOL 2023-08-23 08:10:05 Anyone annoyed by GitHub forcing 2FA? It's annoyed me but I'll admit it would be quite bad if I actually lost my GitHub account 2023-08-23 08:10:12 I know lots of people here use alternatives and self host though 2023-08-23 08:11:26 I was just thinking that my ideal setup would probably just be to have a website and mailing list, get people to use git/diff/patch etc to contribute 2023-08-23 08:11:39 But I definitely reach more people via GitHub... 2023-08-23 08:13:04 It's much like the question "should I connect to IRC networks or only ever talk to people via email or on my own network" .... obviously I get to talk to more people on libera.chat 2023-08-23 08:13:26 It's just that tiny bit more convenient and it makes all the difference 2023-08-23 08:14:30 Should I self-host email? That's the worst thing to self-host from what I've heard 2023-08-23 08:35:17 You might try one of those new little "gadget based" 2FA approaches. Those recently became available for us at work. I now have this tiny little gadget plugged into a USB port on my computer, and I can 2FA my IBM stuff just by touching it. It generates an encrypted key valid at that time window. Exactly the same idea as 2FA, but quite a bit more convenient than having to have your phone around. 2023-08-23 08:35:46 It can't be your primary authentication method, because if you lose your computer it's probably plugged into it, but it's great as a physical 2FA thing. 2023-08-23 08:36:08 I'm sorry - I don't remember the acronym that goes with the idea right now. 2023-08-23 08:36:26 It lowers to aggravation level of 2FA quite a bit. 2023-08-23 08:36:42 i'm using Aegis (available in F-Droid) on my android( 2023-08-23 08:39:31 veltas: Here you go. 2023-08-23 08:39:33 https://www.yubico.com/products/yubikey-5-overview/ 2023-08-23 08:39:57 The one at the far right in the picture is the one I've got. It may as well not be there as far as carrying around your computer and so on goes. 2023-08-23 08:40:25 Of course, your service has to support using those. 2023-08-23 08:45:48 Oh I've just used my phone and saved my recovery keys in multiple places 2023-08-23 08:45:55 I don't really care what method I use 2023-08-23 08:46:11 It's only for the website anyway, I use SSH keys to do most of the work 2023-08-23 08:46:18 And I'm pretty much always logged in 2023-08-23 08:46:29 I mean SMS 2023-08-23 08:46:45 Most people are '[using their phone]' 2023-08-23 08:47:11 I'm more interested in this self hosting thing really 2023-08-23 09:03:40 Most of my "wouldn't want to lose" stuff is on either Dropbox or Google mail. 2023-08-23 09:05:59 Do you have GitHub? 2023-08-23 09:06:22 I do, but I've hardly ever used it. 2023-08-23 09:18:50 Do you have an external place your code is stored? Or a backup? 2023-08-23 09:18:55 Dropbox? 2023-08-23 09:19:04 Dropbox. 2023-08-23 09:19:13 I generally just work in a folder that's in my Dropbox folder. 2023-08-23 09:19:31 And that has revisions to restore from? 2023-08-23 09:19:43 And Dropbox keeps old versions. It's not as nice as a version control system, but I can go back and get old versions if I need to. 2023-08-23 09:19:58 Cool 2023-08-23 09:19:58 Ah, same wavelength. Yes, they store at least some sort of history. 2023-08-23 09:20:32 So you're immune to "I accidentally deleted my files" 2023-08-23 09:23:34 Well, in theory. 2023-08-23 09:32:51 I did that once years ago - deleted a source file I'd been working on for work for about two weeks. 2023-08-23 09:33:09 That's really about the worst "sick" feeling you can ever have. 2023-08-23 09:33:52 I was able to remember a little bit about my most recent edit, and managed to use grep on the raw disk device to find enough to recover it from. 2023-08-23 09:33:58 I.e., I was lucky. 2023-08-23 09:35:06 i have wished a few times that rm on linux had a recycle bin 2023-08-23 09:50:58 Indeed, but then again other times I'm glad it's as clean as it is. 2023-08-23 10:04:24 veltas: email is one thing I have no interest in self hosting. I've done it in the past; it's a considerable time sink. 2023-08-23 10:18:02 'That's really about the worst "sick" feeling you can ever have.' 2023-08-23 10:18:09 You have lived a sheltered life KipIngram :P 2023-08-23 10:31:39 Well, that was hyperbole. I've had worse things. One of my daughters had a hard time mentally for a while, and I'd say that's the *actual* worst I've ever felt. 2023-08-23 10:32:01 But yeah, aside from a thing or two I've been pretty fortunate. 2023-08-23 10:40:34 When that whole business with my daughter was in its most hopeless seeming period, I apparently ground my teeth in my sleep to the point of cracking a root. It got infected and I went to my dentist. 2023-08-23 10:40:58 He told me it was too inflamed to remove that day - he prescribed antibiotics and hydrocode and we set up the extraction for the following day. 2023-08-23 10:41:18 He told me to go home, take the antibiotic, and take two of the hydros with something to eat and drink, and go to bed. 2023-08-23 10:41:57 I did that, and about 20 minutes later I just felt the most wonderful absence of pain and absence of "ragged worry." I realized right then how people with emotional burdens could get addicted to hydrocodone. 2023-08-23 10:42:35 I was still fully aware of the daughter's situation and the need to act on it, but it just didn't HURT the same way it had a half hour earlier. 2023-08-23 10:43:32 Problem is, though, that only really works the first time you take the stuff. You almost immediately develop a tolerance, and I can see people who try to chase that "relief" getting into real trouble. 2023-08-23 10:44:09 Like that line in the Guns 'n Roses song about heroine - "I used to do a little but a little didn't do it so the little got more and more." 2023-08-23 10:45:01 Anyway, my daughter's doing great these days, but that was a tough period. 2023-08-23 10:45:18 It was about 10 years ago now. 2023-08-23 10:45:52 I took like a couple of codiene pills recently and understood immediately how easy it is to get addicted to opioids 2023-08-23 10:46:06 I'm obviously very sensitive to it 2023-08-23 10:46:13 Glad your daughter's better 2023-08-23 10:46:19 Yeah I was just pulling your leg anyway 2023-08-23 10:46:26 No worries. :-) 2023-08-23 10:46:42 Codeine has never seemed to work very well for me - I hardly know I took anything. 2023-08-23 10:46:53 Well, I gues sit helps with the pain it's supposed to help with. 2023-08-23 10:47:05 But I don't get any kind of mental affect from it. 2023-08-23 10:47:10 effect 2023-08-23 10:49:07 So, I'm trying to arrange this F18A style business so that the vm code I generate with this Python stuff winds up being a completely relocatable slab of bits. I want to just be able to bolt it onto the end of my platform specific code and have it all just work. 2023-08-23 10:52:16 The only exceptions might be pre-loaded variables; DP and FORTH normally hold *addresses*; if I want them to work like that here they'll have to get patched based on where the image is in RAM. 2023-08-23 10:52:57 And any memory management stuff might have similar items. 2023-08-23 11:35:50 This should be pretty straightforward. I'll just have a Python dictionary with all the vm instructions in it - as words are found, if it's one of those it'll compile the appropriate opcode. If a word isn't in that dictionary, though, it'll search the dictionary I'm building and compile a call to the appropriate location. That'll all be Python, but at some point I should be able to hand off to an emulator 2023-08-23 11:35:52 and have it start executing what's already been compiled. 2023-08-23 11:37:12 The other day I mentioned something like "header(name) ; define(...)" but I think instead I'll just put my source in a big multi-line string so it's actual valid source. 2023-08-23 11:38:05 Then after the handoff the Python can move that into my image region char by char as the running code calls KEY. 2023-08-23 11:38:31 I want to be able to fully exercise it. 2023-08-23 12:27:45 Wow - some Quora questions just seem so utterly useless to me. I just saw one that wanted to know how long after 10 o'clock would the hour and minute hands be perpendicular for the second time. 2023-08-23 12:28:22 Turns out to be 38 minutes, 10.9090... seconds, but I fail to see what possible value that could have. 2023-08-23 12:28:39 three seconds later, when the human adjusts it back 2023-08-23 12:29:44 I suppose knowing how to sensibly approach such a problem is worthwhile knowing. 2023-08-23 12:30:20 you could write a program to calculate the angles... 2023-08-23 12:32:08 maybe a high schooler was asking 2023-08-23 12:33:52 I just worked it out in-line writing the answer. 2023-08-23 12:34:19 Used a calculator, but just to get the exact answer - it wasn't going to be anything "nice and round." 2023-08-23 12:35:18 You know that at 10:00 the hour hand is at 300 degrees and at 11 o'clock it's at 330 degrees, so you can write an equation angle(time) for that. And similarly for the minute hand. Then just set the difference to 90 and solve for t. 2023-08-23 12:35:47 hour_angle(t) - minute_angle(t) = 90, that is. 2023-08-23 12:37:30 I guess that's assuming it's not one of those clocks where the minute hand clicks forward a whole six degrees on each minute mark. 2023-08-23 12:40:31 that would be more a sawtooth instead of a sin wave 2023-08-23 12:45:03 Well, I'd call it a stairstep function. 2023-08-23 12:45:15 We could think of that as a "quantum clock." Time quantized in minutes. :-) 2023-08-23 12:46:09 the minute hand is tunneling 2023-08-23 12:46:25 Indeed. 2023-08-23 12:47:14 Tunneling is kind of a misnomer - when we see a particle in one spot now and in another spot later, we're not supposed to even think about the path it followed in between. 2023-08-23 12:47:17 Feynman said so. 2023-08-23 12:47:43 Not supposed to try to "pin down" things we don't actually observe. 2023-08-23 12:49:17 That gets at my biggest pet peeve with "pop-sci" quantum discussions - the whole "the electron is in two places at the same time" thing. 2023-08-23 12:49:28 No. No one has *every* seen an electron in two places at once. 2023-08-23 12:49:49 You only get to even talk about where it is when you've observed its position, and when you do that you always find it in ONE place. 2023-08-23 12:50:18 What they mean to say is that there are two places the electron *might be found* on a future observation. But that is not the same thing at all as "being in" those two places at the same time. 2023-08-23 12:50:39 It's just wrong and they should stop saying it like that. 2023-08-23 12:50:54 But... it sounds so mysterious and eerie. 2023-08-23 12:50:58 They can't resist. 2023-08-23 12:51:51 Also saying that a particle doesn't exist unless we observe it. That's wrong too. That is conflating "quantum state" with "observable property." 2023-08-23 12:52:01 Observable properties don't exist until you measure them. 2023-08-23 12:52:08 But the quantum state *always* exists. 2023-08-23 12:52:48 And it only has ONE VALUE at any given time. "The particle is in multiple states at once" is also wrong. 2023-08-23 12:53:17 It's in A state which might happen to be a linear combination of a set of POSSIBLE future states. 2023-08-23 12:53:40 But it's not "in" any of those future states. It's in its (one) present state. 2023-08-23 12:54:05 It's like saying that the direction northeast IS the direction north AND the direction east at the same time. No it's not. It's northeast. 2023-08-23 12:54:21 considered as a pair of vectors... 2023-08-23 12:54:51 Right - but in the quantum discussions those vectors they're considering have to do with a FUTURE measurement. They mean nothing to the system prior to the measurement. 2023-08-23 12:55:15 They're meaningful to your future plans, but not meaningful at all to the system's current state. 2023-08-23 13:00:06 For example, someone may be planning to measure the position of an electron, and they say that it's already in all the possible position outcomes beforehand. 2023-08-23 13:00:18 But what if they change their mind at the last minute and measure momentum instead? 2023-08-23 13:00:28 Then what did those position outcomes even MEAN? 2023-08-23 13:01:04 Not anything anymore - they were just possible results of a measurement that we MIGHT have made but didn't. 2023-08-23 13:02:21 You might want to measure position, so you say the electron is already in all those positions. But I want to measure momentum, so I say it's already in all of the momentum states. If there's a group of us all wanting different measurements, first thing you know we'll be saying that the electron is already in every everything. Which really just boils down to saying "we have no idea." 2023-08-23 13:02:29 And we don't - until we measure SOMETHING. 2023-08-23 13:13:55 Anyway I think that part of the media deliberately makes it sound more mysterious than it really is. 2023-08-23 13:19:58 moar clicks 2023-08-23 13:45:23 Yep. 2023-08-23 13:51:29 I think the "system" winds up in a state that's mostly dependent on the instrument is nothing more than the fact that the system is tiny and low energy, whereas the instrument is big and high energy by comparison. It's like firing a cannonball at a fly and then acting surprised that the cannonball dominates the final motion. 2023-08-23 13:51:49 Sure, the fly DID affect the final outcome. But only by a completely trivial little bit that we may as well ignore. 2023-08-23 13:58:22 That's also a good argument against associating those possible outcomes with 'the system' before the meaurement. Those only become relevant to the system after you've interacted it with the big strong instrument. The instrument MADE those possible outcomes relevant. 2023-08-23 13:59:03 The future trajectory of the cannonball had nothing at all to do with the fly, until they collided. 2023-08-23 14:00:58 "waiter, there is a fly on my cannonball" "perhaps you shouldn't dine in vienna when napoleon gets frisky" 2023-08-23 16:01:29 so forth has 2 stack? one for parameters and one for return addresses? but i thought it only had one stack, and that function - to return stuff - just manipulated that one stack? 2023-08-23 16:04:39 >R and R> are a thing in some forth 2023-08-23 16:09:47 thrig, what's that? 2023-08-23 16:10:28 rendar: that moves stuff from the parameter stack to the return stack, and vice-versa 2023-08-23 16:11:21 but what is the difference from param stacks and return stack?! 2023-08-23 16:12:01 i always thought that forth had 1 stack, you put stuff into stack, like `2 3` and then you call `+` which will pop, pop, add and push result into the same stack 2023-08-23 16:12:08 why having a second stack in this scenario? 2023-08-23 16:13:13 : foo + + ; : bar foo foo ; and when foo or bar get done doing things, where does the control flow go to? 2023-08-23 16:16:14 thrig, `1 1 1 foo` would push into the stack 1,1,1 then call one +, then stack is 1,2, then call the second +, then the stack is 3, done. 2023-08-23 16:16:38 thrig, oh! i see what you mean 2023-08-23 16:17:18 i didn't think that foo was a procedure to call, i thought Forth just executed it INLINE! 2023-08-23 16:17:44 e.g. foo is a key to an hash table which points to ["+", "+"] and Forth just executed those words 2023-08-23 16:18:24 samething with bar, it will expand to ["foo", "foo"] which in turn will expand to ["+", "+", "+", "+"] automatically, just inline.. 2023-08-23 16:37:48 rendar: Parameter stack is for the arguments, it serves same purpose that registers do on a normal CPU 2023-08-23 16:37:59 return stack is more like the CPU 'stack' you're used to 2023-08-23 16:38:09 It's for control but also used to push variables etc 2023-08-23 16:38:25 https://bpa.st/E2WA this is how i implement it 2023-08-23 16:38:34 sorry, wrong window! 2023-08-23 16:40:37 I started reading that trying to understand how it related to Forth lol 2023-08-23 16:40:43 I don't know ... Rust(?) 2023-08-23 17:03:28 eh? 2023-08-23 17:03:33 yes veltas 2023-08-23 17:03:44 it was Rust, i just did windows wrong 2023-08-23 17:19:23 rendar: inlining only happens to increase performance and only in some forths 2023-08-23 17:19:36 MrMobius, hmm i see 2023-08-23 17:19:42 so bar probably isnt inlining + four times 2023-08-23 17:19:45 rendar: The return stack is accessible and put to limited other uses as well. 2023-08-23 17:20:08 Almost all languages use a return stack. C does, etc. 2023-08-23 17:20:15 what about having a Forth without the return stack, which inlines ALL the function calls? 2023-08-23 17:20:31 So you always have one - generally you just can't get at it directly. It's managed automatically. 2023-08-23 17:20:38 how would it know to inline something you just typed in 2023-08-23 17:20:49 thrig, huh? 2023-08-23 17:20:58 How would it interpret? 2023-08-23 17:21:05 Interpreted code doesn't get saved anywhere. 2023-08-23 17:21:18 rendar: that would waste a lot of memory which could be bad on embedded systems with limited memory 2023-08-23 17:21:21 It's run one word at a time, and there has to be a way to get back to where the interpreter called it from. 2023-08-23 17:21:37 I think it should just be regarded as "impossible" to do without the return stack. 2023-08-23 17:21:57 no, it's possible 2023-08-23 17:22:04 just think about this 2023-08-23 17:22:09 Notice I put "impossible" in quotes. 2023-08-23 17:22:19 What I really meant is "you shouldn't want to." 2023-08-23 17:22:22 hmm, you could definitely do it without a return stack. you just have to make sure the return address is there when you return 2023-08-23 17:22:23 It's valuable. 2023-08-23 17:22:28 same with loop variables and stuff 2023-08-23 17:22:38 It's as close to a universal feature of all programming systems as you can get. 2023-08-23 17:22:39 i'm writing a toy-Forth to learn languages, and my Forth doesn't get compiled into asm, it is just interpreted at runtime, like Python 2023-08-23 17:23:08 it exposes some basic words, then all the `: defined ... ;` words get expanded to a set of those basic words, bam, done. 2023-08-23 17:23:10 There ar eall kinds of ways you can make something that "kind of works like Forth" but isn't *really* Forth under the hood. 2023-08-23 17:23:17 you inline everything so you don't need the second stack 2023-08-23 17:23:23 Often you see a big switch statement in C implementing the words. 2023-08-23 17:23:34 It's a bad idea. 2023-08-23 17:23:40 I don't say that very often. 2023-08-23 17:23:55 Return stacks are SIMPLE. What are you gaining by not having it? 2023-08-23 17:23:56 rendar: that will work for a toy forth but non-toy forths never do that 2023-08-23 17:24:23 How will you do colon definitions? 2023-08-23 17:24:55 KipIngram, they are just keys to some hash table 2023-08-23 17:25:06 MrMobius, you mean because Forth operates at lower level? 2023-08-23 17:25:25 rendar: no because no language would inline everything like that. it's not practical 2023-08-23 17:25:30 KipIngram, the thing is, since my forth is interpreted, i simply *DON'T* call functions! 2023-08-23 17:25:38 rendar: even assembly doesnt do that 2023-08-23 17:26:04 i just have an hash table which maps string->fn_pointers, then i do: fn_ptr = table[word]; fn_ptr(); 2023-08-23 17:26:39 rendar: you could make a list of tuples and iterate through it 2023-08-23 17:26:54 MrMobius, that's exactly how it will work, basically 2023-08-23 17:27:11 first tuple part says whether it's a number to push or a function and the second part holds the number of the address of the function 2023-08-23 17:27:22 hashtable where chunk is a tuple of words 2023-08-23 17:27:51 like KipIngram mentioned, you can find tons of ways to do it that are not how Forth actually works 2023-08-23 17:27:55 e.g. `hashtable["+1"] = ["1", "+"]` 2023-08-23 17:28:16 then my interpreter will parse those words ^ 2023-08-23 17:28:24 "1" and "+" 2023-08-23 17:34:54 https://thrig.me/tmp/so-how-do-you-implement-this.txt 2023-08-23 17:35:53 thrig, easy, on redefinition, you overwrite hashtable values 2023-08-23 17:36:19 you have hashtable["bar"] -> ["foo",] 2023-08-23 17:36:32 look again at how bar behaves 2023-08-23 17:36:37 ok 2023-08-23 17:37:24 also, how will you do recursion? 2023-08-23 17:37:33 MrMobius, i won't 2023-08-23 17:37:43 i don't need it, instead i want to prevent it, also looping 2023-08-23 17:37:59 thrig, ok, i see 2023-08-23 17:37:59 not much use in a language without loops :P 2023-08-23 17:38:15 indeed, this is not a ...language 2023-08-23 17:38:49 but also Forth isn't a proper language, in Thinking Forth, the author says that you shouldn't use Forth as a real language, but as a language to create your own language 2023-08-23 17:39:07 or, your own idioms 2023-08-23 17:39:36 thrig, i would expect that bar calls foo everytime, so, in my forth, it won't be never 42 2023-08-23 17:39:40 always 99 2023-08-23 17:39:49 because bar calls whatever is inside foo 2023-08-23 17:40:39 so the stack in your example will be: 99 99 99 2023-08-23 17:41:04 actually, i can't understand why bar is producing 42 here... 2023-08-23 17:41:23 it was "compiled" when foo was 42, and it had it "inside" ? 2023-08-23 17:43:26 might be good to learn how a forth works 2023-08-23 17:43:54 thrig, i'm studying it 2023-08-23 17:45:18 why bar puts 42? when bar is defined it saves whatever foo produces as a result into the stack? 2023-08-23 17:45:56 there is usually a dictionary, and words are looked up backwards 2023-08-23 17:48:03 thrig, ok, i know that there is a dictionary, but why bar *saves* 42 inside, like a closure, even when foo changes? shouldn't it call foo, and having whatever foo "returns" (or put into the stack) ? 2023-08-23 17:52:18 Bar references Foo at the time it was created, Foo is then redefined and leaves 99, but the old Foo is still in the dictionary, further back. So kind of a closure if you wanna look at it that way. 2023-08-23 17:57:06 Forth absolutely IS a language. 2023-08-23 17:59:07 And I agree with thrig - actually learning it would be a reasonable thing to do. 2023-08-23 18:00:14 When you give a name a new definition, that only changes future uses of the name. It doesn't change already compiled references to that name. 2023-08-23 18:00:57 You CAN arrange for doing something like that - in my Forth I can do it to any word, but the normal way of making a definition, with : doesn't redefine old references. I'd have to do something different to do that. 2023-08-23 18:01:25 In some Forths you have to indicate at the time you compile the word the first time that you're going to want to redefine it later. 2023-08-23 18:01:55 : foo 12 ; 2023-08-23 18:01:59 : bar foo ; 2023-08-23 18:02:05 : foo 13 ; 2023-08-23 18:02:22 bar will give us 12, because it is using the definition of foo that was extant when bar was compiled. 2023-08-23 18:03:31 Like I said, though, you CAN cause old references to do somethin new - it's just not the "straightforward" behavior. 2023-08-23 18:04:11 In my example above, I could no longer change bar by changing foo, though, because the original definition of foo is no longer accessible in any easy way. 2023-08-23 18:05:55 If you wanted to write your Forth so that redefinition affected all uses of the word, even already compiled ones, you could do that. It's just not standard. 2023-08-23 18:15:12 KipIngram, ok so whenever i do a new definition : .. ; it is compiled and saved with the "environment" at that time 2023-08-23 18:19:35 Ok. In Forth the new definition is saved - nothing beyond. 2023-08-23 18:20:03 Later use of that name will use that definition (unless you've modified your search path so that it's not found). 2023-08-23 18:20:28 You can have a tree of search contexts, so the same word can be around in several different versions. Whichever one gets found first is used. 2023-08-23 18:20:34 Whichever definition, that is. 2023-08-23 18:20:48 What all is included in your 'environment'? 2023-08-23 18:23:24 The right way to think of how Forth handles multiple word lists (called "vocabularies") is that one way or another you specify an ordered list of vocabularies. It searches each one, newest definition to oldest (within that vocabulary) in whatever vocabulary order you've specified. If it finds a definition matching the name you're looking for, it uses it. 2023-08-23 18:23:44 You can change the vocabulary search sequence any time you want to. 2023-08-23 18:24:03 You also specify one vocabulary to be the one that new definitions go into, and you can change that whenever you want to as well. 2023-08-23 18:24:34 Whether that target vocabulary is also in the search order varies from system to system - the standard may have something to say about that, but I don't know it. 2023-08-23 18:25:12 I've felt that cross compiling for other platforms would be more straightfoward if the target vocabulary is NOT included in the search order (though you could ALSO include it in the search order if you wanted to). 2023-08-23 18:25:41 I do not include the target vocabulary (referred to as CURRENT) in my search list. 2023-08-23 18:26:29 It's really only unusual cases where would make use of that. 2023-08-23 18:27:11 Normally by the time you make a vocabulary CURRENT you've also put it in your search list, so if you don't want that you'd then need to take it out. 2023-08-23 18:27:50 Anyway, I'm harping on the vocabulary stuff because that's probably the most involved part of what Forth would call "the environment." 2023-08-23 18:28:15 I guess BASE would be thought of as part of the environment too. 2023-08-23 18:44:45 rendar: It might be worth mentioning what actually happens when a word (like bar in the example above) is compiled. The compiler sees the reference to foo, and it finds foo in the dictionary. At that time there's only one foo in the dictionary, so that's the one that gets found. The compiler takes the ADDRESS of foo and puts it into bar's definition. At the time bar executes, it just runs whatever's at 2023-08-23 18:44:47 that address - it has no idea now that that word was named "foo." It's just a spot in RAM to call. 2023-08-23 18:45:04 Yes, foo got redefined, but that doesn't change the address that got put into bar's definition. 2023-08-23 18:45:04 KipIngram, i see 2023-08-23 18:45:12 KipIngram, my forth never compiles, always interpret 2023-08-23 18:45:23 The point of this is to speed things up - bar can go straight to that first definition of foo without having to search the dictionary. 2023-08-23 18:45:42 yes, clear 2023-08-23 18:45:46 At the time Forth was created, computers were much slower. 2023-08-23 18:46:44 What I was getting at earlier, about writing your Forth to work the way you were thinking of - when you redefine foo, your compiler could go find the old definition of foo and change a pointer in it to point to the new definition. 2023-08-23 18:47:03 bar is pointing at foo's definition, so in that case when it ran it would follow the now updated pointer there and find the new definition. 2023-08-23 18:47:29 In most Forth systems, though, when you redefined foo the compiler wouldn't even realize that there was an earlier foo. 2023-08-23 18:47:45 it just creates a new definition - it doesn't search to see if the name already exists. 2023-08-23 18:48:41 Forth is something of a "rough and ready" language - I imagine there are a lot of things about it that formal computer scientists would find... "unnerving." 2023-08-23 18:49:40 E.g., how many languages would let you do this: 2023-08-23 18:49:48 : 1 42 ; 2023-08-23 18:49:57 1 1 + . 84 ok 2023-08-23 18:54:53 KipIngram, yeah 2023-08-23 18:54:55 i agree! 2023-08-23 18:56:09 I'm a hardware guy by training. Digital / embedded systems. And Forth is just AWESOME for diddling around with hardware. 2023-08-23 18:57:20 yes i can imagine that 2023-08-23 19:48:30 KipIngram: What was that technique you mentioned that mecrisp used so that it wouldn't wear the flash roms down unnecassarily? 2023-08-23 19:58:31 mecrisp across emulates an msp430 with an arm board and doesnt write to flash until youre ready to compile 2023-08-23 20:03:06 Hrm... My hardware XP is miniscule, so I'm not sure I follow. You mean that the interpreter doesn't actually run on the chip? 2023-08-23 20:36:16 everything I've heard aout Mecrisp-Across is that it's awesome