2023-01-26 01:18:47 Yes, it makes sense. 2023-01-26 01:19:22 No, I wasn't familiar with the distinction between shell and environment parameters. 2023-01-26 06:52:05 This is interesting; I'd never heard the term before: 2023-01-26 06:52:07 https://en.wikipedia.org/wiki/Dark_silicon 2023-01-26 07:28:33 Wow - quite a twist of irony in Rings of Power. I won't give it away, but it essentially being presented in a way that implies the good guys caused their own later problems. 2023-01-26 07:36:59 Stalevar: re: the bash symbols and using $ to get at the value. The conversation last night has caused me to think of the collection of all variables as rather like an associative array. In that context, the "address" is the varible name itself, and just as in Forth the address is something you can apply a "fetch operator" to go get the value instead of the address. 2023-01-26 07:37:19 So is the address and $ is the value. It's a very close parallel. 2023-01-26 07:38:30 In Forth we put the fetch operator after the address, and it's easy for us to regard that address as a specific numerical value, and we put a space in between them. But the idea flow is exactly the same. 2023-01-26 07:39:47 Yeah, kinda like that and in Tcl is like that too 2023-01-26 07:39:51 Stalevar: a slight Forth modification I once thought about, but could never quite convince myself to "try out" was to give the compiler a set of special character values - literally just a collection of characters that would initially be empty but which you could define at any time. 2023-01-26 07:40:31 The effect of these characters would be that they functioned as "stand alone tokens." So even if you found one of them embedded in a word, the word would be split there - basically spaces on each side of a special char would be implied. 2023-01-26 07:40:41 So then you could write @ instead of @. 2023-01-26 07:40:56 It would just allow you to write source without necessarily having to have all of the spaces. 2023-01-26 07:41:07 Of course, you'd be precluded from having those chars be PART of any word name. 2023-01-26 07:41:17 The topic at hand the day I thought of it was JSON parsing. 2023-01-26 07:41:35 I had the notion that with that extension you could write a JSON parser directly using the interpreter. 2023-01-26 07:41:44 But as I said, I never tried it out. 2023-01-26 07:42:10 I just couldn't quite get past the notion that the "space delimited words" is very near the "heart and soul" of Forth. 2023-01-26 07:42:21 The notion of altering that brought me... trepeidation. :-) 2023-01-26 07:42:30 trepidation 2023-01-26 07:42:46 Yeah, I would also keep it, probably 2023-01-26 07:43:04 Of course, I did regard it as something optional, and defaulting off. 2023-01-26 07:43:07 Though strings starting with `." ` is a bit weird 2023-01-26 07:43:15 You could just slap in a character set temporarily for special purposes. 2023-01-26 07:43:40 Maybe it's better to interpret the stuff rather than change the interpreter 2023-01-26 07:43:42 Someone else here suggested the very common sense approach of just making a pre-pass over the json and inserting spaces where needed, and THEN pass it to the interpreter. 2023-01-26 07:43:45 And that would work too. 2023-01-26 07:43:52 Executing user-supplied code is usually a bad idea 2023-01-26 07:44:03 so parsing json in executable context doesn't sound right to me 2023-01-26 07:44:23 Yes, but I'm usually not thinking of my stuff running in a highly public shared system. 2023-01-26 07:44:23 I'd rather not do it at all 2023-01-26 07:44:42 And then you forget about it and run there anyway 2023-01-26 07:44:52 Yeah, that kind of mistake is always possible. 2023-01-26 07:44:59 I think you should probably try to think of it even if you are not going to do it 2023-01-26 07:45:31 Well, as I noted, I never went and did it. :-) 2023-01-26 07:45:51 I just noted that it would be a simple modification, and fairly powerful. 2023-01-26 07:46:02 Such things are at least "interesting." 2023-01-26 07:46:46 anyway, I understand how forth words can consume stuff before it, such as `10 emit`, but how do they consume stuff after them, like `." Hello world!"`? 2023-01-26 07:46:53 Anyway, I thought of it here just because of $ vs. $ 2023-01-26 07:47:05 Or $ / @ 2023-01-26 07:47:20 var $ is better than var$ 2023-01-26 07:47:29 They do that when they're interpreting. 2023-01-26 07:47:36 Usually the word WORD is used for that. 2023-01-26 07:47:37 Like 2023-01-26 07:47:41 CREATE 2023-01-26 07:47:53 Is it different from : .. ; ? 2023-01-26 07:47:55 CREATE has a BL WORD in it that brings the next space delimited word into a buffer. 2023-01-26 07:48:10 The interpreter uses BL WORD to get each thing to search the dictionary for. 2023-01-26 07:48:36 And of course you can use WORD in your own code, but if you do when you run it it will get the next input word at RUN time, not the next word that was there at compile time. 2023-01-26 07:48:53 But, you can also make such a word IMMEDIATE, in which case it RUNS at compile time, and therefore gets the next word at compile time. 2023-01-26 07:49:00 ( is an example. It opens a comment. 2023-01-26 07:49:10 And it uses ")" WORD 2023-01-26 07:49:24 Except it wouldn't use quotes like that - you'd use the numeric ASCII code for ) 2023-01-26 07:49:28 How would code which makes /* */ comments work? 2023-01-26 07:49:32 It just grabs everything up to ) and tosses it on the floor. 2023-01-26 07:49:46 /* would be a word, probably immediate. 2023-01-26 07:50:05 And it would then scan ahead in the input buffer looking for */ and move >IN just past */ in the buffer. 2023-01-26 07:50:17 You can't use WORD for that because */ is multiple characters. 2023-01-26 07:50:33 You could look for / alone, but then a / in the body of the comment would get found. 2023-01-26 07:50:48 But it's the same idea, /* just goes and studies the text input buffer and adjusts the input pointer. 2023-01-26 07:51:17 In traditional systems the text input buffer is TIB and the index into it is >IN 2023-01-26 07:51:48 So >IN @ 1+ >IN ! will skip one char of input, etc. 2023-01-26 07:52:01 Or 1 >IN +! would be cleaner I guess. 2023-01-26 07:52:49 There are some interesting games you can play by meddling with >IN; on one occasion I did some timing tests of my interpreter by having a word that conditionally reset >IN to zero. 2023-01-26 07:52:58 If you do that, you just begin interpreting your whole input line again. 2023-01-26 07:53:15 So I interpreted various lines of input like a million times and timed it. 2023-01-26 07:54:02 I have a word uet that returns two items on the stack. Top item is the current UET second, and the next item down is current UET microseconds within that second. 2023-01-26 07:55:09 So, even though it's normally said you can't loop in interpreted code, that's not really true - you can. 2023-01-26 07:55:15 It's just not a "standardized" thing. 2023-01-26 07:58:17 tbh I don't really understand why, since, say Tcl, Python, Scheme seem to have no problems interpreting whatever code, even if they have a jit 2023-01-26 07:58:46 Why Forth can run some code directly and other only within compiled words? 2023-01-26 08:03:50 Well, to some extent just because that's become the traditional way. I just described a case to you where it's normally said "you can't do that," but it turns out that you can if you're willing to be "clever." 2023-01-26 08:04:19 Basically Forth can "do" most anything - it's just than in some cases standardized ways of doing "whatever" haven't never been codified. 2023-01-26 08:04:59 Also, there are some Forth systems, not very common, that take your input line and compile it to a temporary buffer and then run that compilation, rather than interpreting it word-by-word. 2023-01-26 08:05:18 In those systems you can do anything, but certain things have to be on one line of input in order to do them. 2023-01-26 08:05:40 Why that's not "the standard way" of writing Forth is one again sort of a matter of convention. 2023-01-26 08:06:29 Setting aside that temporary compilation idea and going back to standard interpreters, one reason that sort of thing is often unsupported is because the way of "doing something" in an interpreted line would be very different from how it works in a compiled definition. 2023-01-26 08:06:47 And the words would have to all check state to see whether they were being interpreted or compiled, and that adds complexity. 2023-01-26 08:07:10 The real *purpose* of a Forth system is to develop a compiled application. 2023-01-26 08:07:25 Chuck just made the interpreter able to do the things he thought it needed to do to support that goal. 2023-01-26 08:07:42 He just didn't attach enough value to, say, looping in interpreted code to implement it, and the habit stuck. 2023-01-26 08:08:27 He just needed the interpreter to be nimble enough to let him test his compiled words and so on. 2023-01-26 08:09:25 He didn't want to tackle the additional complexity of making everything work interpreted and compiled. 2023-01-26 08:09:41 I do think the temporary compile method is the right way to go if you want to generally solve that problem. 2023-01-26 08:10:28 Issues would arise if you tried to spread code constructs over multiple lines, like you can do in Python (but you could probably deal with that if you wanted to). But you're encouraged to write very short definitions in Forth anyway, so in some sense multi-line constructs are poor form. 2023-01-26 08:11:03 I try to never write a multi-line definition; my defs are usually in the 40-50 char range. 2023-01-26 08:11:24 Though sometimes I have things like this: 2023-01-26 08:11:28 : foo ... ... 2023-01-26 08:11:32 : bar ... ... ; 2023-01-26 08:11:37 Note the absence of a ; at the end of foo. 2023-01-26 08:11:51 That causes foo to execute the code in the bar def as well. 2023-01-26 08:12:01 So strictly speaking that makes foo a two-line definition. 2023-01-26 08:13:22 Usually I would do something of that sort because the bar code is a loop, and the foo code is the loop init. 2023-01-26 08:13:39 In a lot of cases I'll make bar a transient name that gets removed from the dictionary later. 2023-01-26 08:14:24 so that is a two-line def, but in my opinion it has the readability of two one-line defs. 2023-01-26 09:17:19 Wait, : foo ... : bar ; isn't a syntax error? I mean, don't you need a second semicolon? 2023-01-26 09:18:20 KipIngram, does one semicolon terminate all nested colons? 2023-01-26 09:18:49 And I don't understand why you won't write 2023-01-26 09:18:59 : foo ... ... 2023-01-26 09:19:10 ... ... ; 2023-01-26 09:19:12 instead 2023-01-26 09:19:33 just use a tab or four spaces as indentation whether you continue the definition? 2023-01-26 09:39:25 Stalevar: Bear in mind KipIngram's forth is his own. It's not a 'standard' forth and not particularly normal 2023-01-26 09:39:51 There are plenty of forthers who write long definitions over multiple lines, there are advantages and disadvantages to both styles 2023-01-26 09:40:23 three and a half spaces for indents is a good compromise 2023-01-26 09:40:32 There's nothing wrong with KipIngram's forth and I like many of his ideas, but I wanted to throw a little cold water on this conversation which I think had a risk of misleading you and spectators 2023-01-26 09:41:17 thrig: I tend to use 3.44448 spaces these days 2023-01-26 09:41:49 : defs don't "nest." 2023-01-26 09:41:52 Or 2023-01-26 09:42:11 In my system a : just makes a dictionary entry for and aims it's PFA at the current next compile location. 2023-01-26 09:42:26 ; compiles a return instruction and exits compile mode. 2023-01-26 09:42:34 And that's how most forths work 2023-01-26 09:42:42 Yes. 2023-01-26 09:43:19 Some of the folks here have experimental constructs that amount to putting anonymous word definitions in the midst of another definition, but that's not a standard behavior. 2023-01-26 09:43:50 I think the way they do that is compile the nested anon def in place, but have the outer definition jump around it. 2023-01-26 09:44:08 That's just the most straightforward way to do it from a memory management perspective. 2023-01-26 09:44:44 Stalevar: Regarding why some words only work in compile mode, it's because they are designed to write the correct code in a colon word. If you use e.g. IF outside a word then it will just add a branch instruction with a default offset, and push its location to the stack. A corresponding ELSE or THEN is expected to take that location to link the jump 2023-01-26 09:44:58 Did all that message send? 2023-01-26 09:45:03 It finishes with "the jump" 2023-01-26 09:45:13 Yeah. You could make it all work, but it would involve a whole bunch of checking STATE and deciding what to do and so on. 2023-01-26 09:45:24 And some forths probably do 2023-01-26 09:45:34 Yes - pretty much everything is out there somewhere. 2023-01-26 09:45:47 one of the gforth authors had an article hating on STATE 2023-01-26 09:45:47 As I noted earlier, I've done some work with looping on the input line. 2023-01-26 09:45:48 But also what's the cost of just writing a definition, it even documents what you're doing a bit more 2023-01-26 09:45:55 And lets you repeat what you did easier at interpreter 2023-01-26 09:46:05 And it can be FORGOTTEN or MARKER'd away 2023-01-26 09:46:16 thrig: Yeah; there are other ways to do it that involve having the interpreter and the compiler being separate words. 2023-01-26 09:46:39 STATE has issues and is one of the many reasons to avoid trying to be smart 2023-01-26 09:46:44 Liz Rather thinks that makes cross compilation more straightforward. 2023-01-26 09:46:52 Just have IMMEDIATE and non-IMMEDIATE. No nead to complicate 2023-01-26 09:47:17 Yes, you could give words two CFA/PFA pairs. 2023-01-26 09:47:24 One for interpret, one for compile. 2023-01-26 09:47:42 Though that wouldn't eliminate STATE, would it? 2023-01-26 09:47:48 You'd still have to know how to make the choice. 2023-01-26 09:48:18 But yeah, STATE is thought of as one of the rough edges of Forth. 2023-01-26 09:48:22 BASE is as well. 2023-01-26 09:48:51 I've solved the BASE issue for number input, but I still have it around for output. 2023-01-26 09:49:12 Forth is BASEd 2023-01-26 09:49:30 And STATEd 2023-01-26 09:50:31 ACTION EXECUTEs KipIngram 2023-01-26 09:52:31 retro-mentioned IF crc EXPECT ELSE KipIngram ACCEPT THEN 2023-01-26 09:55:36 Hey, can an x64 indexed load from RAM use a negative offset? 2023-01-26 09:55:49 mov rax, [r15-] 2023-01-26 09:55:58 I would guess so 2023-01-26 09:56:16 Me too, but I could imagine it going the other way too, to provide greater forward reach. 2023-01-26 09:56:41 *I* certaainly thing being able to reach both ways is useful enough to do it that way, but you know what they say about assuming. 2023-01-26 09:56:46 Guess I can check it on defuse. 2023-01-26 09:58:45 Yeah, it looks like that works. At least it doesn't object to the code and it puts the number I'd expect in the instruction. 2023-01-26 09:58:50 https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html 2023-01-26 09:58:55 I'll take that as assurance enough until I can do a real test. 2023-01-26 10:01:12 Look at page 44 2023-01-26 10:01:32 8-bit displacement is signed, not sure about 32-bit displacement. 2023-01-26 10:01:50 Well it says nothing because it's meant for 32-bit mode, I think the 64-bit mode is just based on the 32-bit mode definitions 2023-01-26 10:01:58 Not easy to check this stuff in the manual 2023-01-26 10:02:28 Page 44 of the volume 2 2023-01-26 10:02:49 "combined 2a,2b,2c,2d" 2023-01-26 10:05:57 KipIngram: Okay on page 49 it says explicitly the 32-bit displacement is sign-extended 2023-01-26 10:06:57 This is what I would expect because any 'massive' 32-bit displacement was probably used to access relatively in negative direction anyway, i.e. 0xFFFFFFFF would have been safely written as -1 displacement in 32-bit assembler 2023-01-26 10:07:46 Good. Thanks. 2023-01-26 10:08:08 I know you already found it out but it's nice to get an 'official' confirmation :3 2023-01-26 10:08:26 Yes; I think the defuse check was good, but not "absolutely hard." 2023-01-26 10:08:38 veltas, tab fts 2023-01-26 10:08:42 ftw, I mean 2023-01-26 10:09:16 I use the tab key on my keyboard 2023-01-26 10:09:20 To output spaces 2023-01-26 10:10:34 tabs make as much sense in text files as all the weird and wonderful control characters, i.e. I don't think they belong 2023-01-26 10:12:11 But tabs make a lot of sense in a terminal, shame nobody understands how to use them 2023-01-26 10:12:34 Makefile does oh wait no that's bad 2023-01-26 10:14:21 tabs are the terminal equivalent of 2023-01-26 10:14:57 Literally, not as a joke or weird stretch, they are literally designed to tabulate data, they can serve a secondary purpose for indentation 2023-01-26 10:14:58 and sendmail.cf ... 2023-01-26 10:20:06 Elastic tabstops ftw? 2023-01-26 10:20:36 veltas, why not to use tabs for tables in text files? Only problem is elastic tabstops aren't universal, otherwise tabs would be ideal 2023-01-26 10:20:36 veltas: that line wouldn't work in my forths... 2023-01-26 10:20:55 It wouldn't work in mine either lol 2023-01-26 10:21:17 Because I used EXPECT and ACCEPT, a nod to KipIngram and anyone else who cares about such things 2023-01-26 10:24:28 If I type a tab in a line I just get a tab byte (9, I think) in my buffer. 2023-01-26 10:30:58 I think replacing control characters with dots or spaces might be a bit more sensible 2023-01-26 10:31:07 in listing 2023-01-26 10:31:15 Not in reality 2023-01-26 10:35:03 Has anyone tried one of these IRC clients: Gamja or Senpai 2023-01-26 10:37:03 nope, the last new irc client I tested had a bug due to the client trying to work around a bug in WSL which probably means I need to write my own irc client 2023-01-26 10:39:17 That would probably be a nice little tractable project. 2023-01-26 10:39:28 Complex eneough to be interesting, but not just a total nighmare. 2023-01-26 10:39:34 intractable, IRC is complicated now 2023-01-26 10:39:58 Well, rats. It just feels like it *shouldn't* be. But oh well. 2023-01-26 10:40:03 The clients I mention because they implement chathistory extension, which means I can stop idling in channels and just join when I feel like joining in the conversation 2023-01-26 10:40:12 presumably I'd ignore most of the ircv3 crap I've heard about 2023-01-26 10:40:22 Yeah this is some of the ircv3 crap 2023-01-26 10:40:59 In my opinion chathistory is not crap, it's crap that we have all these open TLS connections for literally no reason other than to give people a bit of context when they go to actually be active in a channel 2023-01-26 10:41:11 Somebody think of the routers 2023-01-26 10:41:28 it's a pub, or a campfire. people show up, talk, leave 2023-01-26 10:41:37 Exactly 2023-01-26 10:41:59 It's a reason that people hate IRC now and think it should be replaced, because it's assumed you need to buy a bouncer or server to keep your IRC connection active 24/7 2023-01-26 10:42:13 And this is actually dumb, and chathistory solves that 2023-01-26 10:42:26 And we can keep IRC for another 100 years 2023-01-26 10:42:34 hell and good intentions... 2023-01-26 10:42:50 Go read the proposal, it's not long and I don't object to it personally 2023-01-26 10:42:54 Maybe you will find issue 2023-01-26 10:43:13 https://ircv3.net/specs/extensions/chathistory 2023-01-26 10:43:35 As far as I know all this IRC v3 stuff is designed as optional, so it supports dumb IRC clients as well as more featureful ones, as it should be 2023-01-26 10:52:43 isnt this ideologically opposed to irc 2023-01-26 10:53:30 i assumed there was a reason the server didnt already do that 2023-01-26 10:54:40 resource constraints 2023-01-26 10:56:37 that is the original reason as keeping such state around in memory or even disk is expensive memoryand disk wise 2023-01-26 10:57:23 KipIngram: I set up a little script to assemble a single X86 instruction with nasm and show the generated bytes 2023-01-26 10:57:38 the other reason is that irc is pretty much ephimerical in the sense of a pub or camp fire 2023-01-26 10:57:53 could be useful for noodling around and checking things like addressing modes 2023-01-26 10:58:16 also rasm2 from radare2 is useful but couldn't get it to work on latest Ubuntu 2023-01-26 11:13:24 Oh, nice. I generally use that web page for that, but that sounds like a nice gadget to have. 2023-01-26 11:54:40 MrMobius: I am leaning toward specifying my "portability operations" (virtual instructions I implement primitives with) as just byte sequences. 2023-01-26 11:54:56 In that case I'd use some assembly process to get them, and then just transfer them to the Python. 2023-01-26 11:55:06 That's the layer that would need to be written for each platform. 2023-01-26 11:55:31 Then everything beyond that would make symbolic references to those operations, or else be expressed as sequences of xt's. 2023-01-26 11:56:10 I've started writing all this, but at the moment I'm still kind of "exploring how things seem to be unfolding" and making on the fly adjustments. 2023-01-26 11:56:17 I'm sure it'll "firm up" before long. 2023-01-26 11:57:31 I will need have some intelligence in that layer (i.e., it won't be PURE pre-determiend byte sequences). Like, decrementing a register is one of these items, and it'll need to know how to integrate a register specification into the created code. 2023-01-26 11:58:05 On x64 that looks like 0x49, 0xFF, and then a reg dependent byte. 2023-01-26 11:59:13 For r14, that byte is 0xCE. 2023-01-26 11:59:52 I'm guessing it's 0xC0+, where runs from 0 to 0xF. 2023-01-26 12:06:15 Zarutian_iPad: Yes but I don't live in the pub, but most people seem to 'live' idling on IRC. IRC isn't a pub, it's IRC. And technologically it seems redundant to enter a channel and have to say "Hi guys what are you talking about?" and get people to repeat context to you 2023-01-26 12:06:20 Seems like a job for a computer 2023-01-26 12:39:09 KipIngram: ya all kinds of advantages to a tokenized system 2023-01-26 13:30:19 `2 3 +` -> puts 2 into the stack, puts 3 into the stack, pops the latest 2 operands from the stack and apply + on them, right? 2023-01-26 13:31:05 probably also need a \n somewhere in there, too 2023-01-26 13:31:51 yeah that's detail i guess 2023-01-26 13:31:59 what about `1 2 3 +` ? 2023-01-26 13:33:19 there are probably forth you can feed such examples too 2023-01-26 13:39:34 rendar: well, work it out 2023-01-26 13:39:38 rendar: walk through each step 2023-01-26 13:39:59 rendar: what state would the stack be in, after every thing in "1 2 3 +"? 2023-01-26 13:40:59 gordonjcp, no, i know that, my point is different 2023-01-26 13:41:25 rendar: okay, what was it? 2023-01-26 13:41:41 if i have `1 2 3 +`, when the parses comes to + it will pop the latest values from stack, 2 and 3, then it will add 5 to the stack, and the functions terminates 2023-01-26 13:41:51 aha no 2023-01-26 13:41:54 it doesn't pop futher values, because it already added 2 operands 2023-01-26 13:42:01 nothing will terminate 2023-01-26 13:42:07 why? 2023-01-26 13:42:10 well, the word that interprets the input buffer will 2023-01-26 13:42:13 I guess 2023-01-26 13:42:20 don't think in terms of functions 2023-01-26 13:42:36 Forth doesn't have functions 2023-01-26 13:42:49 word. 2023-01-26 13:48:23 yes 2023-01-26 13:48:30 the word + will pop 2 args, right? 2023-01-26 13:48:35 2 and 3, but not 1 2023-01-26 13:48:41 if i have `1 2 3 ++` then i will get 6 2023-01-26 13:50:37 + + not ++ 2023-01-26 13:50:41 wordn 2023-01-26 13:50:50 words are whitespace delimited 2023-01-26 13:51:14 but yes, + normally will pop two values and return one 2023-01-26 13:51:40 i see 2023-01-26 13:51:47 yeah, `1 2 3 + +` 2023-01-26 14:46:27 2-ROT or -2ROT 2023-01-26 14:46:34 Or neither 2023-01-26 14:47:51 whether tis nobler to suffer the slings and arrows of outrageous fortune ... 2023-01-26 14:48:36 You're a card thrig 2023-01-26 15:31:04 rendar: if that 1 2 3 + was your entire input line, then the processing of that line terminates after +. The word that did that for you returns to it's caller, which is an infinite loop. 2023-01-26 15:31:21 It will print the ok prompt, do a line feed, and then ask you for another line of input. 2023-01-26 15:31:38 At that point you will have 1 5 on the stack to work with via words on the next line. 2023-01-26 15:32:10 The outermost loop, which is referred to as the outer interpreter, goes through an infinite repetition: 2023-01-26 15:33:01 1) clear return stack, 2) read an input line from the terminal, 3) call an "interpret" word, 4) print ok prompt, 5) loop to 1. 2023-01-26 15:33:06 The interpret word does this: 2023-01-26 15:33:38 1) parse a space delimited word from the input line, 2) see if it's in the dictionary, 3) if not, try to convert it to a number, 4, repeat. 2023-01-26 15:33:49 There are various ways of knowing when to return from that second loop. 2023-01-26 15:34:31 I do it by having the null string be an immediate word which "double returns." So when the interpret word executes it, it returns, but not to the interpret word (which is its caller). It returns an extra level to the outer interpreter. 2023-01-26 15:34:47 If the number conversion also fails, an error gets thrown. 2023-01-26 15:35:07 That prints an error message and then clears the DATA stack and re-starts the outer interpreter. 2023-01-26 15:35:25 It does something slightly different in mine, but mine's non-standard in that regard. 2023-01-26 15:35:47 That right up there ^^^ is the process that's always going on in Forth. 2023-01-26 15:37:34 One neat thing is that in the process of doing all that stuff the system might get the return stack as deep as a couple dozen items. But when it calls a word you type at, in that second layer, there's only a couple items on the return stack. 2023-01-26 15:37:50 So YOUR return stack requirements don't stack on top of the system's maximum return stack requirements. 2023-01-26 15:38:30 The outer interpreter clears the return stack, and when it calls interpret that pushes one address. Then when interpret calls your word that's a second item, and that's it. 2023-01-26 15:39:31 My system takes a snapshot of the entire system beforer asking you to type a line of input. If that line leads to an error, it restores that state. 2023-01-26 15:39:50 That way an error doesn't foul up your work in any way - anything that's been done "so far" gets abandoned. 2023-01-26 15:40:06 Wasteful of RAM, of course, but... I've got plenty. 2023-01-26 16:11:06 Oh, the other significant thing that should be mentioned is that the interpret word decides whether to execute or to compile each of the words. It's aware of when you're inside a word definition and it will then compile rather than execute. The variable STATE indicates which one to do in most systems. 2023-01-26 16:52:27 KipIngram, i see 2023-01-26 16:52:40 KipIngram, thank you for your awesome explaining, did you write a Forth interpreter in c? 2023-01-26 16:59:19 I did at one point in time, yes. In gcc - it required a gcc-unique extension. 2023-01-26 16:59:24 Pointers to labels. 2023-01-26 16:59:56 It worked nicely but wasn't very pretty to look at. I used c macros, and it got fairly ugly. 2023-01-26 17:00:24 But it actually worked the way a Forth should - it wasn't just a big switch statement. 2023-01-26 18:52:24 You know, I don't think I fully agree with the folks who panned Rings of Power season 1. I think they pulled the story to a nice tight season conclusion and did so in a way that you didn't just "see coming." 2023-01-26 18:53:05 Now that the cards are all on the table (I finished the season this afternoon) it's clear to me how they're tracking the actual tale. 2023-01-26 19:02:00 hmm… anyone else here have looked into using Infocoms ZSCII text encoding? 2023-01-26 19:02:31 for use in dictionary entries and text strings 2023-01-26 20:17:10 Oh, interesting. 2023-01-26 20:17:23 So it gets us single character codes for function keys and other such? 2023-01-26 20:17:29 I'd never heard of it before. 2023-01-26 20:18:10 more like you can stuff three chars or so per two bytes or 16 bit cell 2023-01-26 20:19:25 say you got a five char word string, say CMOVE 2023-01-26 20:20:03 then one needs only two such cells to store it 2023-01-26 20:20:51 one code switches to allcaps and then the five letters 2023-01-26 20:22:05 and the MSB is used to tell if there more cells in the zscii string. Meaning we got pretty much self delimited strings 2023-01-26 20:23:03 https://www.inform-fiction.org/zmachine/standards/z1point0/sect03.html 2023-01-26 20:27:53 Oh, that's better than the doc I found. 2023-01-26 20:38:36 plus one can use the A2 extendsion coding to output control characters and utf-8 2023-01-26 20:41:54 Heh. XYZZY :-) 2023-01-26 20:44:50 syzygy 2023-01-26 20:49:34 Z Machine is single stack? 2023-01-26 20:53:23 You know, it occurs to me that modern AI could probably be applied to improve the "prose" of an adventure style game considerably. 2023-01-26 20:53:46 I expect they're getting close to being able to produce stuff you didn't know a talented person didn't write. 2023-01-26 20:54:06 I'm not talking about crafting a large plot - I'm talking about describing objects, scenery, and so on. 2023-01-26 20:54:13 Relatively "immediate" information. 2023-01-26 20:54:44 Even way back in the 1970s/80s there was an AI technique called "frames" that gave programs a pretty sensible seeming grasp on "situations." 2023-01-26 20:57:10 until a marine jumps into a cardbox box and confuses darpa robot 2023-01-26 20:57:37 Solid Snake style? 2023-01-26 21:01:10 https://www.extremetech.com/extreme/342413-us-marines-defeat-darpa-robot-by-hiding-under-a-cardboard-box 2023-01-26 21:13:15 hahahah... I love it when AI completely gaffs. 2023-01-26 21:14:06 they also did the Macbeth treatment 2023-01-26 21:29:19 There sure does seem to be a big emphasis in that z-machine stuff on compactness. 2023-01-26 21:29:26 I guess that has to do with it's age. 2023-01-26 21:30:49 and that fact that Infocom was targetting home compputers like Apple ][ or Commidore 64 2023-01-26 21:35:51 Yeah. 2023-01-26 21:36:21 So it looks it'll be pretty easy to write a Python progrma to generate one of the hierarchical menu calculator programs. 2023-01-26 21:36:31 It's a fairly simple layout - just long and tedius. 2023-01-26 21:36:33 tedious 2023-01-26 21:36:39 the pattern is like so: 2023-01-26 21:37:21 clear menu, "string", key 1 goto ??, string, key 2 goto ??, ... key 6 goto ??, menu, stop, load up the labels for the keys, display it and wait. Repeat. 2023-01-26 21:37:57 Then at one of the LBL ?? you have another pattern for the next level down, and so on. 2023-01-26 21:38:09 Eventually you reach the leaves, which actually do something. 2023-01-26 21:38:38 Looks to me like the python's primary task would be to allocate local labels for you so you don't have to do it manually. 2023-01-26 21:38:48 And just type it for you. 2023-01-26 21:39:17 Should be pretty easy to device a hierarchical list layout that the code could easily traverse. 2023-01-26 21:40:17 I'm not quite sure why the sample program I'm looking at uses KEY ii GOTO ?? for some items and KEY ii XEQ ?? for others. 2023-01-26 21:40:50 I guess XEQ would bring you back to the same menu level, whereas GOTO would exit the menu system altogether. 2023-01-26 21:41:34 This program I'm looking at is a "constants" program that's loaded up with several dozen constants from various fields of physics. 2023-01-26 21:42:20 It's nearly 500 lines long, and about 2.5k. But it puts the name of each constant in the alpha register, in a rather verbose form; that's probably 80-85 percent of the size. 2023-01-26 21:42:47 I probably wouldn't be interested in that. I'd just use it to remember all the numbers to high precision. 2023-01-26 22:05:24 So, as far as I can tell the best performing way to render text to screen in a GPU setup is to establish a "texture" on the GPU - just a big rectangle that has all of the characters of your font packed into it. 2023-01-26 22:05:42 You'd either be able to compute the desired char's rectangle or (for a variable width font) use a table. 2023-01-26 22:06:01 The apparently you can copy any rectangle from a texture to the screen whereever you like. 2023-01-26 22:06:15 So that way you avoid having to send the bits over on the fly - they're already resident. 2023-01-26 22:06:33 na na na na na na na na blitman! 2023-01-26 22:18:14 Oh, is that what "blit" is? 2023-01-26 22:24:16 maybe not, but there's no good "spritesheet" man like there is for blit