2023-02-05 03:16:09 As for a retrocomputer initial bootloader, do you think Forth can replace monitor, if it has some words for hexdump, for modifying memory writing hex codes, for running code from specified address and other things such as saving and loading data to external storage (tape drive typically)? 2023-02-05 04:38:40 Stalevar: Why not? It's own Dialect. IMHO it would first of all be easier to explain. 2023-02-05 04:39:52 Well, I am wondering, what's better a regular monitor which was built in many computers of the era, or say forth, which was (unfortunately) only available in very few computers such as Jupiter ACE 2023-02-05 04:42:34 What are the requirements? Options? 2023-02-05 04:43:25 I am not at all familiar with those options (said monitors). 2023-02-05 04:45:51 Would UEFI (Shell?) count as a monitor? It is not at all clear to me WTF is UEFI, nor how to use it. 2023-02-05 04:46:53 I am hopeing I will flash a Forth there :) . 2023-02-05 04:49:35 Stalevar: ARM SystemReady... 2023-02-05 04:50:12 Why retro? What is it even? 2023-02-05 04:50:42 dkordic, let's take Radion 86rk monitor. The main commands it has are D for dump, say D100,1FF will produce 16 lines of hexdump of memory starting at 0x0100, there is a similar command to list. L is very similar but it dumps memory in text format instead of hex. 2023-02-05 04:50:44 Isn't x86-64 retro enough for You already :) ? 2023-02-05 04:51:19 F addr1,addr2,byte will fill memory between addr1 and addr2 inclusively with byte byte 2023-02-05 04:51:21 Nope 2023-02-05 04:52:04 M addr would let the user to edit memory starting at specified address writing new values in hex 2023-02-05 04:52:51 T a1,a2,a3 copies data between a1 and a2 inclusive to area starting at a3 2023-02-05 04:53:05 dlowe: The code/pre text isn't wrapping 2023-02-05 04:53:29 There are commands C to compare and S to search memory 2023-02-05 04:53:42 G to run code at specified address 2023-02-05 04:53:48 Stalevar: Of course Forth can replace monitor. Forth was considered an "operating system" by most Forthers in the 80's 2023-02-05 04:54:31 X to view/edit registers, O to write memory of specified addresses to tape and I to read the tape, and then some additional hardware dependent commands 2023-02-05 04:54:41 Stalevar why don't you ask about features you're not sure it can support 2023-02-05 04:55:13 veltas, maybe you can offer analogues in your forth to listed commands? 2023-02-05 04:55:14 Forth can do all this stuff said so far, it's trivial for Forth 2023-02-05 04:55:27 T is MOVE 2023-02-05 04:55:31 F is FILL 2023-02-05 04:55:41 Say I want to write my program 1B 3A 4C to address 0x100 2023-02-05 04:55:44 G is EXECUTE (or an assembly equivalent on ITC) 2023-02-05 04:56:32 Stalevar: It would be exciting for me as a reader to (be able to) see a rationale for even the tiniest decision. It seems You can not compose those commands. Why is that intended? Also You can make a Dialect exactly like that, but it would have to be completely described in Forth :) . 2023-02-05 04:57:03 C is COMPARE (can write a wrapper for COMPARE to make it more like memcmp's arguments) 2023-02-05 04:57:48 M could be easily written in Standard Forth, I will assist writing this if you get stuck 2023-02-05 04:58:00 Most useful are D, M, G, I, O 2023-02-05 04:58:44 O and I would be trivial too 2023-02-05 04:59:14 D is DUMP 2023-02-05 04:59:28 veltas: ( You mean ) ' COMPARE IS C \ :) 2023-02-05 04:59:42 format c: 2023-02-05 05:00:03 Forth is a programming language, you can implement things like format if you want 2023-02-05 05:00:48 yeah, but I guess a ROM forth should already have single words for DMGIO things. The others are not essential 2023-02-05 05:01:04 Of course 2023-02-05 05:01:30 Depending on the computer I'd expect a FORMAT command, it depends on the computer 2023-02-05 05:01:44 Forth is fully capable as a quality monitor program, anyone here would agree 2023-02-05 05:01:46 Stalevar: So how to compose... commands, or anything, in such a system? 2023-02-05 05:02:23 And we're not even that biased, there are many here who happily throw cold water on Forth ideas that aren't realistic, but a monitor? Yes, we can do that. 2023-02-05 05:02:33 write 100 21 14 01 cd 18 f8 cd 30 f8 7c cd 15 f8 7d cd 15 f8 c3 6c f8 0d 0a 00 end 2023-02-05 05:03:01 or even better 2023-02-05 05:03:06 Pretty similar to what you'd get with a subroutine forth 2023-02-05 05:03:14 But it will compile that for you 2023-02-05 05:03:19 100 write 21 14 01 cd 18 f8 cd 30 f8 7c cd 15 f8 7d cd 15 f8 c3 6c f8 0d 0a 00 end 2023-02-05 05:03:42 Makes more sense to get the address to write too separated from code 2023-02-05 05:04:47 I can also terminate with single period instead of `end`, but it might be confused with printing command 2023-02-05 05:05:09 veltas, do you consider adding something like write thing to your forth for zx? 2023-02-05 05:05:29 to write small machine code subroutines to memory location 2023-02-05 05:06:12 it would be even more convenient than M from RK86 monitor 2023-02-05 05:12:51 Stalevar: Usually you could do this with C, 2023-02-05 05:13:12 Or write words to interpret up to 'end' 2023-02-05 05:13:30 Forths also often have assemblers built in 2023-02-05 05:14:52 You'd write something like CODE mydef 21 C, 14 C, 01 C, ....... NEXT 2023-02-05 05:15:11 But as I said you can write something to handle a series of C, without writing them all out 2023-02-05 05:15:12 veltas, did you look at OpenSE basic? It seems quite good to have. I remember spending lots of time trying to figure out which key has the keyword I need on it. Typing the keywords completely seems easier 2023-02-05 05:15:28 Got to go I'm afraid, maybe someone else can help. 2023-02-05 05:16:00 ah, I am not yet needing help, I didn't start working on anything, just pondering things 2023-02-05 08:33:10 Setting up mouse traps in my house, proper Tom and Jerry stuff going on here 2023-02-05 08:42:13 Already caught my thumb in one 2023-02-05 09:23:11 Stalevar: I definitely think a "monitor" could be Forth-based. And yeah, you'd want a suitably chosen lexicon in it. 2023-02-05 09:24:23 dkordi: A Forth monitor would need some working RAM, even if just a tib for your commands to go into. 2023-02-05 09:24:46 Same goes to say rk86 monitor 2023-02-05 09:24:49 If you wanted to be able to compile new words it would need more. It would just reserve some somewhere. 2023-02-05 09:25:11 Yeah, I guess there would be a lot of options for how a monitor worked. 2023-02-05 09:25:59 So was Juniper ACE only home computer with forth built in? 2023-02-05 09:26:23 If we don't count powermacs with openfirmware which... kinda has forth but... absolutely no docs it seems 2023-02-05 09:27:04 And it wasn't meant to be used as main environment either, rather as bootloader for OS X 2023-02-05 09:32:45 I knew someone who had a sun workstation as a home computer 2023-02-05 09:37:27 I used to fantasize about that. :-) 2023-02-05 09:37:34 And now we all have far better. 2023-02-05 09:38:13 granted their dad was VP of BIGCOMPANY 2023-02-05 09:40:09 Heh. The computing equivalent of the kid whose folks buy him a Corvette for his 16th birthday. 2023-02-05 09:53:41 veltas: you asked last night about my stack depth measurements. That was nothing fancy - I just inspected the RAM between the stacks and found where the RAM was non-zero. I took those places as the maximum excursion the stack pointers had made. 2023-02-05 09:54:13 And I wasn't doing this in the context of a lot of application code - I just looked at what the system itself had done "just by running." 2023-02-05 09:54:19 Yeah 2023-02-05 09:54:23 Both data and return stacks were around 17-18 max items used. 2023-02-05 09:54:52 I was happy to see, though, that when I call a word of my own, the return stack is practically empty - there are just two items on it at that time. 2023-02-05 09:56:12 Those are good numbers for your programming style 2023-02-05 09:56:36 I'd expect slightly less for people with longer words, less refactoring, more variables usage etc 2023-02-05 09:56:46 I go much deeper on return stack usage, data stack usage is similar though 2023-02-05 09:57:17 Yes, that was what prompted my comment about Chuck seeming to have short definitions and yet STILL can use shallow stacks. 2023-02-05 09:57:27 I think I'd find that pretty challenging. 2023-02-05 09:57:34 My deepest return stack usage lately has hit 98 items, data stack hasn't exceeded 16 2023-02-05 09:57:39 If you gave me an eight-deep stack, I'd really have to change how I write my code. 2023-02-05 09:59:15 By the way, I'm kind of shying away from that notion of keeping loopback addresses on the stack, just because it would effectively double the size of the return stack. I've gotten interested in trying to prepare an ability to have a lot of threads if I want to, Erlang style, so I want to keep the tasks blocks small. 2023-02-05 09:59:47 It looks like either 512 bytes or 1kB, and I'd really like 512. 2023-02-05 10:01:38 Doing loops that way simplified the hardware in that processor design. 2023-02-05 10:01:57 But it really doesn't buy a whole lot in the context of a software Forth on x64. 2023-02-05 10:35:26 So if I consider this "critical bit" of code, which is next, docol, and the timer tick handling, and I try to make that code as small and fast as possible, it leads me to eight-byte table entries for the CFA table and the PFA table, and the code is nine instructions long, with two for NEXT. 2023-02-05 10:36:07 If I go for the smallest possible tables, then I get 16-bit CFA table entries and 32-bit PFA table entries, and the code goes to 15 instructions, with five for NEXT. 2023-02-05 10:37:04 It really does turn out to be a lot simpler to do the timer tick thing if I tick on each docol instead of ticking on each next. And that would be higher performance too. 2023-02-05 10:37:51 It would give me more variability on the tick intervals, but there was going to be some of that anyway, and always would in a cooperative system. 2023-02-05 10:50:10 Also, I like putting docol just before next. Most primitives will jump to next when done, but at least on definition calls I can just fall into next, and gain a slight bit of performance. Small benefit, but I don't see any reason not to do it. 2023-02-05 10:50:41 And the tick code - the bit that gets jumped to on counter expiration - can just fall into docol. 2023-02-05 10:52:29 The decrement is done after docol saves the IP on the return stack, when it's about to fall into NEXT. If the counter hits zero, I just do that again - supply the xt for the tick handler and just run docol again. Nice and simple. 2023-02-05 11:16:54 KipIngram: Well 8 deep but it's circular 2023-02-05 11:17:58 So calling a word you never intend to return from resets the 'depth', and when 'unwinding' you can just call the high-level word to return back to 2023-02-05 11:29:08 Yeah, I really kind of like the idea of circular stacks, but the only way I see to make them "easy" in a software Forth (i.e., without any hardware assistance) is to have the stack region be some power of two. That's ok, of course, but I also want my task block to be a power of two, and if I split it into two power-of-two stack ranges then I've nothing left to store user variables in. 2023-02-05 11:29:25 So, sure - I could make it work fine, but it would force me to larger task blocks. 2023-02-05 11:29:50 On the other hand, if the stack is NOT circular, I can just cut its size down a few to make room for the few user vars that I need. 2023-02-05 11:30:24 rp0 @ rp! isn't that hard to do. 2023-02-05 11:30:40 So resetting the stack isn't terribly painful. 2023-02-05 11:31:25 I could fairly easily, though, make the data stack circular and the return stack not. Data stack is the one more likely to overflow anyway. 2023-02-05 11:33:31 But yeah, it is kind of nice how circular return stack just makes that reset automatic. A consequence of your code structure. 2023-02-05 11:33:42 And in hardware it's super easy to do and zero performance cost. 2023-02-05 12:01:47 Going for the smallest possible system footprint is a little tempting, but when I consider how much savings we're really talking about it hardly seems worth it. Even in a thousand-word system we'd be looking at like 10 kB of savings or something in that range, and that's really nothing. 2023-02-05 12:02:04 I really should just put that out of my mind and do the faster one. 2023-02-05 12:20:46 probably that was more important in the 1970s 2023-02-05 12:30:35 Do whatever motivates you, a system that's pointlessly optimised is better than one that doesn't exist 2023-02-05 12:34:00 Heh. Good point. 2023-02-05 12:34:15 I suppose you could call either one of these an "optimization." Just different things. 2023-02-05 12:37:32 Today everyone is told not to bother doing stuff like writing a parser etc because it's "reinventing the wheel", but it's better to reinvent the wheel and learn something than to just sit around saying "well I can't do this because it's already been done" 2023-02-05 12:37:50 And that can help when it comes time to do new things too 2023-02-05 12:38:44 Totally agree. 2023-02-05 12:38:44 there is this thing on youtube called CodingTrain where the guy actually does implement stuff and explains along the way 2023-02-05 12:38:53 Plus it's FUN. 2023-02-05 12:40:51 even more fun is when folks forget how computers work 2023-02-05 13:57:27 It's harder to find the info on how they actually "work" these days. 2023-02-05 13:57:35 Folks just go straight for the high level stuff. 2023-02-05 14:35:32 And there's nothing wrong with that, it's how humans approach problems. Eventually some come down to the depths. 2023-02-05 14:45:48 ... where the Morlocks lie ... 2023-02-05 15:36:15 thrig: they never truthful, neh? 2023-02-05 15:36:31 -1 2023-02-05 15:37:18 you mean 1- ? (postfix because this is #forth after all) 2023-02-05 15:37:48 no, I mean -1 for truth 2023-02-05 15:38:27 oh, like 0xffff in 16 bit forths 2023-02-05 15:38:50 ... which others obviously take as false ... 2023-02-05 15:41:29 you mean $ffff because this is #forth after all :P 2023-02-05 15:42:31 no because modern forth support 0x 0b 0q and 0o number notations 2023-02-05 15:43:05 News to me 2023-02-05 15:46:59 0'Brien 2023-02-05 15:47:52 thrig: and the balrogs. 2023-02-05 15:48:32 And mine supports x:FFFF 2023-02-05 15:48:38 Or 16:FFFF 2023-02-05 15:49:25 The latter is the general thing, but x: b: and o: are "synonyms." 2023-02-05 15:49:58 R:MMMCMXCIX 2023-02-05 15:50:07 Heh. 2023-02-05 15:50:27 I swear, it's hard to see how the Romans got anything done, hobbled as they were when it came to numbers. 2023-02-05 15:50:38 Positional notation - truly one of man's supreme inventions. 2023-02-05 15:50:41 and what have the Romans done for us, anyways 2023-02-05 15:50:42 tally marks 2023-02-05 15:51:12 Arabic numerals were resisted for years, considered work of the devil because they were so effective 2023-02-05 15:51:14 And the alphabet - that's up there too. 2023-02-05 15:51:28 I think people were concerned about losing their jobs too 2023-02-05 15:51:33 P.S. ~@R is the Common LISP format syntax to emit roman 2023-02-05 15:51:36 :-) Probably. 2023-02-05 15:51:39 Quite a lot like the ChatGPT discussion today 2023-02-05 15:51:46 which one? the Greek one that the roman bastardized? 2023-02-05 15:52:05 didn't zero come from India or some other backwater 2023-02-05 15:52:12 Yeah. 2023-02-05 15:52:17 The symbols are really Indian 2023-02-05 15:52:24 But they're known as Arabic 2023-02-05 15:52:42 Well, they came to Europe via Arabia. 2023-02-05 15:52:54 Since it sits there in the middle. 2023-02-05 15:53:19 well until they figured out how to go around africa, but you need math for that 2023-02-05 15:53:57 Apparently they were doing differentials like 3500 years ago or something 2023-02-05 15:54:02 Speaking of all that, the general history of human migration over the world is pretty fascinating. 2023-02-05 15:54:22 Number systems classicaly weren't very efficient, but neither is Imperial and we went to the moon with that 2023-02-05 15:54:41 People from the southern regions (Tigris Euphrates value, Arabia, etc.) moved into Europe first, and agriculturalized it. 2023-02-05 15:55:01 Then much later the nomadic folks from more north (Russia etc.) came in and more or less too over. 2023-02-05 15:55:14 ... when spaceships were wood and men were iron ... 2023-02-05 15:55:20 In Europe proper there was a lot of mixing, but the new folks replaced like 90% of the gene pool in Britain. 2023-02-05 15:55:39 So that sounds like not a very happy time for the original folks. 2023-02-05 15:56:03 big animals also have a habit of exiting stage left after humans show up 2023-02-05 15:56:07 Seems my ancestors weren't terribly friendly folks. 2023-02-05 15:56:25 Yes - there used to be as many big animals in America as there was in Africa. 2023-02-05 15:56:32 We took 'em out. 2023-02-05 15:56:47 s/was/were/? 2023-02-05 15:57:19 Lions, mammoths, etc. 2023-02-05 15:57:38 I saw a video a while back about a science group that is talking about bringing the mammoth back. 2023-02-05 15:58:10 mommoths died out only like 3000? years ago on some island that was tricky for humans to get to 2023-02-05 16:00:59 Do you know about the Aurochs? 2023-02-05 16:01:14 And wolves? We wiped out the wolves in Britain 2023-02-05 16:01:30 That's a public service really, I don't blame them for doing that 2023-02-05 16:02:10 yeah, they sent Hugh Jackman to Australia 2023-02-05 16:14:15 Aurochs probably assholes too 2023-02-05 16:17:29 water buffalos are mean but they let skinny little kids whack them with sticks 2023-02-05 17:39:13 bbl