2023-09-11 00:15:12 Nice stuff here: 2023-09-11 00:15:14 https://www.youtube.com/watch?v=aaW30_f2on0] 2023-09-11 00:15:28 Interviewing the 3 Blue 1 Brown guy; I've always enjoyed his channel. 2023-09-11 08:11:38 HI 2023-09-11 08:25:31 Hi. 2023-09-11 08:39:25 lo 2023-09-11 08:40:40 hi 2023-09-11 08:46:17 currently exploring gforth tutorial 2023-09-11 08:56:11 forth changed a lot since the years 2000 2023-09-11 08:59:45 Yes, it's evolved over time. My familiarity with it is mostly "old." 2023-09-11 09:20:14 xcombelle: Do you have an application at hand, or just "satisfying curiosity"? 2023-09-11 09:25:36 xelxebar; I noted yesterday that APL has a line orientation that we don't really see in Forth. One way to make both tools available would be to just allow lines of APL to be dropped in, whereever you like. I haven't decided exactly what the optimum "processing sequence" would be for that, but one possibility would be to scan the line initially to see if it's valid APL, and if it is process it that way. 2023-09-11 09:25:37 Otherwise try to process it as Forth. 2023-09-11 09:25:48 Or you could somehow explicitly say when some APL was coming. 2023-09-11 09:26:37 APL lines with a ← would leave the stack unaffected - otherwise the result would be left on the stack (that would likely be a pointer to the result). 2023-09-11 09:28:48 At the moment I just don't see any good way to intermingle them more tightly than that. They just work in such different ways. 2023-09-11 09:31:24 But they could certainly share data - access to APL would give us all of its tools to create and manipulate arrays, and then Forth could access those arrays in any way it wanted to - they'd show up like regular Forth variables. 2023-09-11 09:33:15 I'd' prefer to NOT have to give an explicit indication of what style a line was - it seems like it ought to be easy enough to just look at the line and make a decision about that. 2023-09-11 09:33:51 My existing approach to error handling would work for APL input too - lines that wound up having an error would just have no effect. 2023-09-11 09:36:03 I do have a concern about that, though - my whole error handling philosophy is quite "expensive" resource-wise and really is only suitable on notebooks / desktops etc. I haven't really figured out how much of it I can port to a 'small system'. 2023-09-11 09:38:14 I did read about a system once that didn't execute the input "on the fly." Rather, it took what you typed at it and compiled it, regardless of whether you were interpreting or compiling. If you were interpreting then it would execute it after it successfully compiled all of it and then throw it away. 2023-09-11 09:38:34 That would provide an opportunity to catch certain types of errors before earlier code on the line modified your system. 2023-09-11 09:38:47 Wouldn't catch "runtime" errors like addressing errors and so on, though. 2023-09-11 10:54:02 KipIngram FORTH is an old love. I love languages. The only two which resist to my comprehension are ocaml and haskell. (And I did not practice enough rust 2023-09-11 10:55:20 what is your your error handling philosphy ? 2023-09-11 11:04:07 a minor channel logging update: forth.chat now has archives of the logs for each year going back to 2000 2023-09-11 11:04:47 xcombelle: Just before I start processing each new line of interpreter input, I make a snapshot of my entire system. 2023-09-11 11:05:05 And then start processing the input. If it runs through without problems, I throw the snapshot away. 2023-09-11 11:05:23 But if any sort of error occurs before I'm done, I restore the system using the snapshot and return to get a new line of input. 2023-09-11 11:05:53 The idea is that after I get a command history working, if I make a mistake on an input line I want to just be able to cursor up to get it back, fix the error, and run it again. 2023-09-11 11:06:08 So I want the state of the system to be exactly what it was the first time I tried to process that line. 2023-09-11 11:06:30 So, it's expensive - I need space for a full system snapshot and it takes time to do those big copy operations. 2023-09-11 11:06:46 But it strikes me as an excellent way to use the wealth of RAM we have on a notebook or a desktop. 2023-09-11 11:07:28 I catch all the usual compiler errors, of course, and also have signal handling code in there to catch invalid address errors, divide by zero, etc. 2023-09-11 11:07:54 Having invalid address errors NOT segfault is awfully nice. 2023-09-11 11:08:21 you could as an alternative record all the input. and replay it (on small system you should not have relocations sproblems 2023-09-11 11:08:33 KipIngram: 2023-09-11 11:09:18 Oh, I see what you mean. Just cold restart and reply all the successful input up to there. 2023-09-11 11:09:25 That's a possibility. 2023-09-11 11:09:53 replay 2023-09-11 11:10:23 it is called a log usually, and is used in database engines. 2023-09-11 11:10:44 Yes, we do something along those lines in the solid state drives we build at work. 2023-09-11 11:11:01 We have a big table in RAM that gives us a logical page to physical page mapping. 2023-09-11 11:11:31 In the event of a power failure, we don't have time to write it off to flash. So we occasionaly snapshot it to flash, and in between we keep a journal/log of all modifications. 2023-09-11 11:11:43 When the log space is full, we do a new snapshot and discard the log. 2023-09-11 11:12:01 So to recover from a power failure we read in the latest snapshot and then use the log to move it up to the right state. 2023-09-11 11:13:27 A very similar approach could work here - I could occasionally snapshot the system to my flash storage and keep a log to get from there to "current." 2023-09-11 11:14:15 Thanks for the idea - given that I'll probably want a way to 'save my state' anyway, it's a good approach. 2023-09-11 11:15:44 if you have some I/O/read clock/IRQ, on the chip during the programmation, it will probably break everything 2023-09-11 11:16:41 You mean during the snapshotting? 2023-09-11 11:16:53 Yeah, I'm sure there will be some delicacies to consider. 2023-09-11 11:17:16 I mean when you replay the log. 2023-09-11 11:17:45 My target right now is the Maxim 32655 - I've got a little board with that guy on it with a nice flock of resources. It's a board that would be easy to mount on a larger board, so i'm looking at making it a "standard controller" for future hardware projects. 2023-09-11 11:17:47 the state would be different 2023-09-11 11:27:55 Yeah. I'll have to give it a careful think through when the time comes. Right now I'm mostly focused on the "vm layer" I'm using. Historically I've done indirect threaded, very straightforward old fashioned systems. 2023-09-11 11:28:29 this time I'm going to have a token-threaded virtual layer, and then the bulk of the system will be written using that. 2023-09-11 11:28:40 Looking like it's going to be very compact. 2023-09-11 11:29:16 And for various reasons I think I can make it of similar performance to my indirect threaded designs. 2023-09-11 11:30:01 The vm layer will look a lot like a token-threaded system, and the Forth running on that will look like a code-threaded system, using the vm instruction set. 2023-09-11 11:30:51 Four or five vm instructions will pack into each 32-bit cell. 2023-09-11 11:30:54 KipIngram: had a look at OpenFirmware FCODE ? 2023-09-11 11:31:07 No, haven't looked at that. I guess I should? 2023-09-11 11:31:30 You know me - I'm prone to just cook up my own stuff and not very prone to go nosing around out in the world. :-) 2023-09-11 11:32:45 well it is how many NICs and other PCI things had/have PROMs on them for minimum functionality drivers and those drivers are in FCODE 2023-09-11 11:33:55 like many techy Icelanders often do we like to look around for good ideas to 'steal' 2023-09-11 11:34:12 sheep? 2023-09-11 11:34:36 I'm quite willing to steal good ideas. :-) 2023-09-11 11:34:58 them too thrig as mutton is delisious 2023-09-11 11:35:21 :-) 2023-09-11 11:35:41 Especially OPM, right? Other People's Mutton? 2023-09-11 11:36:11 I don't think I've ever actually had mutton. 2023-09-11 11:36:26 I live in beef country. 2023-09-11 11:36:51 wool ain't a texas wearable 2023-09-11 11:37:37 No it definitely is NOT. Especially not right now. 2023-09-11 11:37:44 It's been INSANELY hot this summer. 2023-09-11 11:40:11 nowadays, FORTH is probably not an idea to steal. (in professionnal programming) 2023-09-11 11:42:01 I think it's still the best game in town for certain purposes. Most of my background is embedded development, and Forth is great for that. 2023-09-11 11:42:24 Cloud services? Maybe not so much. 2023-09-11 11:42:50 you are the pro here, KipIngram 2023-09-11 11:43:26 xcombelle: However, Forth is just a hobby I'm stuck on. I "found it" in college - it's initial appeal to me was just the RPN (I used an HP calculator), but over time I found other things about it to love. The simplicity and grace of it - just too cool. 2023-09-11 11:44:00 Hardly - I guess in certain areas I can claim professional competence, but definitely not in all of the areas we wind up talking about here. 2023-09-11 11:44:23 I'm a hardware guy by education, who just kind of hacked his way into some amount of software over the years. 2023-09-11 11:44:35 Definitely not a professional caliber software engineer. 2023-09-11 11:46:01 may be one should rename FORTH in FORTH-VM and use it as a compile target. (probably not a good idea) 2023-09-11 11:58:54 xcombelle: I'm pretty drilled in on calculators right now. Been playing a lot with my Swiss Micros DM42, and watching a lot of videos on alternative firmwares, the HP-48 family, etc. Turns out that both the DM42 and that little 32655 board I mentioned are ARM Cortex M4 platforms, with similar amounts of RAM (the DM42 has a bit less than the 32655). So a big part of what I'm targeting here is a system that 2023-09-11 11:58:55 would leverage well onto calculators. 2023-09-11 11:59:17 Been looking at how well I could steal ideas from APL for it this past weekend. 2023-09-11 12:08:08 ARM Cortex M4F, actually. 2023-09-11 12:09:01 F signifies IEEE floating point support? 2023-09-11 12:45:30 crc: Nice (re log) 2023-09-11 12:46:19 xcombelle: There are a few greybeards in here, they don't identify themselves but you can smell them from how people like me scutter away into the corner when they appear 2023-09-11 12:46:55 my beard isn't much grey 2023-09-11 12:47:02 ACTION scutters 2023-09-11 12:47:07 I'm a Forth novice but I have actually written a bit of Forth, and implemented at least one Forth 2023-09-11 12:47:34 That people have used other than myself, even 2023-09-11 12:53:02 by beard is half white half black 2023-09-11 12:53:31 meanwhile I felt pretty young on #tcl 2023-09-11 13:11:17 thrig I havent been there a while 2023-09-11 13:12:42 Yes, the F has something to do with floating point. 2023-09-11 13:13:45 My beard is the least gray part of me. There's some gray in there, but there's also still some dark. On the other hand, the hair on my head would be pretty much solid gray if I didn't color it. 2023-09-11 13:14:02 But my wife is a decade younger; I'm trying not to foist an old man husband on her quite yet. :-) 2023-09-11 13:14:19 veltas: You certainly don't come off as a novice to me. 2023-09-11 13:14:30 I knew a guy that started to get gray hair when he was 14 yo 2023-09-11 13:14:47 I know - it's a 'wild card' kind of thing. 2023-09-11 13:18:26 By and large I feel like I've aged well other than the hair. With it colored people practically always guess at least ten years too young when they guess my age. 2023-09-11 13:21:37 Oh hey, recall the times I've talked about treating all the free RAM as a big ring buffer and just scurry around it taking RAM for various purposes but never giving it back? Just counting on "being done" with each piece by the time it gets used again? 2023-09-11 13:21:49 I decided this morning that should be dubbed the "Hail Mary allocator." 2023-09-11 13:22:26 Since you're sort of just "going for it and hopiNG>" 2023-09-11 13:23:01 well sounds similiar how I treat memory alotted to the objects system I described minus the hail mary aproach 2023-09-11 13:23:53 I guess even the typical way Forth does PAD is along the same lines. Any use of RAM without "officially nailing it down" has the same characteristic and the same potential to fail. 2023-09-11 13:24:37 folks used to use video memory for other things between the refreshes 2023-09-11 13:24:59 but then again that system is meant to be used in an event loop that invokes garbage collection after each 'turn' or iteration of the event loop 2023-09-11 13:43:01 It was really PAD and extensions to the PAD idea that made me think of that in the first place - someone here mentioned a "circular PAD with more than one "slot," and from there it was just a matter of "generalizing it." 2023-09-11 13:43:54 You'd always want to leave some room between the top of the dictionary and the bottom of the Hail Mary zone, because you also need to be done with the lowest addressed stuff by the time the dictionary grows up to there. 2023-09-11 13:44:11 Really, though, I think you wouldn't even start doing it until you got your dictionary into its "ready to go" state. 2023-09-11 13:46:20 A calculator seems like a good target for the idea, because for the most part you tend to just grab your calculator and solve some little problem, and you're done. Repeat over and over, and the "old problems' are of no interest any more. 2023-09-11 13:46:42 It's obviously NOT a good candidate for any one applicatin that's going to heavily stress your system. 2023-09-11 13:47:32 I suppose one could have a "real" memory allocator that could be switched on and off - pay the performance price when you need to and not when you don't. 2023-09-11 14:30:51 i wanted to have some kind of event system, but i guess i'll only have two words 2023-09-11 14:31:12 event and watch(er) 2023-09-11 14:31:27 watcher registers code for an event 2023-09-11 14:31:33 event just executes that code 2023-09-11 14:31:57 so it's just a hash table 2023-09-11 14:33:08 ( " the event was fired' ) 'random_name watch 2023-09-11 14:33:23 'random_name event 2023-09-11 14:34:01 i had something similar for variables 2023-09-11 14:35:51 it would be able to register several handlers and the event will be removed once it's handled by all handlers 2023-09-11 14:36:23 then there's the option to do like apache does with the handlers for a request 2023-09-11 14:36:50 the handler decides if the other handlers run or not by returning a value 2023-09-11 14:37:23 like if it returns true it means it handled the event and does not need to be handled by the others 2023-09-11 14:44:20 thrig: never tried emacs with evil mode? 2023-09-11 14:44:26 you might like it 2023-09-11 14:44:33 it has your f t F T 2023-09-11 14:44:52 I dropped emacs maybe two decades ago. 2023-09-11 14:44:59 i like it, i have both hotkeys 2023-09-11 14:45:42 for example in insert mode i can ctrl f to move forward without having to escape 2023-09-11 14:45:57 i can :w or ctrl x ctrl s 2023-09-11 14:46:15 some hotkeys seem to be overriden by vim 2023-09-11 14:46:51 it makes emacs much better 2023-09-11 14:47:26 the control+whatever stuff was tearing up my tendons, so I dropped emacs 2023-09-11 14:48:44 i was getting crazy with the unihertz's keyboard (like a blackberry) 2023-09-11 14:48:58 but now i can actually code 2023-09-11 14:49:42 it's almost like emacs achieved perfection 2023-09-11 14:49:52 i don't hate it anymore 2023-09-11 16:10:42 i don't like apache's approach 2023-09-11 16:10:59 i always forget to return a boolean on the handler 2023-09-11 16:11:17 and don't even know why i want to stop other handlers 2023-09-11 16:11:46 but i need to return a number or something to be able to clear a handler 2023-09-11 16:12:06 and a handler could clear itself 2023-09-11 17:13:09 KipIngram: What do you mean by line orientation? Not quite following. 2023-09-11 18:19:57 I just meant that it looks like line breaks are meaningful in APL. Like lines are processed one at a time and are self-contained expressions. 2023-09-11 18:20:21 Forth lines are processed one at a time too, as a matter of mechanics, but how you split your code across lines is more or less irrelevant. 2023-09-11 18:21:31 i only read by lines at the repl, and i'd like to change that 2023-09-11 18:21:55 but for example in a file i can have multiline strings with " 2023-09-11 18:22:32 I tend to put entire definitions on my lines - I keep the defs short. But it's equally possible (and often done) to structure Forth in a way that looks somewhat like C, with indentation and so on. 2023-09-11 18:23:00 I don't care for that style, but I can see how someone mostly familiar with C would gravitate toward it, at least initially. 2023-09-11 21:52:59 ok, this is just about the coolest one I've seen yet: 2023-09-11 21:53:02 https://www.youtube.com/watch?v=rGlpyFHfMgI 2023-09-11 22:17:24 Wow - do the rows of Pascal's triangle trend toward normal distributions? 2023-09-11 22:19:02 Because Pascal's triangle does give the path counts through a Galton Board, and it makes normal distributions. 2023-09-11 22:19:43 I plotted the last row of this: 2023-09-11 22:19:46 https://s3-ap-southeast-1.amazonaws.com/subscriber.images/maths/2016/08/01092351/Pascals_Triangle.png 2023-09-11 22:19:53 and it sure looks "normal-ish." 2023-09-11 22:20:56 meanwhile the Sierpiński triangle tends towards chaotic neutral 2023-09-11 22:22:14 You definitely begin to see why the normal distribution is so pervasive. You can take just about any "underlying" distribution and convolve enough copies of it and it goes to the normal distribution. The normal dist is like the "limit" of everything in the case of large numbers. 2023-09-11 22:44:18 KipIngram: APL is pretty much the same. Lines (or really expressions) are just processed one at a time in order. 2023-09-11 22:44:46 You can split multiple expressions on one like with the ⋄ symbol. They evaluate top to bottom, left to right. 2023-09-11 22:47:10 KipIngram: Ah, yes. Pascal's triange does converge to normal. It's essentially a good example of the Central Limit Theorem. 2023-09-11 22:54:15 Just gotta keep in mind that the underlying distribution is the binomial distribution. 2023-09-11 23:44:27 Astounding... 2023-09-11 23:44:29 https://www.youtube.com/watch?v=Yy7Q8IWNfHM 2023-09-11 23:44:47 Yes, I did know about the diamond char. 2023-09-11 23:45:13 But can you go the other way? 2023-09-11 23:45:27 Can you spread an expression across lines in any sort of arbitrary way? 2023-09-11 23:45:44 Without using ← to hold intermediate results, I mean. 2023-09-11 23:46:21 You could in Forth, I think. You'd just leave the intermediate on the stack. Maybe - I'd have to think about the exact behavior. 2023-09-11 23:46:38 I meant you could in an APL+Forth - you can obviously do it in Forth. 2023-09-11 23:47:11 It doesn't surprise me that Pascal's triangle goes to the normal dist. I just hadn't ever actually thought about it. 2023-09-11 23:53:24 I really like "Aha" moments like that. 2023-09-11 23:53:48 I knew about Galton boards, and that was how the ideas connected for me. 2023-09-11 23:54:30 xelxebar: Do you know about the Ising model? 2023-09-11 23:54:46 It's a low-level model scientists use to study phase transition hysics. 2023-09-11 23:55:06 Given some of the things you've said the last day or two, I suspect you'd like it.