2022-08-26 02:31:54 how reasonable does it feel to people to call forth "a scripting language for building the binary you want in memory" ? 2022-08-26 02:33:03 (as opposed to a traditional compiled language) 2022-08-26 02:38:51 remexre: forth is really close to compiled 2022-08-26 02:40:21 i remember reading that the threading used in forth (ie. a list of subroutines to call in order) is how early cobol compilers worked 2022-08-26 02:40:39 and i believe B, the precursor to C, was also compiled to threaded code 2022-08-26 02:41:48 i'm not familiar enough with cobol to usefully comment on it, but I guess C would be the foil I'd use 2022-08-26 02:42:10 like the idea of back-patching a jump is just... not a thing you'd even think of being expressible in C 2022-08-26 02:42:28 (not that it's standard forth, i suppose) 2022-08-26 02:44:08 and of the languages that let you (iirc ruby and lua have notions of this?), they allow it because they're interpreted in a more... "heavy-weight" way? 2022-08-26 02:44:32 i guess a while(1) do(*opcode++); feels "heavier" than NEXT 2022-08-26 02:44:54 er, do_opcode(...) i suppose, forgot do's a keyword lol 2022-08-26 02:47:11 remexre: my love of assembly means i admire back patching the jumps :-) 2022-08-26 02:48:29 remexre: my forth `execute` uses self-modifying code to call the execution token 2022-08-26 02:49:19 huh, does it mess with its NEXT or w/e to make it a direct jump? and why do it that way; does it help enough with branch prediction to be worth the icache flushes? 2022-08-26 02:49:40 ig it wouldn't be NEXT, but the jump at the end 2022-08-26 02:49:46 remexre: : execute LIT [ here @ ] nop ! [ here @ swap ! ] nop ; 2022-08-26 02:50:41 remexre: it stores the address directly into the threaded code 2022-08-26 02:51:19 hm, I'm not understanding what the here @ is about? 2022-08-26 02:51:41 wouldn't the nop not have been written yet? 2022-08-26 02:51:45 oh shit yeah my here is non standard 2022-08-26 02:51:50 ah 2022-08-26 02:52:03 remexre: it back-patches like a branch 2022-08-26 02:52:30 is your here like the standard here 0 , or something? 2022-08-26 02:52:31 hmm i could probably use an unconditional branch to achieve it ... that's interesting 2022-08-26 02:52:51 remexre: oh i just made here a normal variable 2022-08-26 02:52:57 ah 2022-08-26 02:54:11 yeah, i'm not sure how well that'd work with a real cpu; iirc there's a limit on how close to the current insn ptr you can self-modify code before bad things happen 2022-08-26 02:54:25 on intel's impl of x86_64, at least 2022-08-26 02:55:15 i use that code on direct and indirect threaded, so it's not actually code, it's a pointer .. but yes it's still indirect 2022-08-26 02:55:41 or rather unpredictable 2022-08-26 02:57:02 remexre: does this make more sense for my execute? : execute LIT [ here 0 , ] ! [ here swap ! 0 , ] ; 2022-08-26 02:57:41 is it more traditional code? 2022-08-26 02:58:00 yeah, I think i understand it 2022-08-26 02:58:26 kinda funky, but saves you a primitive I guess :) 2022-08-26 02:58:56 :-) 2022-08-26 02:59:54 i've never seen it in any other language (except assembly :-) 2022-08-26 03:00:10 that low-level control 2022-08-26 03:00:20 yeah 2022-08-26 11:33:46 That's pretty funky, dave0, but I guess "whatever works" applies here. 2022-08-26 11:34:28 A few weeks ago I was trying to write a boot sector Forth that could be used for a full system bootstrap. 2022-08-26 11:34:35 That meant it needed to offer BIOS access. 2022-08-26 11:35:00 A "clean" implementation would have had separate functions for int 10h, int 13h, etc. etc., but there wasn't room. 2022-08-26 11:35:13 EFI support might be more complicated 2022-08-26 11:35:19 So it uses self modifying code there - the byte that specifies the interrupt level has to be plugged before you call it. 2022-08-26 11:35:32 (some systems ain't even shipping with legacy bios no more) 2022-08-26 11:35:44 yeah, EFI did look more compicated, but more functional too (network boots, etc.) 2022-08-26 11:35:54 I stuck with what I was familiar with from the past. 2022-08-26 11:36:17 why we got not-invented-here EFI instead of openfirmware... 2022-08-26 12:08:12 Corporate agendas. 2022-08-26 12:08:19 "Control." 2022-08-26 12:08:56 We spent all that time fretting over how to avoid tyrannical governments, and while we weren't looking we got tyrannical business instead. 2022-08-26 12:11:41 Quite simply blame Intel 2022-08-26 12:12:16 UEFI is pretty much DOS, it's actually far more complicated than DOS ever was 2022-08-26 12:12:40 Your OS boots from an OS 2022-08-26 12:13:15 Yeah. The general phenomenon is across the board, though. Eisenhower tried to warn us as he left office about "the military industrial complex," but apparently we didn't pay attention. 2022-08-26 12:13:49 Target the UEFI Shell for your Forth, not much harder to make it into an OS at that point 2022-08-26 12:14:07 it's hard to make someone pay attention when hey hey money!! 2022-08-26 12:14:11 But do we really need another OS? 2022-08-26 12:14:34 We probably actually don't "need" one - we've got a good FOSS OS. 2022-08-26 12:14:42 I actually think UEFI exists because firmware developers have nothing better to do, but that's not a good reason either 2022-08-26 12:14:52 That's why systemd exists, it's not a good thing 2022-08-26 12:14:56 oh, but it IS the reason for a lot of things. 2022-08-26 12:15:15 systemd is brilliant (if you run a company that makes money off of service contracts) 2022-08-26 12:15:18 I've thought for a long time that the MS Office user interface hit a "best point" decades ago, but they just keep right on dicking with it. 2022-08-26 12:15:28 Every little manager has to figure out how to keep his team in work. 2022-08-26 12:15:33 Job's never "done." 2022-08-26 12:16:07 No one's ever going to say "We've completed our work - this team can be dissolved now.' 2022-08-26 12:16:28 because you might just get "dissolved" right onto the street. 2022-08-26 12:16:48 I know people that say this 2022-08-26 12:16:59 And they're the ones that understand the job market and will walk into another job 2022-08-26 12:17:07 I think corporations are just packed with little "self serving groups" that aren't at all tuned in to any "global mission." 2022-08-26 12:17:14 Sure - there are exceptions to every rule, and bless them. 2022-08-26 12:17:25 Good people - still got a few around. 2022-08-26 12:18:06 UEFI Shell is pretty much a FOSS OS 2022-08-26 12:18:34 Most of the shell is open source code, then the rest is all firmware baked into your PC that wasn't open source regardless 2022-08-26 12:18:42 I really don't know enough about it to comment. 2022-08-26 12:18:55 I've written programs for it at my last job 2022-08-26 12:19:00 I used BIOS when it was current, and I still remember fairly well how that game worked. 2022-08-26 12:19:02 Like a ROM flashing utility 2022-08-26 12:19:19 BIOS was a very thin interface for firmware 2022-08-26 12:19:25 Yes. 2022-08-26 12:19:28 And DOS was playing the role UEFI Shell plays 2022-08-26 12:19:41 UEFI Shell plus all the 'boot services' in UEFI 2022-08-26 12:20:21 Some of the boot services are just replacements for BIOS functions 2022-08-26 12:21:27 Well, my goal was to make everything needed for a bootstrap fit into 512 bytes, and I was able to do that (though I haven't tested it in any way, yet). I tinkered with qemu enough to decide that it looked like it was a viable way to test it, but I haven't gone any further. 2022-08-26 12:21:47 Bad habit of mine - I dive into things pretty immersively, then after a while my interest gets pulled off to something else. 2022-08-26 12:22:11 At the moment I'm brushing up my old chemistry learning. 2022-08-26 12:22:31 My dad was a chemistry professor - I decided it was a little shameful for me to have forgotten as much of it as I had. 2022-08-26 12:22:59 I'm pretty on top of the "physics part" - electron structures, etc., but beyond that it had largely faded away. 2022-08-26 12:24:45 It's pretty cool how the shape of the periodic table pops right out of that physiscs. Schrodinger equation in a central potential --> perioic table. 2022-08-26 12:26:17 Oh, I discovered this morning that my brand new work Mac wasn't charging through it's magnetic port. 2022-08-26 12:26:30 Fortunately it will also charge via USB C, and that does work. 2022-08-26 12:26:53 Don't know if it's a bad cable or a dirty connection or what yet - I'll figure that out later. 2022-08-26 12:27:43 the power supply is the most unreliable part of this here 2009 macbook 2022-08-26 12:34:07 This is just the second Mac I've ever used. Had a 13" MacBook Air before this one. 2022-08-26 12:35:07 I just set it and my personal notebook side by side on the sofa in front of me during the day - end of day I just close the Mac and slip it under the Linux unit. 2022-08-26 12:35:17 That's my 10 second commute these days. 2022-08-26 12:39:34 besides this 2009 macbook the old apple //e was good 2022-08-26 12:40:25 I've been pretty happy with the general hardware quality of everything Apple I've ever used. I did a brief stint with an iPad, and I've had a couple of iPods. 2022-08-26 12:40:31 All seemed like solid stuff.