2023-05-19 00:11:37 do you use 2swap 2drop 2dup 2over? 2023-05-19 00:12:11 I'm wondering if implementing them, I don't have numbers separated in two cells like in forth 2023-05-19 00:12:55 and I almost never manipulate the stack, only dup and swap 2023-05-19 00:28:27 vms14: i 2drop a lot 2023-05-19 00:28:41 vms14: compared to the other 2-words 2023-05-19 00:42:01 I'll consider them 2023-05-19 00:42:26 I'm fighting with the environments as they're broken 2023-05-19 00:42:29 :D 2023-05-19 00:43:02 https://termbin.com/e9sc 2023-05-19 00:43:16 I'm trying to translate the code in the starting forth book to my lang 2023-05-19 00:43:40 there's an exercise that tells you to create a word named CONVICTED-OF 2023-05-19 00:44:01 and another named WILL-SERVE 2023-05-19 00:44:53 other words are the crimes, and CONVICTED-OF is the start, then you put the crimes and WILL-SERVE will say the total of years it's convicted 2023-05-19 00:45:10 which is mainly a variable that CONVICTED-OF sets to 0 2023-05-19 00:45:28 the crimes increment it and WILL-SERVE just displays it 2023-05-19 00:45:54 it turns that I've : convicted.of 0 :total ; 2023-05-19 00:46:02 : homicide 20 total + :total ; 2023-05-19 00:46:15 and it works, but it shouldn't 2023-05-19 00:46:17 xD 2023-05-19 00:46:44 environments are broken, cause HOMICIDE should not see the variables of CONVICTED-OF 2023-05-19 00:47:34 for some reason total ends being global and when I try to push the environment on the stack it's like its looping forever 2023-05-19 00:47:57 so another rewrite it seems :D 2023-05-19 01:12:22 oh, i've fixed them 2023-05-19 01:13:07 they were broken at compile time, when compiling :total I return a function that when executed will create this variable with an element from the stack 2023-05-19 01:14:02 but when executed the function used the runtime environment (the environment at the moment it's executed) and not the compile time environment 2023-05-19 01:15:09 so it was adding stuff on the root environment as it's when the word is executed 2023-05-19 09:29:03 So, I think this one bit that I've described is a significant part of how to set up these macros. I.e., to execute a general binary operation, I want a macro to "prepare" for the operation and a macro to "do" the operation. The primitive for that operation will just run those in sequence, "prepare," "do." And on a CISC platform where the operation can be done directly on memory, the "prepare" macro will 2023-05-19 09:29:05 just be empty. That should cover all of my binary operations. 2023-05-19 09:30:59 Then some macros will be the same on both types of platforms - those will be the ones that generall just involve moving data, without any "computation" done on it. 2023-05-19 09:33:29 I need to look at my Python program that generates the conditional returns and loops, and think about how to translate that to Forth. Not sure that will be particularly easy - it exploits Python's friendly string handling quite a lot. 2023-05-19 09:34:00 But maybe that will lead me to invent some nifty new Forth mechanisms. 2023-05-19 09:34:40 like quasi-literal strings and such? 2023-05-19 09:35:16 Yeah, Python dictionaries and so on. 2023-05-19 09:35:50 I had a set of parallel tables. One tabulated the machine code differences with varying compare case, another had the info to differentiate the name strings, etc. 2023-05-19 09:36:16 Those primitives are all just alike except for slight differences in name and precise opcode. 2023-05-19 09:36:35 One nice thing about doing it that way is that it automatically enforces my "naming standard" for those words. 2023-05-19 09:37:03 It's too many words to just memorize random name strings for them - I needed an "algorithm" for naming. 2023-05-19 09:38:43 Basically it looks like this, where [...] indicates something optional: 2023-05-19 09:39:12 [.][u][0] 2023-05-19 09:39:28 condition is <, >=, etc. - one of those. And case is ; or ;; or me 2023-05-19 09:39:32 ACTION has wasted some time in orb.farm 2023-05-19 09:40:18 The 0 indicates an implicit 0 argument, the u indicates "unsigned," and the . indicates "keep one normally dropped argument." 2023-05-19 09:41:13 If you blow that all the way out it's 144 words. 2023-05-19 09:41:50 And it occurred to me later that "nothing" is also a valid case - that would be the word that just creates a flag. 2023-05-19 09:42:56 But I mostly don't have those flag words right now and I don't really find that I miss them. 2023-05-19 09:43:22 Not sure it's worth 48 more words for the rare case where a flag might be convenient. 2023-05-19 09:49:25 But I'm also realizing that a similar technique would be useful for all of the commutative binary operatons. +, and, or, xor, etc. should all be identical primitives, save probably a single byte. 2023-05-19 09:49:54 Not as big a payoff there - the number of words involved is a lot less. 2023-05-19 09:51:57 I guess in Forth I could create a defining word that took parameters and generated the right code. I'd still have to have a line for every word, but at least I wouldn't be calling out the full machine code for every one. 2023-05-19 09:52:39 CONDITIONAL 2023-05-19 09:52:52 That's kind of an "intermediate" solution. 2023-05-19 09:53:35 But it would still allow typos to byte me. Shouldn't be too hard to write a word that looped over a couple of tables and produces those lines. 2023-05-19 09:54:08 But from THERE it's probably not much harder to skipping the intermediate step and just modifying the dictionary directly. 2023-05-19 09:57:28 Maybe I create a TABLE defining word that when executed will iterate through a table of items, putting each one on the stack in turn and executing the word compiled immediately after. 2023-05-19 09:57:41 TABLE foo 2023-05-19 09:57:51 : bar ... foo ; 2023-05-19 09:58:03 Or 2023-05-19 09:58:49 foo would load a table item, call , load the next item, call again, etc. until it had exhausted the table, and then would let execution pass on beyond . 2023-05-19 09:59:10 Table would be terminated with zero. 2023-05-19 10:43:50 Heh. Running strace on my Forth is kind of fun. 2023-05-19 11:04:44 So I read a bit last night on the xchg operation in processors. In CISC processors you can xchg with RAM, and that is an atomic operation. 2023-05-19 11:04:55 This appears to bring potential performance bottlenecks. 2023-05-19 11:05:34 What's usually done instead on RISC is that you execute a sequence of instructions, and one of the results of that sequence tells you whether it was interrupted or not. If it was interrupted, the operation "didn't happen," and you iterate on that until it's successful. 2023-05-19 11:05:46 So it avoids actually locking anything. 2023-05-19 11:08:06 But those performance bottlenecks are there on CISC as well, so anytime we xchg with RAM, or "OR" into RAM, or add into RAM or whatever, we're exposing ourselves to that risk. 2023-05-19 11:09:06 Anything that requires both reading and writing the RAM location. 2023-05-19 11:13:59 This is a pretty useful series: 2023-05-19 11:14:02 https://www.youtube.com/playlist?list=PLWK00SLo2KcQi1hlP2_allMWeG19MkQa7 2023-05-19 11:14:23 Some of it (a fair bit of it actually) I already know, but it's adding a bit of depth and integration to things for me. 2023-05-19 11:14:30 I'm using it for work-required continuing education. 2023-05-19 11:14:51 It even counts in the "special" category of "systems/role-based learning" that I have to have a certain amount of. 2023-05-19 11:15:20 They'll accept almost anything for the "general CE category," but then they demand that some portion of it actually relate to your work. 2023-05-19 11:16:20 For "general CE" I've done all kinds of odd things over the years - solar energy technology, etc. Whatever I happened to be interested in at the time. 2023-05-19 11:19:56 I'm sure I could include a bunch of Forth related stuff, and that likely would even count as role-based. But that would feel a little like "cheating." :-) 2023-05-19 11:40:17 X86 performance is so tricky. I read the Anger stuff and got a good idea but even that doesn't always hold on newer stuff 2023-05-19 11:43:22 Yeah - I certainly see why xchg with RAM is potentially performance impacting, but I just hadn't "thought about it" before. 2023-05-19 11:43:50 are there any x86 (or x86-64) bare metal programs dedicated to instruction timings? 2023-05-19 11:44:46 or performance testing in general, something you can run on arbitrary PCs to get an idea of what it's good and at and what it's not, relatively at least? 2023-05-19 11:45:54 I would guess there is, but you hear so little these days about bare metal anything. If it doesn't "integrate with the cloud etc., people seem uninterersted. 2023-05-19 11:46:07 I think you can measure cycles for a section of code 2023-05-19 11:46:26 Back in the late 80's / early 90's the low level stuff seemed more of interest to people. 2023-05-19 11:46:32 SBCL reports processor cycles via TIME 2023-05-19 11:46:41 You could walk into ordinary bookstores and find the computer section shelves lined with such things. 2023-05-19 11:47:43 That stuff is largely "taken for granted" these days. 2023-05-19 11:47:45 (EE departments have also lost some shine, folks want to do CS and big bucks programming these days) 2023-05-19 11:47:52 Yes. 2023-05-19 11:47:57 i guess people forget that all of that vapourware has to actually run on physical hardware at some point 2023-05-19 11:48:04 Yep. 2023-05-19 11:48:39 I bet if you polled the general public only a tiny fraction of them would be able to explain in anything like a correct way how their computer actually boots. 2023-05-19 11:48:51 Doesn't seem all that relevant these days from my point of view. It's just so ungodly complicated now and wasn't like that before 2023-05-19 11:49:15 Yeah, as soon as "protected mode" landed it started getting a lot more involved. 2023-05-19 11:49:20 And has just "gone from there." 2023-05-19 11:50:22 But these days we have access to everything on the net - and even so it can be hard to find such info. 2023-05-19 11:50:33 It's out there, but it can be tedious to dig up. 2023-05-19 11:50:47 Even like when I added the signal handling to my Forth. 2023-05-19 11:50:55 That was HARD TO FIND documentation on. 2023-05-19 11:51:14 Part of the problem there is that it's processor dependent. 2023-05-19 11:51:49 I couldn't tell you right this second exactly how I did it - I'd have to go study the code again. 2023-05-19 11:52:43 But generally speaking, I had to find my Forth register state in the stack and modify it so that when I eventually got back to it it directed me through the error recovery instead of back to wherever I'd called from. 2023-05-19 11:52:59 And what that stack data looks like depends on your processor. 2023-05-19 11:53:14 the signal-to-noise ratio seems to decline as the net snags more of "everything" that the public chucks out there 2023-05-19 11:53:31 in terms of search engines at least 2023-05-19 11:53:33 Finding the path to that particular part of the stack was tedious. 2023-05-19 11:54:14 Yes, definitely part of the problem is that "anyone" can load stuff onto the net these days. And I do regard that as a good thing, generally, but it's bound to lower the S/N ratio. 2023-05-19 11:54:30 that liberty is what makes it great, imho 2023-05-19 11:54:45 Yes - that's why I call it a good thing. 2023-05-19 11:54:57 it's the unscrupulous marketing schemes that target exactly that, which wreck it for everyone 2023-05-19 11:54:57 I'd rather have it this way than not, but there are "costs." 2023-05-19 11:55:09 Absolutely. 2023-05-19 11:55:45 It doesn't suprise me that all the crap that exists online exists. What's surprising (well, not really, but it's "disappointing") is that people FALL FOR IT so reliably. 2023-05-19 11:56:17 I wish we were an at least slightly wiser people. 2023-05-19 11:56:49 But most people just don't put much value on being educated well enough to think wisely. 2023-05-19 11:57:00 i think for most there's no incentive to wise up when you can outsource your thinking so easily 2023-05-19 11:57:05 After all, there's reality TV to keep up with, and Facebook to update, and ... 2023-05-19 11:57:16 You know - "important" stuff. 2023-05-19 11:57:42 Yeah - find a way to benefit without working for it. 2023-05-19 11:59:48 a rational and educated workforce wouldn't work out too well for some segments of the economy 2023-05-19 12:00:01 Harder to manipulate. 2023-05-19 12:00:50 More likely to hold our leaders accountable. 2023-05-19 12:02:09 The thing is, though, I don't know if it's ever actually been any better. I like to think there was a time when it was, but that may just be me misleading myself. 2023-05-19 12:02:48 Maybe Jefferson's "sensible and wise farmer" never really existed. 2023-05-19 12:05:27 Maybe it's mostly been "drunk farmers" the whole time. :-) 2023-05-19 12:06:06 that dandelion wine isn't going to drink itself 2023-05-19 12:06:07 Jefferson used the word "agrarian," I think. Sounds classier. 2023-05-19 12:06:16 What he was really talking about, though, was a land-owner. 2023-05-19 12:06:53 He had it in mind that land owners should primarily control the government. 2023-05-19 12:08:52 i think human nature remains the same over time, look the writings of stoic philosophers as an example of people all those years back dealing with the same moral issues we find today. it's the vices on offer, the problems of the day, and what's socially acceptable which change over time. 2023-05-19 12:09:22 That sounds pretty right to me. We're the same animal. 2023-05-19 12:09:49 That's why it baffles me that people still push for the same old cultural changes that have failed EVERY SINGLE TIME they've ever been tried. 2023-05-19 12:10:02 Usually failing spectacularly, at the costs of large numbers of lives. 2023-05-19 12:11:01 That's a core element of Jordan Peterson's message: "Look, we've tried this. And every time we've tried it, lots of people have died." 2023-05-19 12:11:20 Why the HELL would we go try it again? 2023-05-19 12:15:58 And I definitely don't mean to imply there what I think the way we do things these days is perfect. It's far far from it. 2023-05-19 12:16:22 But there are definitely some mistakes we should try not to repeat. 2023-05-19 12:18:28 Well, I knocked out three of those Linux Internals videos. That's pretty good for today, I think. 2023-05-19 12:20:25 These are handy, because most all of them are discussing things I'm going to want to be weaving into my Forth. 2023-05-19 12:20:51 Memory management, process management, VFS, IPC, etc. etc. 2023-05-19 12:32:28 KipIngram: Now I am curious what these same old cultural changes are, at least from your perspective. 2023-05-19 12:33:25 re vfs and such, feel free to build on the object system I described here few moons ago 2023-05-19 12:34:13 Various forms of highly centralized government control of things. 2023-05-19 12:34:33 Take your pick - Hitler's Germany, Stalin's Russia, Mao's China, etc. 2023-05-19 12:35:10 oh! right, like many here and in the cybercoinz community would refrain: central point of failure. 2023-05-19 12:35:10 Extreme case socialism / communism. I don't mean to be denying the worth of some motion in that direction - just not "too much." 2023-05-19 12:35:28 Yeah. That much power in that few hands is a failed formula. 2023-05-19 12:35:45 That power WILL get used to eliminate adveraries. 2023-05-19 12:36:11 Not just adversaries - anyone the people in control resent or have a grudge against. 2023-05-19 12:36:33 Power corrupts, etc. 2023-05-19 12:37:05 I rather like the concept of smart contracts plus legal agreements. Why? precisely because the former does not depend on the goodwill or whims of folks 2023-05-19 12:37:21 On the other hand, I don't care much for the people who preach "Freedom freedom freedom!" right along while big corporations exploit the hell out of us. 2023-05-19 12:38:02 To me, "freedom" in the noble sense should be about freedom of individual people, not freedom of big organizations. 2023-05-19 12:38:26 Big organizations of all kinds need to be carefuly watched and kept somewhat in check. 2023-05-19 12:38:55 That SHOULD apply to Microsoft and Google just as much as it does "the US government." 2023-05-19 12:39:21 I don't attach much significance to the "private sectoro / public sector" difference. 2023-05-19 12:39:27 "Big" is suspect. Period. 2023-05-19 12:40:12 And besides, the big private sector outfits get in bed with the big public sector outfits anyway. 2023-05-19 12:40:19 So that line gets blurry as hell. 2023-05-19 12:41:14 Government wants to do something that would be unconstitutional, like massive public surveillance? No problem - just strike a bargain with a big company to do it for them. 2023-05-19 12:42:33 Government makes sure that company stays solvent - company shares the data. "Win win." 2023-05-19 12:44:47 And if someone starts to make too much uncomfortable noise about such things, they may have an accident, or get caught with drugs in their home, or develop a sudden case of suicidal depression... 2023-05-19 12:44:52 A philosophical fairness question: The one to make a rule must be responsible for it and its effects. Yes or no? 2023-05-19 12:45:18 I'm uncomfortable with the very idea of "one" making rules. 2023-05-19 12:45:37 But on the surface of that I'd like to say "Yes." 2023-05-19 12:45:47 If you're stuck with such a situation. 2023-05-19 12:46:26 english does not have a untermined number group pronoun that captures it so ‘one’ it was. 2023-05-19 12:47:07 and I mean that the responsibility can not be diffused over a group 2023-05-19 12:47:10 Yeah. I'd like to think that "rules" would emerge from some community process, but even then I'm uncomfortable with a "majority" ramming things down the minority's throat. 2023-05-19 12:47:32 "democracy" has a great reputation, but it's not an automatic formula for goodness. 2023-05-19 12:48:09 it is currently the least bad humanity knows of as a way of governance 2023-05-19 12:48:43 Well, yes - there are many ways in which it's the right approach. I like to add in a Constitution with strict limitations, though - to protect the minorities. 2023-05-19 12:48:52 Certain kinds of rules just completely banned. 2023-05-19 12:49:08 And there is a chicken and egg problem there, for sure. 2023-05-19 12:49:53 I am asking that question as to determine fault/liability/blame kind of thing. 2023-05-19 12:50:46 Well, in a democratic republic like ours, where we don't share how we vote, the only way to look at such a situation is that the impact of laws that have passed through the due process is the "responsibility" of "everyone." 2023-05-19 12:50:54 got thinking about it when staring at a CE marking on an electronics device I was handling. 2023-05-19 12:51:01 So there's no ability to assess specific liability like that. 2023-05-19 12:51:15 "Everyone" would owe "everyone." 2023-05-19 12:51:21 Which isn't helpful in a legal sense. 2023-05-19 12:51:42 nono, I am talking in the sense of ‘who the heck wrote that and why’ kind of thing. Like git blame 2023-05-19 12:52:32 Well, someone drafted the a law of course. But if the law then passes through the political process and gets enacted, I don't think you can hold the author personally respnsible anymore. 2023-05-19 12:52:45 If we approved a bad law, well, it was "all of us" that did that part. 2023-05-19 12:53:04 there made changes in that process 2023-05-19 12:53:30 Could have been, yes. But even if it went through unchanged, I wouldn't approve of imposing damages on the guy that drafted it. 2023-05-19 12:53:56 That's a little like someone slipping in a puddle in your driveway and then suing you. 2023-05-19 12:54:03 ce47d2ea (Giles Cory 1690-03-14) fraternizing with satan 2023-05-19 12:54:08 and no I would not agree with “all of us” as it doesnt jive with the thinking behind the genvea ban on group punishment. 2023-05-19 12:54:44 KipIngram: how frought the word liable has gotten synonymous with legal liability 2023-05-19 12:55:09 Yeah - our litigious society. 2023-05-19 12:55:22 But hey - no one can pass up the opportunity to ram their hand into a deep pocket. 2023-05-19 12:55:30 it is more like ‘why the heck does your driveway not drain properly’ kind of blame 2023-05-19 12:55:50 USA is a litigious society I do not live in such 2023-05-19 12:55:58 And you could probably find *some* issue of that type in almost any home you investigated. 2023-05-19 12:56:10 It's not practical to eliminate them entirely from the world. 2023-05-19 12:56:15 No one even knows what they all are. 2023-05-19 12:56:19 toilet paper hung the wrong way, etc 2023-05-19 12:56:29 I'm willing to hold people responsible for knowing how to walk. 2023-05-19 12:56:59 If your shoes typically slip in wet places (I have a pair that does), then don't walk through the wet place. 2023-05-19 12:57:05 Or if you do, be extra careful. 2023-05-19 12:57:16 thrig: yeah tp should be on a peg that makes the roll perpendicular to the mounting wall 2023-05-19 12:57:21 when I wear those shoes and come to that kind of spot, I step gingerly. 2023-05-19 12:57:39 Because I slipped enough times (though thankfully managed to never "go down") to learn that I needed to. 2023-05-19 12:57:59 We can't make the world "perfect." 2023-05-19 12:58:28 some common sense (like don't put the coffee cup between your legs then sue McDonalds) might be welcome 2023-05-19 12:58:30 Sometimes accidents just happen - it doesn't have to always "be someone's fault." 2023-05-19 12:59:15 My neice just a few days ago slipped down a slight of stairs at her apartment complex where they had just power-washed the sidewalk. 2023-05-19 12:59:35 She probably could sue, but it's unlikely to happen, just becase we generally aren't that type of family. 2023-05-19 12:59:38 Broke two ribs. 2023-05-19 13:00:02 She's going to be fine, though. 2023-05-19 13:00:06 Could have been a lot worse. 2023-05-19 13:00:21 s/slight/flight/ 2023-05-19 13:03:37 Hey, what do you guys think of something roughly along these lines for auto-generating these word flocks into a dictionary? 2023-05-19 13:03:40 https://pastebin.com/PHFKAt9u 2023-05-19 13:03:50 re that kind of stairs: here we have the steps slanted tiny bit inward each 2023-05-19 13:04:11 "gen" would have a stack full of parameters and would generate a single primitive. 2023-05-19 13:04:39 Yeah, there's usually some "better way," and gradually some of those better ways become standard practice, which is good. 2023-05-19 13:05:14 One of the positive aspects of building codes. 2023-05-19 13:05:35 stairs: why? well they often get icy during the winter and it is better to have your foot slide into the inside corner of the step 2023-05-19 13:05:43 Right there along with making electrical wires a certain minimum size because otherwise you get fires, etc. 2023-05-19 13:06:13 Yeah - I wouldn't have "known that," but the IDEA makes total sense. 2023-05-19 13:06:17 of course you need to give regulators teeth so they don't build the apartment from cardboard 2023-05-19 13:06:52 Yes - there is definitely room in the give and take of all of this to make certain kinds of negligence "no longer tolerated." 2023-05-19 13:07:11 I'm just saying that there will likely always be more things we've figured out later than we have now. 2023-05-19 13:07:33 earthquake codes have gotten somewhat better 2023-05-19 13:07:56 I don't hold with people who just blanket condemn "regulation." 2023-05-19 13:08:10 There are positive aspects of regulation. At the same time, it can get taken too far. 2023-05-19 13:08:22 well regulation can also be used to red-tape out new competitors 2023-05-19 13:08:51 There are all kinds of things that COULD be done better that might be CONSIDERED for regulation. The list is endless. 2023-05-19 13:09:04 Just yesterday my wife was shoving the trash down in our kitchen trash bin. 2023-05-19 13:09:15 It opens out, like a drawer, and the trash bin sits in it. 2023-05-19 13:09:23 Anyway, she broke the "drawer." 2023-05-19 13:09:46 I went over there later in the afternoon to look at it, and found they'd used these little tiny < 0.5" long screws to hold it all to the cabinet. 2023-05-19 13:09:49 Nuts. 2023-05-19 13:10:05 I took it all apart and put it all back together with bigger screws. 2023-05-19 13:10:09 Probably won't break again. 2023-05-19 13:10:21 bigger screws cost money, and so does insulation, etc 2023-05-19 13:10:28 One could call it ridiculous that they'd used those itty bitty screws. And one would be right. 2023-05-19 13:10:45 But I think trying to "codify" that would be a little overdone. 2023-05-19 13:25:44 In that paste link above, if I wanted to also generate the "just make a flag" primitives, I'd add a case-null to the list of . 2023-05-19 13:25:58 And modify gen accordingly. 2023-05-19 13:29:53 Every once in a while I remember that brand new Dell laptops kill themselves when you put them in sleep mode and transport them in your bag 2023-05-19 13:31:40 Because Microsoft wants to be able to update your firmware remotely with NSA spyware while it's in sleep mode 2023-05-19 13:34:59 Ugh. 2023-05-19 13:35:05 BIG. 2023-05-19 13:35:14 in bed with big. 2023-05-19 13:35:19 There you go. 2023-05-19 13:36:37 brand old Dells would wake up in the 2000s and make for a toasty backpack 2023-05-19 13:39:07 Just to riff on this general theme, what I would LIKE is for my phone to communicate with nothing whatsoever when I have wifi, cellular, and bluetooth off. 2023-05-19 13:39:14 Nothing - no exceptions, full stop. 2023-05-19 13:39:16 OFF 2023-05-19 13:39:42 When it is in that state and "asleep," the battery should last for WEEKS. 2023-05-19 13:40:08 someone had a lisp on a eink display thingy, they said the battery life was pretty good 2023-05-19 13:43:01 Supposedly they cheated with solar, but it's still good 2023-05-19 13:43:10 I mean it's not like we're living in nuclear winter right now 2023-05-19 13:45:54 This is all why I get yens to build my own "whatever." 2023-05-19 13:46:11 It's the only way I can think of to be 100% sure my gear is "backdoor-less." 2023-05-19 13:47:04 And I bet you dollars to donuts that if I built such a notebook and got it able to do network activity that it would show up on some radar somewhere as a device that was "active but inaccessible." 2023-05-19 13:47:24 It's an interesting question that 2023-05-19 13:58:20 I'll finally betray you :D 2023-05-19 13:58:57 To the dark side of the Forth 2023-05-19 13:58:59 as every iteration of my lang implementations gets closer to lisp, it's obvious what I really want is lisp 2023-05-19 13:59:10 You were supposed to destroy the Lisp, not join them 2023-05-19 13:59:14 :0 2023-05-19 13:59:21 they had cookies 2023-05-19 13:59:38 lispers are just a product of my imagination 2023-05-19 14:00:38 veltas: I always had a lisp in disguise 2023-05-19 14:00:49 to the point I can even say "fort-like" 2023-05-19 14:00:52 forth* 2023-05-19 14:00:59 can't* xD 2023-05-19 14:01:14 Have you tried Haskell vms14? 2023-05-19 14:01:26 yes, but I don't like the war it has with purity 2023-05-19 14:01:40 I like the rest of the language, it's super cool actually 2023-05-19 14:01:53 it has a lot of stuff for algorithms 2023-05-19 14:02:17 but then a string gets impure and haskell cries 2023-05-19 14:02:33 unrelated to Haskell, what do you think of vlang? 2023-05-19 14:02:42 unjust no idea 2023-05-19 14:04:39 forth has served me as a playground to learn about interpreters 2023-05-19 14:04:42 https://github.com/vlang/v https://github.com/vlang/vinix 2023-05-19 14:04:58 it was cool, I've learned some stuff 2023-05-19 14:05:36 well I'm not sure if I'll end with a lisp 2023-05-19 14:05:38 All I can say vms14 is that you'll be back :) 2023-05-19 14:05:47 They always come crawling back 2023-05-19 14:05:54 hahaha I tend to 2023-05-19 14:06:01 I change my ideas every 5 seconds 2023-05-19 14:06:27 but I never made a forth-like, just a rpn lang 2023-05-19 14:06:37 I don't think it's enough to call it a forth-like 2023-05-19 14:06:50 forthlite 2023-05-19 14:06:52 the first implementations were closer 2023-05-19 14:07:34 what's the yardstick for what is a forth? 2023-05-19 14:07:52 unjust: I think being concatenative does not make it a forth 2023-05-19 14:08:02 threading maybe 2023-05-19 14:08:19 and a return stack, which I never had, except at first 2023-05-19 14:08:20 See the topic, having two stacks and being RPN is one definition 2023-05-19 14:08:30 That's quiet loose 2023-05-19 14:08:33 quite* 2023-05-19 14:08:55 now I don't even have a dictionary 2023-05-19 14:09:04 and the dictionary was always a hash, not a linked list xD 2023-05-19 14:09:36 but I've played and now I know how to implement environments properly 2023-05-19 14:09:48 they're linked lists 2023-05-19 14:10:12 by environments I mainly mean lexical scope 2023-05-19 14:11:04 have you tried implementing a system that operates on a queue instead of (or along side) the normal stack operations? 2023-05-19 14:11:19 unjust: a thread queue? 2023-05-19 14:11:28 data queue 2023-05-19 14:11:49 like a shared file named pipe unix sockets? 2023-05-19 14:12:06 I thought about, but no 2023-05-19 14:12:36 if it's on the same program I don't see a difference between a queue and a stack 2023-05-19 14:13:11 I even thought about using pipes as the stack 2023-05-19 14:13:34 I wanted to find a way to "broadcaat" or share the file handles over the pipeline 2023-05-19 14:14:02 but some sort of database makes more sense 2023-05-19 14:14:56 unjust: i'm not sure what makes vlang special 2023-05-19 14:15:03 it seems very average 2023-05-19 14:15:09 veltas: a reason I tend to try with a lisp implementation is the syntax 2023-05-19 14:15:36 code is much cleaner, while on a rpn lang it can easily get unreadable 2023-05-19 14:15:46 also I have total control over every statement 2023-05-19 14:16:21 but aside syntax I have all the features of lisp I want 2023-05-19 14:16:31 mainly cause I use lists as code 2023-05-19 14:16:38 drakonis: i was curious if vms14 had looked at it yet 2023-05-19 14:16:39 except the format function :/ 2023-05-19 14:16:56 I think you'll understand better how to use the RPN if you use it :P 2023-05-19 14:17:25 yes, I try to use it, I tend to make it my own shell to encourage myself to use it more 2023-05-19 14:17:43 but as I'm learning by the process I can't stop rewriting it 2023-05-19 14:18:31 it does not get into a final shape 2023-05-19 14:18:42 and I want to improve debugging features 2023-05-19 14:19:05 it's a super fun process btw 2023-05-19 14:19:29 Good 2023-05-19 14:19:41 veltas: don't you have your own forth? 2023-05-19 14:20:12 I've got a complete one on the ZX Spectrum, I've not finished writing one for the desktop 2023-05-19 14:20:26 z80? :0 2023-05-19 14:20:29 Yes 2023-05-19 14:20:46 But writing a Forth just once lets you learn how they work, and then that's just one part of knowing Forth 2023-05-19 14:20:58 A lot of it is actually writing applications, too, which is a different process 2023-05-19 14:21:10 Starting with a fixed base and extending it, rather than constantly changing the base 2023-05-19 14:21:25 yeah it looks like almost every forthwright learns forth by implementing it first 2023-05-19 14:22:01 veltas: I try to have a fixed base and also as minimal as possible, the rest being provided by words 2023-05-19 14:22:19 but the base does change a lot 2023-05-19 14:22:58 would be interesting to see all changes from the first version if I used a cvs 2023-05-19 14:27:25 I'll try again with rpn 2023-05-19 14:29:51 v 2023-05-19 14:30:05 :0 2023-05-19 14:30:20 vms14: not every one; I used several forths for a year or so before I started writing one 2023-05-19 14:31:06 writing one was mainly what attracted me to forth 2023-05-19 14:31:16 but also colon words and how encourages factoring 2023-05-19 14:31:33 I like colon words a lot 2023-05-19 14:31:45 it's the only thing I'd miss in lisp 2023-05-19 14:32:23 I mean, I like their syntax, how it's much more direct than function name () { ....} 2023-05-19 14:32:31 : name ... ; 2023-05-19 14:32:46 and how everything is a word 2023-05-19 14:33:47 what do you like the most of forth? 2023-05-19 14:35:25 vms14: this took way too long to find again, first i had to remember the guy's handle, then his twitter account before i could even find a reference to this: https://www.youtube.com/watch?v=ZHr5iW2DudQ&t=7815s 2023-05-19 14:35:28 it's a surprisingly useful language that I can understand all aspects of 2023-05-19 14:35:54 his site 0xff.in doesn't appear to be up anymore, but you can get the gist of what it's about if you can find SVFIG-Jan27-2018-The-Case-for-FIFOs-in-Place-of-Stacks.pdf 2023-05-19 14:36:33 or just watch the video 2023-05-19 14:37:18 https://web.archive.org/web/20180829173150/http://www.0xff.in/bin/SVFIG-Jan27-2018-The-Case-for-FIFOs-in-Place-of-Stacks.pdf 2023-05-19 14:37:21 behold. 2023-05-19 14:38:36 drakonis 1+ 2023-05-19 14:38:52 the wayback machine and archive.org are a true boon 2023-05-19 14:38:53 Oh, that looks interesting. 2023-05-19 14:39:38 https://github.com/ForthHub/discussion/issues/62 some discussion on the matter 2023-05-19 14:40:01 https://github.com/ForthHub/discussion/issues/62#issuecomment-374307556 more specifically this 2023-05-19 14:40:42 I don't understand this: 2023-05-19 14:40:45 2 2 3 3 * * + . 13 2023-05-19 14:41:03 I assume the first * multiplies 2 and 2, and the next star multiplies that by 3? 2023-05-19 14:41:06 That's 12. 2023-05-19 14:41:14 then the + ought to give us 15, right? 2023-05-19 14:41:19 * pushes its result to the back of the fifo 2023-05-19 14:41:27 (i assume) 2023-05-19 14:41:38 https://www.youtube.com/watch?v=ZHr5iW2DudQ&t=7650s 2023-05-19 14:41:39 the recording 2023-05-19 14:42:02 OH. 2023-05-19 14:42:03 KipIngram: andreas explained it here https://www.reddit.com/r/Forth/comments/7th72t/the_case_for_forth_fifos_in_place_of_stacks_pdf/ 2023-05-19 14:42:05 Yes, that makes it work. 2023-05-19 14:42:30 2 2 * pushes 4 to the back. 3 3 * pushes 9 to the back. Then 4 and 9 are 13. 2023-05-19 14:42:31 I see. 2023-05-19 14:42:50 But what if there was already stuff on the fifo coming in? 2023-05-19 14:42:55 It has to be clean initially. 2023-05-19 14:43:46 maybe set the URG bit? 2023-05-19 14:43:49 you'd have to block the queue until your compound operation is done, i'd guess, if you were worried about contamination from new input 2023-05-19 14:43:52 So you can't do anything with an intermediate result until you've passed through everything else. 2023-05-19 14:44:09 quotations, innit. 2023-05-19 14:44:45 I don't really fret over stack noodling code anymore, now that I've got my stack frames. 2023-05-19 14:45:00 stack noodling... 2023-05-19 14:45:06 i use stack munging instead 2023-05-19 14:45:12 :-) 2023-05-19 14:45:18 i have seen stack diddling too 2023-05-19 14:45:41 words are something. 2023-05-19 14:47:47 i'm wondering what i should use for debugging these days? 2023-05-19 14:47:57 cutter with rizin or gdb? 2023-05-19 15:09:04 i use gdb, but i write a decent number of custom commands for it in python 2023-05-19 15:10:30 eg for my last dtc forth, i had a forth-level disassember that colorized addresses to make control flow more readable 2023-05-19 15:10:30 https://git.sr.ht/~remexre/stahl/tree/main/item/kernel/src/misc/gdb_exts.py#L16 2023-05-19 15:20:11 ah, neat. 2023-05-19 15:22:34 I'll add a lot of printfs that would only print when a trace flag is on, hoping it will help at debugging 2023-05-19 15:22:34 I'm going to have to digest that Forth fifos thing a bit. 2023-05-19 15:22:38 I'm not sure about it yet. 2023-05-19 15:23:48 for example searching for a word, will print every package it's searching in 2023-05-19 15:24:24 I never want to do that because it's not a macro, but a function and will always be executed, just to test the flag is 0 2023-05-19 15:25:20 but after all when something happens I add prints on random locations to find the bug 2023-05-19 15:25:38 this way I would just turn the trace on, as the prints will be there already 2023-05-19 15:27:03 do you put any constraints on your forth, or limit something, like having some kind of strictness? 2023-05-19 15:27:23 I assume no 2023-05-19 15:27:37 forth requires you to know what you're doing 2023-05-19 15:27:57 I never do :/ 2023-05-19 15:44:32 I don't see any reason why that nested table processing stuff I pasted earlier shouldn't work just fine. 2023-05-19 15:45:27 I edited the paste - as it stands now the "key word" in it is called "iterate-on." That's unlikely what I'd actually name it (too verbose), but the paste was intended to be informative. 2023-05-19 15:46:09 It will just pass table items one at the time to the word in the cell following iterate-on, and when it comes to the null table termination will clean up and hop over that word. 2023-05-19 15:57:08 I think this achieves iterate-on: 2023-05-19 15:57:12 : (iterate-on) .@++ .0=; swap >a r@ a>r execute r> me ; 2023-05-19 15:57:14 : iterate-on { (iterate-on) 1 } r> 4+ >r ; 2023-05-19 16:42:11 Ok, that's not quite right, because among other things I forgot about address<->offset conversion. But I made it work: 2023-05-19 16:42:21 create table 1 , 2 , 3 , 4 , 5 , 0 , ok 2023-05-19 16:42:23 : test table iter . ; ok 2023-05-19 16:42:25 test 1 2 3 4 5 ok 2023-05-19 17:11:01 Ok, final form: 2023-05-19 17:11:03 .: act a>r a> h@ base.h @ + exec r>a ; 2023-05-19 17:11:05 .: (iter) .@++ .0=; swap >r act r> me ; 2023-05-19 17:11:07 : iter r>a a>r { (iter) 2 } r> 4+ r> ; 2023-05-19 17:11:17 don't know where that extra line feed came from. 2023-05-19 19:46:39 Ok, so that wasn't quite right. I had the word being iterated over dropping each item, but that drop needs to happen inside iter instead. Doesn't matter for single-deep iteration, but to nest properly it needs to be done that way. 2023-05-19 19:46:56 I adjusted that and tested out a double-nested iteration, and that works just fine. 2023-05-19 20:27:42 Well, that fifo paper still isn't entirely clear to me. He hints at some interesting things, but doesn't really show any techniques clearly working. 2023-05-19 20:29:29 your fifofu is no good 2023-05-19 20:35:20 maybe the gelFORTH sources are available somewhere 2023-05-19 20:46:08 https://termbin.com/7edmc this is what trace outputs when I interpret 'oh' 2023-05-19 20:46:22 which is a builtin that prints "oh...\n" 2023-05-19 20:47:00 I hope it will end being useful with the time 2023-05-19 20:47:29 it's mainly the kind of prints I would make when finding for a bug 2023-05-19 20:54:39 I don't have more ideas about how to improve debugging 2023-05-19 20:54:49 except for making some sort of debugger 2023-05-19 21:01:11 how is your language currently structured? 2023-05-19 21:02:45 Riviera: rather than a screenshot, you can poke at it if you like: https://risingedge.co.za/eczema/invoice.html (index.html just lacks the invoice.js script) and click the VIEW button to scroll around. it's set for 150 DPI by default, but you can regenerate it with something like 300 TO DPI INVOICE 2023-05-19 21:03:51 only tested it in firefox on linux and android, not sure how other browsers will handle it 2023-05-19 21:08:51 unjust: what do you mean by structured 2023-05-19 21:08:59 I read by words and execute them 2023-05-19 21:09:22 I have some kind of immediate words, like " and [ which build strings and lists 2023-05-19 21:09:32 are the words threaded or prepared perl source? 2023-05-19 21:09:39 but the dictionary does not exist anymore 2023-05-19 21:09:57 I have 3 kind of words, builtin, colon, value 2023-05-19 21:10:27 builtin are perl functions, colon are just an array of words and an environment, value is just a value 2023-05-19 21:10:51 asking as you could probably implement a simple debugger by having an interpreter read the smallest unit of granularity (token?) from a word definition, evaluate it, then prompt you to step in, step over, modify the definition, display the state of the environment, modify the environment or continue 2023-05-19 21:10:54 colon words can also have in their definition any kind of value 2023-05-19 21:11:01 can be the name of a word, but could be an object 2023-05-19 21:11:40 unjust: yes, I had a DEBUG word which just triggered a repl in the middle of execution 2023-05-19 21:11:58 but the way I implement loops does not let me enter with the debugger 2023-05-19 21:14:46 well I can put debug in the loop 2023-05-19 21:15:02 but just an interpreter is not enough 2023-05-19 21:15:18 I lack info 2023-05-19 21:15:50 what sort of info? 2023-05-19 21:16:13 the kind of info trace is printing 2023-05-19 21:16:38 internal steps of the interpreter 2023-05-19 21:16:45 like when finding a word, where it finds it 2023-05-19 21:17:06 what kind of word is, or the interpreter thinks is 2023-05-19 21:17:10 etc 2023-05-19 21:21:57 I also like the fact the trace flag can be set from the language at any moment, so you will only trace the part that interests you, or the whole program 2023-05-19 21:29:00 vms14: some way of reporting the depth of stack at chosen locations can be helpful. 2023-05-19 21:29:36 a .s 2023-05-19 21:30:18 is the first thing I do when something does not work 2023-05-19 21:30:35 I add a .s in front of the word I want to check if it's receiving proper values 2023-05-19 21:30:45 vms14: that info you're referring to is just addresses, right? 2023-05-19 21:30:53 "where words are found," etc.? 2023-05-19 21:31:22 words reside in a hash table 2023-05-19 21:31:29 my $environment = { words => {}, parent => undef }; 2023-05-19 21:31:41 But there's still a location in that table. 2023-05-19 21:31:48 this is the root environment, words reside in $environment->{words} 2023-05-19 21:31:52 Which is no different from a location in a dictionary. 2023-05-19 21:31:55 but see the parent 2023-05-19 21:32:13 when a new environment is created it is like this { words => {}, parent => $environment }; 2023-05-19 21:32:21 it is a linked list 2023-05-19 21:32:27 parent is the current environment 2023-05-19 21:32:29 But it's stored in RAM. 2023-05-19 21:32:36 RAM has addresses. 2023-05-19 21:32:39 but I don't have any address 2023-05-19 21:32:45 no memory allocation here 2023-05-19 21:33:06 Do you have a return stack? 2023-05-19 21:33:17 no 2023-05-19 21:33:33 How do you return? 2023-05-19 21:33:36 the only reason I would want a return stack is to provide tco 2023-05-19 21:33:44 I use the call stack of perl 2023-05-19 21:34:07 IF is just perl's if 2023-05-19 21:34:19 do.times is a perl for loop 2023-05-19 21:34:24 do.list the same 2023-05-19 21:34:35 Ok, let me ask a different way. If you are at some point in your execution, there has to exist a history of who called whom, right? 2023-05-19 21:34:53 no, that's why the trace function 2023-05-19 21:34:54 word you're in, caller of that word, caller of the caller, etc. - all the way back up. 2023-05-19 21:34:59 Being able to print that out is useful. 2023-05-19 21:35:10 I had a $current_word variable 2023-05-19 21:35:17 For me the return stack holds that data, but you have to have it somewhere. 2023-05-19 21:36:08 the trace will print every time we enter a colon word and its contents 2023-05-19 21:39:17 https://termbin.com/nlh2 2023-05-19 21:39:29 for example this is the trace of executing 'meh' 2023-05-19 21:39:30 xD 2023-05-19 21:39:35 : meh oh oh oh ; 2023-05-19 21:42:48 I also had a @inside array where I put the words we are entering 2023-05-19 21:42:58 and pop when we leave a word 2023-05-19 21:44:09 so : oh meh ah ; : ah error ; ah will print "inside [ oh meh ]" 2023-05-19 21:46:59 I like the trace, althought it can be annoying if it prints all the layers in the environments 2023-05-19 21:47:26 but it is already useful