2022-05-08 00:01:50 Ugh. Lot of driving today. Back home now, though. 2022-05-08 00:39:18 God, I hate I missed today's conversation - looks really good. 2022-05-08 00:40:07 veltas: I totally agree with your top down design / bottom up implementation approach. I hold that as an ideal too. I'm not always disciplined enough to stick to it, but I'm convinced it's the "right way." 2022-05-08 00:40:35 And you can do it in most languages, but Forth is just particularly friendly toward it, especially that "bottom up" part. 2022-05-08 01:10:02 You know, on that cursor reporting thing, I can do better than I'm doing. I'm not validating any of the keystrokes I "ignore" or use for number termination. My little simple word just assumes it's going to be right. But I could go a long way toward *recognizing* interfering input from the keyboard, not use it for the cursor report, and stow it in a buffer to be used for responses to KEY later. 2022-05-08 01:10:38 That wouldn't completely guarantee correctness, because some characters from the keyboard couldn't be distinguished as wrong. But it would go a long way toward reducing its frequency. 2022-05-08 01:38:05 Actually, what I'll probably wind up doing is ignoring the problem. It really can only happen under the condition of me just holding down the enter key, and I don't really see any reason I'd do that. 2022-05-08 01:38:17 It's just a little offensive to have a "known fault." 2022-05-08 01:38:29 But if it's not realitsically going to bite me, then maybe I shouldn't care. 2022-05-08 01:39:16 It can't happen, for example, if I hold down a key *within* reading a string, because I'm not asking for cursor reports then. 2022-05-08 01:39:52 I only do it once at the beginning of EXPECT, to "anchor" the first character position of the string so I can go there later. 2022-05-08 02:40:03 KipIngram: Hi, I don't advocate for a "bottom up implementation" 2022-05-08 02:40:28 Instead I think you should implement top-down... but then when you hit bedrock you start 'playing' with stuff in interpreter as you would doing bottom-up 2022-05-08 02:40:44 And work your way back up as necessary (at least as far as needed to get the code running) 2022-05-08 02:41:55 Forth doesn't require you do one way or the other, in fact it's had deferred colon word features for donkey's years (easy to implement with DOES>) 2022-05-08 02:42:17 so you could even do this top-down implementation on an old interpreter-only system 2022-05-08 02:43:51 One of the issues with bottom-up programming is it has a tendancy to lure you into unnecessary or overengineered code 2022-05-08 02:44:07 When you write top-down it's much easier to focus on exactly the required words 2022-05-08 02:45:15 the task becomes an exercise of mining for hierachical bedrock, and you're less likely to start building unnecessary tunnels and wells 2022-05-08 02:59:29 I see. I misunderstood your earlier words. 2022-05-08 03:03:05 I get it now though - sort of a "bottom up" testing process. 2022-05-08 04:37:33 KipIngram: Yes, you still want a little bottom up, I just don't think it's a good *general* approach 2022-05-08 04:37:38 It's fine for something small though 2022-05-08 04:37:54 Just my opinion though, everyone has their own experience 2022-05-08 04:39:25 Why do I feel like I've failed to use /string when I could have 2022-05-08 04:39:34 Actually, lads, here's a question::::::: 2022-05-08 04:40:03 People always seem to recommend that words consume their stack parameters, but often it seems like it's much cleaner to leave them there 2022-05-08 04:40:29 How dirty do people think this is, having lots of words that leave their stack parameters on the stack to avoid extra dup's? 2022-05-08 04:40:52 What's ##forth's opinion? 2022-05-08 08:45:05 having a vocabulary of words is something that makes forth less desirable. I would rather have something like forth with seven namespaces { app dat net sys etc doc src } and use them to open a file like open.dat or print like print.app; I'm not opposed to operators like + - = and I think dup should be a `,' and drop be a plain `.' aliasing could work with `app cd 4 print' which would print a 4. yes leaving 2022-05-08 08:45:11 things in the dictionary has turned me away from forth so far, though I try to compensate by attempting to write rpn parsers. 2022-05-08 08:47:00 the beauty of forth is that you can do that! 2022-05-08 08:55:34 klys: Can you expand on what you want? 2022-05-08 08:55:57 I've been thinking about what the point of vocabs/wordlists is recently, it's not too obvious 2022-05-08 08:56:10 I might even be able to help a bit with this 2022-05-08 09:32:26 veltas, well I want a forthy rpn parser that starts out with no vocabulary, sort of like a clean operating system, and then you load modules into it, which create words. when it's finally able to read the filesystem, it should have access to the above mentioned namespaces (which are visible in the root context as words). 2022-05-08 09:35:22 when you load modules into the blank parser, it should compartmentalize them and make them accessible from the current context. the first thing that it loads would be a configuration file, which would specify a set of instructions as modules to load. the first thing it would load would likely be the memory manager, which should eventually rest at mm.dat 2022-05-08 09:36:20 if I was in the dat context `dat cd', I would access the app context like so, `print.app.' 2022-05-08 09:39:43 I haven't really set that in stone yet, because it would have to have a way of specifying absolute context if you were working with a hierarchical filesystem of words. so, if mm.dat turns out to be a context you cd into, you would want to maybe `.print.app' or something to specify the root 2022-05-08 09:41:55 when the filesystem is mounted, you have access to the seven words representing context, and all of the symbolic operators defined. you would want those defined for your shell, so you can make for/while loops, and do shell related functions for everyday tasks. 2022-05-08 09:47:03 the app context is anything that works with the user, dat is anything that manipulates data, memory or files, net is anything that reaches another process for example copying, sys is anything the cpu's instruction set provides for example branching/loops, etc is configuring anything like a setting, doc is processing parameters or outputs like tokenizing or formatting, and src is anything preexisting that you 2022-05-08 09:47:10 can make soemthing larger out of 2022-05-08 09:47:43 veltas, i think the reasoning is that you would end up with a lot of DROPs if you left arguments on the stack. if theyre consumed, you end up with way less DUPs than you wpuod DROPs 2022-05-08 09:48:09 but no reason not to make some words leave args on stack 2022-05-08 09:56:22 klys: It feels like there are a few different ideas here 2022-05-08 09:58:08 Certainly a typical forth is capable of all of what you're saying 2022-05-08 09:59:31 veltas, I have never seen a forth with an empty dictionary, certainly not a simple one 2022-05-08 10:00:29 when forth loads I can type `words' and it gives me the laundry list and I just stop there 2022-05-08 10:02:39 In Forth 200x (and I think ANS Forth) you can use ONLY to get a minimal wordlist 2022-05-08 10:03:02 But if that has too much you can create a wordlist yourself containing the minimal wordset you want 2022-05-08 10:03:26 I suppose I may have seen minimalized wordlists, yet not an empty set primed for assembly 2022-05-08 10:10:31 only ok 2022-05-08 10:10:31 words 2022-05-08 10:10:47 what are those? 2022-05-08 10:11:07 it seems Forth brings all the words back 2022-05-08 10:12:00 is there an interface to raw assembly there? 2022-05-08 10:12:32 this is from gforth 2022-05-08 10:16:01 http://forth.sourceforge.net/standard/dpans/dpansa15.htm#A.15.6.1.2465 2022-05-08 10:31:02 so I looked at `see get-order' 2022-05-08 10:32:43 was also reading here, https://gforth.org/manual/Assembler-Definitions.html 2022-05-08 11:14:44 veltas: In my conditional control words I provide some capability in that direction - the "straightforward" words consume their normal arguments, but if I precede that name with a . (separate word, with a dot prepended), then the *deepest* stack argument is retained. For example, =; will return if the top two items are equal, and will consume them. But .=; will do the same thing while only consuming ONE of 2022-05-08 11:14:45 them. 2022-05-08 11:15:07 This works out nicely when I want to compare a data byte to a series of values. The tests will remove the comparison data, but leave the byte under test. 2022-05-08 11:16:29 I find I regularly use both versions of those words. 2022-05-08 11:17:04 If we're talking about word that takes a single argument, then the .?? version of it keeps "all the arguments." 2022-05-08 11:18:21 I use that a lot in EXPECT - I've entered a character from the keyboard, then I run a batch of words that say "is this THIS special character," "is this THAT special character," etc. - all the while leaving the character in place for further testing. 2022-05-08 11:18:47 Generally if a test fails I do a conditional one-level return - if it passes I take the necessary action and do a TWO level return, skipping over the remaining tests. 2022-05-08 11:19:23 So there will be a "getch handle" phrase somewhere, and handle will be "test test test ... ; 2022-05-08 11:19:42 And then each test works the way I described - if it actually handles the character it returns back out of handle. 2022-05-08 11:19:56 Then there will be a single drop after handle to get rid of the byte. 2022-05-08 11:20:05 Avoids having dups all over the place. 2022-05-08 11:20:40 You're absolutely right - there are cases where having this capability is very convenient. 2022-05-08 11:20:44 And cleaner. 2022-05-08 11:22:05 I have a LARGE set of those conditional return words - I wrote a Python script to synthesize their nasm source code, and it produces a complete matrix, across the condition cases < <= = != >= >, across returning, double returning, and recursing, and with and without the . prefix. 2022-05-08 11:22:28 Also across signed and unsigned comparisons. 2022-05-08 11:22:40 klys: If you want assembler words then ASSEMBLER word is the standard word to set the top search order wordlist to assembly 2022-05-08 11:22:46 And the names of those words are built "algorithmically" so it's easy for me to remember all the names. 2022-05-08 11:23:03 Again keep asking questions if you have questions about things 2022-05-08 11:23:17 I feel like you are missing something but I don't really understand what 2022-05-08 11:23:34 Oh, and also all the same matrix options but just "make a flag" like in traditional Forth. It's well up over a hundred primitives. 2022-05-08 11:23:52 But when I need a case, I can count on it being there. 2022-05-08 11:25:18 That Python just creates an include file that I "include" in my main source. 2022-05-08 11:27:11 Since I don't actually have the traditional control structure words like IF ... THEN and so on, these words are my full control flow facility. 2022-05-08 11:27:56 It encourages factoring - instead of IF ... THEN I have a word : foo ... ; 2022-05-08 11:28:12 Loop bodies become a factored word, etc. 2022-05-08 11:29:24 It is slightly inconvenient to have to always have a second word when a loop needs a brief initialization - I have to have the init in a word and then the body in another word. 2022-05-08 11:29:32 But I *can* do that like this if I want to: 2022-05-08 11:29:52 : foo : bar ; 2022-05-08 11:30:04 I usually write that on two lines. 2022-05-08 11:30:24 The recurse words always target the latest defined name. 2022-05-08 11:30:49 I've thought about having some terse character, like | maybe, to "drop that mark." 2022-05-08 11:31:22 That would avoid having another name in the dictionary. 2022-05-08 11:31:45 I'd usually use .: for that second name, though, and then .wipe to unlink it. 2022-05-08 11:33:16 Anyway, instead of a long-ish definition with control structures, I usually wind up with a short list of small definitions, with all of them but one defined with .: for later unlinking - that whole little list of words "goes together" as a structured item. 2022-05-08 11:33:40 And they have to be studied and understood as a group. 2022-05-08 11:39:54 Anyway, I'm digressing from your question; sorry about that. Yes, I find having the option to retain at least some arguments to a word to be very useful in certain cases. In some cases I recommend having both capabilities, drop and retain, with a systematic naming convention. 2022-05-08 11:45:27 Those conditional words are where I have it pervasively - so far as "regular words" go I only added a .?? version in a handful of cases. .. is nice for peeking at the stack while debugging. Just . with the "pre . convention" applied. 2022-05-08 11:46:08 You know - since it's so hard to type "dup ." :-) 2022-05-08 15:48:25 KipIngram: Thanks for your input 2022-05-08 15:48:31 And thanks too MrMobius 2022-05-08 16:11:23 ACTION was away for a while and it's mothers' day 2022-05-08 17:06:48 Apparently, keep hearing about it 2022-05-08 17:06:53 Not in the UK though 2022-05-08 17:07:39 Yeah, Mother's Day is kind of a Madison Avenue invented day. 2022-05-08 17:07:54 Madison Ave. == advertising industry HQ in the U.S. 2022-05-08 17:07:58 We have a day called Mothering Sunday in the UK 2022-05-08 17:08:07 On another day 2022-05-08 17:08:10 That's why they called the show "Mad Men." 2022-05-08 17:08:58 I think they cooked up Valentine's day, at least so far as it being a "card giving affair" too. 2022-05-08 17:09:23 Anything they can come up with to get us to open our wallets. 2022-05-08 17:10:10 Saint Valentine is said to have sent letters to the female head of a household, signed "Your Valentine" 2022-05-08 17:10:47 The love heart I think is a medieval invention, although the holiday has long had a somewhat romantic angle, even if Saint Valentine was not courting this woman 2022-05-08 17:11:18 Valentine converted that household to Christianity while he was awaiting execution or something 2022-05-08 17:12:51 They used to get boys and girls to pick names of the other sex out of a box... maybe on Saint Valentine's day, to assign them as husband and wife 2022-05-08 17:16:19 Mothering Sunday fell out of fasion until it was resurrected to mimick the American idea of Mother's Day, but Mothering Sunday is really a church day 2022-05-08 17:16:38 where people visit their 'mother church' i.e. the church they grew up at or were baptised at 2022-05-08 17:33:51 Cool - I love learning little tidbits about that. 2022-05-08 17:33:54 sort of thing. 2022-05-08 23:44:19 You know, that cursor position report thing isn't going to work. I could do all the stuff I talked about yesterday, to "make it work right," but it's no good because it blocks the ability to paste multiple lines of code into the system. Because as soon as it finished processing the first line, it would call EXPECT again to get the second line, and that would cause a cursor report request. 2022-05-08 23:44:25 But all the other lines of code are in the way. 2022-05-08 23:45:04 That just turns out to be an effectively useless feature, because you can't use it except when the keyboard buffer is EMPTY. 2022-05-08 23:46:26 I tested it - it just doesn't work. 2022-05-08 23:47:12 What they SHOULD do is push the cursor report to the FRONT of the buffered keyboard input, on the basis that you asked for it NOW, before you asked for anymore keyboard input, so you must want it NOW. 2022-05-08 23:47:18 But they clearly don't do that. 2022-05-08 23:48:27 So, that's got to go. Fortunately, I thought of a better way anyway. Guess it was just percolating the last day or two, because it seems obvious today and it didn't yesterday. 2022-05-08 23:49:35 I can't scan left. But I can start at the beginning of the string and scan right, and count how many right cursor moves it would take to get me to where I currently am in the string (where the insert point is). Well, that's how many left cursor moves I need to make to get back to the starting point. 2022-05-08 23:49:46 A right-going scan is straightforward. 2022-05-08 23:50:01 No cursor report required - and good riddance to it. 2022-05-08 23:54:32 Of course, it's not that they "didn't think it through well enough." It goes again back to the origins of all of this - in the old days all the rest of the keyboard input would have already been sent to the host by the time the terminal got the request for the cursor report. It has no way of getting it ahead of the other input. 2022-05-08 23:55:07 Yes, on my computer here they could have done it better, but they had to maintain a continuity with old function. 2022-05-08 23:55:52 I guess parts of the OS don't KNOW that I'm not on a remote terminal.