2023-09-09 01:20:04 Yeah - this is just me complaining at the point of not knowing ANY of them very well. :-) 2023-09-09 01:20:25 I played with it for a week or so a year or year and a half ago or so. Still have Dyalog installed on my notebook. 2023-09-09 01:38:20 So, you know - I mentioned earlier that focusing on a calculator OS was a good way to have a "firm target.' It occurs to me, though, that if I do this right I should have a system that's entirely portable except for the actual "user interface" layer. Instead of running a small calculator LCD and using a calculator keyboard, I could just have a different interface more suitable for a computer. No reason for 2023-09-09 01:38:22 anything else to be different at all. 2023-09-09 01:38:45 I should structure it with such a layered design in mind. 2023-09-09 02:14:05 So I wonder why they did choose to run math expressions right to left. Once I started thinking about it I wasn't able to see any particular reason that it couldn't have been done left to right, so long as one was consistent. 2023-09-09 02:14:28 Also, I actually agree with APL's mentality that "precedence rules" really just complicate mathematics. 2023-09-09 02:14:46 A right-to-left or left-to-right "cleanliness" seems more "tight" to me. 2023-09-09 04:02:30 I like both, stuff like hasell $ to force a directional order if it's prudent but the good old groupings as well 2023-09-09 04:02:34 haskell* 2023-09-09 07:42:37 KipIngram: APL is really trying to be an incarnation of Iverson's "Notation as a Tool of Thought". For English, it turns out that right-to-left evaluation causes the code to map better to English verbalization. 2023-09-09 07:46:13 The proverbial paren parser +\1 ¯1 0⌷⍨⊂'()'⍳ '()(()(((())())))', for example, pretty much directly reads "running total of open parens minus close parens" 2023-09-09 07:47:46 Which reads declaratively. Flipping it around, we get something like "Mark open parens with 1, close parens with -1, then calculate the running total", which reads very procedurally. 2023-09-09 07:49:33 The first tends to be closer to how people informally communicate ideas to each other, IMO, which is my guess for (part of) why right-to-left evaluation was chosen. 2023-09-09 08:17:42 did you ever toy with the idea of a word with compound words? 2023-09-09 08:17:50 i always do 2023-09-09 08:18:00 of a forth with* 2023-09-09 08:18:58 it shouldnt be hard to provide 2023-09-09 08:19:18 but it can run into troubles 2023-09-09 08:20:32 i would try by making a special type of word for compound words which would be just a hash table 2023-09-09 08:20:52 and the next word i read must exist in that table 2023-09-09 08:21:03 which could be yet another compund word 2023-09-09 08:21:51 but if a compound word has words that you already use, it can be tricky to specify when you want to use a compound word or not 2023-09-09 08:22:11 and you might not know a compound word was defined which could alter your code 2023-09-09 08:27:32 i'd like to have that feature, but it looks like it will give me troubles at the end 2023-09-09 08:29:39 somehow if a compound word is a hash table it acts like a spacename in the sense that will act like a prefix 2023-09-09 08:31:28 and it can be nested 2023-09-09 08:31:55 the cat the guy the would be a hash table containing cat and guy 2023-09-09 08:32:15 the red cat the red guy 2023-09-09 08:32:33 the contains red which contains cat and guy 2023-09-09 08:39:31 in your point of view i guess a compound word would be a dictionary 2023-09-09 08:40:27 a dictionary contains words and compound words which are itself dictionaries able to contain another dictionaries and words 2023-09-09 08:48:13 i want a return stack at the end 2023-09-09 08:49:23 i want it since i wanted tco, but also helps when you want to improve the ability to bootstrap from few primitives 2023-09-09 08:49:58 if loop and alike can be implemented in the language itself as long as you have a return stack 2023-09-09 08:50:25 they can be implemented with other tricks, but meh 2023-09-09 08:50:40 it gives you more control overall anyways 2023-09-09 08:50:57 and tco 2023-09-09 08:52:22 also you can use it to implement some sort of condition/exception system 2023-09-09 08:52:45 and handlers, async stuff, etc 2023-09-09 08:53:12 and the best part is all this can be written in the language itself 2023-09-09 08:54:25 also i wonder about the compiling state flag 2023-09-09 08:54:58 i don't use it, but sometimes i felt i could do some things better with a flag 2023-09-09 08:55:56 forth is so cool actually 2023-09-09 08:57:14 i want to learn more about how to be able to bootstrap from few primitives 2023-09-09 08:58:05 the better i do that the easier is to implement the whole lang and to port it to other langs/platforms 2023-09-09 09:03:28 vms14: Agreed about the coolness at the core of Forth. Have you read through any implementations yet? 2023-09-09 09:06:37 not much more than the jonesforth and what i was told here 2023-09-09 09:07:49 and some posts and alike, but i always wanted to do the stuff in my way cause i was using perl to implement a rpn stack based lang and following the forth way of doing stuff did not make sense using a high level language 2023-09-09 09:08:19 but i always had envy on some features of forth i can never provide for not doing the stuff like forth does it 2023-09-09 09:08:48 for example memory allocation does not make sense 2023-09-09 09:09:15 i don't see why i should fake memory with some array and allocate cells there 2023-09-09 09:09:43 but if I dont have that most of forth words won't exist 2023-09-09 09:10:23 the dictionary is a linked list in forth while i decided to have an environment instead 2023-09-09 09:11:13 it's lexical scope, forget does not exist and it can't 2023-09-09 09:11:40 i always liked allot 2023-09-09 09:12:02 and the tricks you can do using memory, including the dictionary 2023-09-09 09:13:19 vms14: a stack also works for the dictionary 2023-09-09 09:14:08 vms14: the rule that it finds newer words first, also works with a stack 2023-09-09 09:14:13 my dictionary is a hash table with a parent slot 2023-09-09 09:14:55 hashing words is interesting 2023-09-09 09:15:38 hash tables are not my favorite data structure 2023-09-09 09:15:47 but they can be fast 2023-09-09 09:16:07 what can do a perl dev without hashes? 2023-09-09 09:17:30 who me? i dont know perl :-p 2023-09-09 09:18:21 i wonder if starting by having an array as memory 2023-09-09 09:18:25 xd 2023-09-09 09:18:49 it will be so fucking expensive, but it's not like i care 2023-09-09 09:19:24 but having a gc already it does not make much sense 2023-09-09 09:19:54 the trouble with growing memory is it needs operating system support :-( 2023-09-09 09:19:58 i could have both actually 2023-09-09 09:20:39 you cant really say "give me all the memory you have" 2023-09-09 09:20:50 maybe in dos you could 2023-09-09 09:20:58 variables and stack elements can go with the gc 2023-09-09 09:21:15 and give you a memory array that you use with allot 2023-09-09 09:21:48 dave0 i only can say the memory will grow as much as it can 2023-09-09 09:22:06 perl arrays will grow forever until there is no memory 2023-09-09 09:22:34 so its infinite memory most of the time 2023-09-09 09:22:39 :D 2023-09-09 09:23:16 99% infinite 2023-09-09 09:25:09 and a cell is also of infinite size 2023-09-09 09:25:26 like the stack 2023-09-09 09:25:35 unlimited power i have 2023-09-09 09:26:51 well actually the limit is 3G since it will run on my phone which has 6 and already uses 3 2023-09-09 09:27:53 vms14: that's nice if the arrays automatically grow :-) 2023-09-09 09:27:59 i wonder if android will let termux eat that ram, but I guess no problem 2023-09-09 09:28:08 you gotta do it by hand in c 2023-09-09 09:28:54 dave0: thats why if i already have all that does not make sense to provide memory allocation 2023-09-09 09:29:27 but i guess if you want to allocate memory why i dont give you an array to play with 2023-09-09 09:29:45 the thing is a cell can be of any size 2023-09-09 09:29:56 including 3G 2023-09-09 09:29:59 xd 2023-09-09 09:30:15 i read somewhere that chuck likes to build his structures in memory and dump them out to disk in one go 2023-09-09 09:30:59 he also likes to fill the stack as soon as it can 2023-09-09 09:33:02 i should try to make a real forth in perl and see if i like it 2023-09-09 09:33:50 but it's hard without asm 2023-09-09 09:38:01 i wonder what i win with memory allocation 2023-09-09 09:38:20 for now i want the return stack 2023-09-09 09:38:44 but also the compile state flag i think can be handy 2023-09-09 09:39:20 i want forth's [ word which just changes that flag 2023-09-09 09:40:05 but the state flag indirectly involves the dictionary trough immediate words 2023-09-09 09:40:39 since immediate words can be used to manipulate dictionary entries and add stuff there 2023-09-09 09:55:33 vms14: Just a couple of weeks ago I mentioned the notion of having the ability to find "phrases" in the dictionary. I can't remember now why I thought it might be useful. 2023-09-09 09:56:08 I guess it would be a sort of "greedy matcher" - it would match the longest string that it could on each step. 2023-09-09 09:56:53 https://www.ultratechnology.com/1xforth.htm 2023-09-09 09:57:12 funny to see chuck even dislikes the stack notation 2023-09-09 09:57:54 he says the stack should never have more than 4 or 5 parameters 2023-09-09 09:58:26 dave0, vms14: Having your RAM allocation grow dynamically as your data structures grow is called "table doubling," at least in the context of hash tables. Going up by a factor of 2 is just an "easy an natural" way to do it. 2023-09-09 09:58:29 and that he chose a stack size of 18 as an infinite stack 2023-09-09 09:59:27 like no matter what program it executes, it will always have enough space 2023-09-09 09:59:44 yeah, Chuck basically just feels that words should be so simple that you don't need any of that - the code itself should make evident what it's doing. 2023-09-09 10:00:07 KipIngram: in part that's why i wanted compound words 2023-09-09 10:00:12 Multiplying by a factor to reduce effort of moving reallocations amortizes the work to a constant amount per insertion 2023-09-09 10:00:15 but meh 2023-09-09 10:00:22 I've never been able to get to Chuck's small stack sizes; there's just something about how he codes that makes that work. 2023-09-09 10:00:53 he tells you, the stack should never have more than 4 or 5 parameterds 2023-09-09 10:00:58 Right - the table doubling is expensive, but after amortization they still get O(1) on their hash table. 2023-09-09 10:01:20 I know he does, but I never wind up with code that's THAT stack efficient. 2023-09-09 10:01:25 Just not good enough yet, I guess. 2023-09-09 10:02:02 I have checked mine and found that at most I seem to use 17-18 items, so I guess "so far' 18 has been infinite for me. 2023-09-09 10:02:14 Mine's bigger, but that's how much the code I've written tends to use. 2023-09-09 10:02:22 the secret is just more definitions it seems 2023-09-09 10:02:53 No, I think there's more to it than that. I think there's a basic notion of how one "approaches" algorithm design that would play into it. 2023-09-09 10:03:02 ah yeah 2023-09-09 10:03:17 like having to use less data by doing it in a certain way 2023-09-09 10:03:21 I've gotten pretty good at factoring - these days my definitions are about the same length as Chuck's. I read somewhere that he averages like 44 chars. 2023-09-09 10:03:24 or reusing that data 2023-09-09 10:03:29 And I'm somewhere between 40-50. 2023-09-09 10:03:59 It matters to Chuck because in his chips he does hardware stacks. 2023-09-09 10:27:23 oh he has no else 2023-09-09 10:27:56 So there's an operational bit of these calculators that's a little complicated. It involves real vs. complex numbers. The most intuitive way to implement that would be to just naturally bring in complex numbers as your calculations demand. If the result is complex, then you get a complex number. 2023-09-09 10:27:57 ah cause he has different return in a word 2023-09-09 10:28:26 But in some cases that's not what you want - instead if there's no real solution you want to regard it as a "no solution" situation and inform hte user of that. 2023-09-09 10:28:39 So you have to have mode settings to tell the calculator which one you want. 2023-09-09 10:29:09 Different returns in a word? 2023-09-09 10:29:13 Not sure what you mean. 2023-09-09 10:29:26 ; does not end a definition 2023-09-09 10:29:42 it is a return and he says you can have more than one return 2023-09-09 10:29:45 I just mean that he has specific limited hardware resources for his stacks, and the bigger he has to make those resources the more power they consume, the more resources, etc. 2023-09-09 10:29:58 Oh. Right. 2023-09-09 10:29:59 and different entries in a word or something like that 2023-09-09 10:30:20 Yes, you get that by separating your headers from your definitions. 2023-09-09 10:30:28 So that adjacent definitions are truly adjacent in RAM. 2023-09-09 10:30:49 Then you can point headers into that anywhere. 2023-09-09 10:31:14 the definition is green and it might have a semicolon in the definition which means return but it does not mean end of definition. It can have more than one return, and you can have more than one entry point in here if you want. 2023-09-09 10:31:59 Yes. The mere appearance of a ; doesn't necessarily take him out of compile mode. He doesn't actually HAVE that "mode" anymore - it's just done with the colors. 2023-09-09 10:32:19 So you can think of his code as one long wall of code, and his headers just tell him where he can jump into it. 2023-09-09 10:32:38 I don't see that ELSE is as useful as the complexity it introduces would justify. You can see this in my code. I will have IF with a semicolon and then I will exit the definition at that point or continue. 2023-09-09 10:32:56 The headers are separate in my current system, though I don't use the colors. 2023-09-09 10:33:06 IF ~~~ ; THEN 2023-09-09 10:33:08 If i want a return without leaving compile mode I have ;, 2023-09-09 10:33:57 Then : ; compile ;, state off ; immediate 2023-09-09 10:34:58 ooh 2023-09-09 10:35:07 he changed loops for recursion 2023-09-09 10:35:07 And if I have an unconditional jump (a loop) at the end of a definition, then I don't need a return there. So instead of ; I use [ 2023-09-09 10:35:35 . 2023-09-09 10:35:35 I've got a new looping construct that I am using in Color Forth and that I find superior to all the others. That is that if I have a WORD I can have in here some kind of a conditional with a reference to WORD. And this is my loop. 2023-09-09 10:35:36 WORD ~~~ IF ~~~ WORD ; 2023-09-09 10:35:36  THEN ~~~ ; 2023-09-09 10:35:57 Right - that's tail recursion. 2023-09-09 10:36:19 You just change that final call to WORD to a jump. 2023-09-09 10:36:34 I have a dedicated word for it, though, ME 2023-09-09 10:36:43 ME compiles a jump back to the start of the current definition. 2023-09-09 10:36:55 It's shorter usually, which is nice, and also I can conditionalize it: 2023-09-09 10:37:00 0=ME etc. 2023-09-09 10:37:14 Of course you DO need ; after a *conditional* loopback. 2023-09-09 10:37:23 In case you don't take the jump. 2023-09-09 10:38:06 "back to the latest entry point" is the only kind of loop I can do. 2023-09-09 10:38:12 But I can always put in an entry anywhere: 2023-09-09 10:38:26 : foo ... : bar ... me [ 2023-09-09 10:38:34 That would go back to bar because it's latest. 2023-09-09 10:39:03 In the upcoming system I plan to be able to do that without having to put an extra header in. 2023-09-09 10:41:36 he doesnt even have blocks 2023-09-09 10:42:16 he says there's plenty of memory so block uses the memory instead of disk 2023-09-09 10:42:28 well, that's just because he was doing an specific application on a specific machine that he knew had enough RAM to do what he wanted. 2023-09-09 10:42:46 and he was interfacing that application to DOS, which he did by just having DOS utilities to load and save high RAM. 2023-09-09 10:42:57 In any kind OF "generic" system you couldn't do without blocks. 2023-09-09 10:43:04 BLOCK is a wonderful word BLOCK accesses, used to access a region of disk. Now I define it as accessing region of memory. There is no reason to use the disk at all. With megabytes of memory available you just load your data into memory and go from there. There is no need for disk. So BLOCK becomes much much simpler. 2023-09-09 10:43:07 He just didn't need them FOR THAT JOB. 2023-09-09 10:43:23 Yes - just so. 2023-09-09 10:43:38 Because he did his mass storage access with DOS programs. 2023-09-09 10:44:03 He'd load high RAM from disk before even starting his Forth up, and later when he quite he'd archive it off to disk. 2023-09-09 10:44:21 s/quite/quit/ 2023-09-09 10:44:45 I don't really count that as "proving that you don't need blocks." 2023-09-09 10:45:05 That was just an example of his "solve only the probelm you need to solve" mentality. 2023-09-09 10:45:27 His sole goal during that period, for his Forth, was to facilitate the design of his chips. 2023-09-09 10:45:43 My contention is that every application that I have seen that I didn't code has ten times as much code in it as it needs. And I see Forth programmers writing applications with ten times as much code as is necessary. 2023-09-09 10:45:54 He also didn't have vocabularies, but that doesn't mean you never need any namespace organization. 2023-09-09 10:46:16 Yeah - just using Forth isn't a magic bullet. 2023-09-09 10:46:26 Chuck was just supremely good at designing software. 2023-09-09 10:47:16 Typical programmers, though, will say "I want to use Library X," and that immediately forces them to make design decisions that will "fit" LibrarY x. 2023-09-09 10:47:28 And those might not be "optimum" in terms of solving the problem. 2023-09-09 10:47:55 And Library X almost certainly does MORE than what you're using it for, so you get extra code linked in that way too. 2023-09-09 10:48:29 Worse, the typical programmer says "I want to use Library X and Library Y," so then they need code to interface those two libraries together. 2023-09-09 10:48:44 Since they probably don't use exactly the same information format, etc. 2023-09-09 10:49:47 this can snowball, and the first thing you know most of your code is about arranging to work with those libraries. 2023-09-09 10:50:11 You factor, you factor, you factor and you throw away everything that isn't being used, that isn't justified 2023-09-09 10:50:26 You were just complaining half an hour ago about the stuff that's not easy for you to do because of how you've implemented your lang on top of other tools. You're boxed in by those decisions. 2023-09-09 10:51:02 Over and over you've found that you *can't* make something truly Forth-like. 2023-09-09 10:51:36 cause i keep wondering if going to the forth way is actually the correct thing in my case 2023-09-09 10:51:47 which i always answer no 2023-09-09 10:52:04 I'm not criticizing - just pointing out that you've got a ready example of what I'm talking about. 2023-09-09 10:52:07 but some features keep me wondering 2023-09-09 10:52:37 and also wonder how much i have to get near to forth to steal that feature 2023-09-09 10:52:46 We say that all these things happen because of the pressure to ship fast, and that's true of course. But I think a similar aspect of the situation is that there is great pressure on programmers to have "early visual results." 2023-09-09 10:52:58 and if there might be workarounds 2023-09-09 10:53:08 Not necessarily even "finished," but there's a pressure to be able to have somethingyou can show off to your boss as quickly as possible. 2023-09-09 10:53:27 well i got a lot of joy playing with the lang 2023-09-09 10:53:28 And the low-level coding associated with solving a problem from scratch doesn't really facilitate that very well. 2023-09-09 10:53:36 It can be a while before you have anything "to show." 2023-09-09 10:53:40 and as soon as i have the core part i make a repl 2023-09-09 10:54:12 It reassures your higher ups that you're "actually doing something." 2023-09-09 10:54:33 but i have a lot of decisions in my head and i want to see results 2023-09-09 10:54:43 I think that in most organizations the programmers that are highly regarded are the ones who have visual results the most quickly. 2023-09-09 10:55:05 i never got real results as i can stay for long without rewriting cause i took another decision 2023-09-09 10:55:08 and most managers can't even tell if that's actually "good code" or not. 2023-09-09 10:55:24 KipIngram: wouldn't surprise me 2023-09-09 10:55:24 Yes - like I said the other day, this is a learning expedition for you. 2023-09-09 10:55:39 A "playground," so to speak. 2023-09-09 10:55:44 recruiters have no idea about programming, but they hire developers 2023-09-09 10:55:55 why should have any idea the team manager? 2023-09-09 10:56:19 I know - I've always been of the belief that the leaders should be chosen from among your best techincal people. 2023-09-09 10:56:31 The ones who not only have strong basic skills, but also "see the big picture." 2023-09-09 10:56:51 So they SHOULD be able to judge their team's work in a technical way. 2023-09-09 10:57:39 But, that's just not how the world does it. 2023-09-09 10:58:19 if you say should in caps i'll understand you mean rfc's should 2023-09-09 10:58:56 I just don't think you can properly judge a person's performance in a job if you aren't able to do that job yourself. 2023-09-09 10:59:28 Doesn't mean you have to be lightning fast at it, or have it as your "forte," but you should know your way around the block well enough to have a real opinion about the person's performance. 2023-09-09 10:59:56 Because it's the manager's job to decide who to promote, who to make team leads, who to give raises to, etc. 2023-09-09 11:00:06 Who to fire. :-( 2023-09-09 11:00:29 Who to move into a different type of work to better fit their skills and so on. 2023-09-09 11:01:26 Also who's reliable and can be counted on to deliver without detailed oversight, who needs handholding to get anything done... all that stuff. 2023-09-09 11:08:47 I also think the manager should be able to plan the team's work, on his own. That doesn't mean you don't include the team in such discussions, but the manager should understand what needs to be done and who is good at what kinds of work to make a passable plan completely autonomously. 2023-09-09 11:09:21 Which includes having an idea of how long various items of work ought to take, etc. 2023-09-09 11:09:46 If the team is sandbagging the work schedule, the manager ought to be able to see it and call it out. 2023-09-09 11:12:05 If someone on the team is new to the profession, then the manager should be able to help them improve. Sit down with them from time to time, look at the work together, point out new ideas to the person... 2023-09-09 11:12:39 "I don't know how that stuff actually works" just isn't an acceptable manager credential in my eyes. 2023-09-09 11:13:52 it is the design of his forth what makes code shorter 2023-09-09 11:13:53 In small companies things usually naturally evolve along the lines I'm talking about - it's in the big companies where you find the "professional managers." 2023-09-09 11:14:24 Yeah, Chuck's "success factors" are strewn all through his tools and methodologies. 2023-09-09 11:14:37 He's a "pervasive optimizer." 2023-09-09 11:14:50 for example he says if you work with a file you have to open it close read write 2023-09-09 11:15:16 his forth has no files so you would use block 2023-09-09 11:15:39 You know, if I'm going to have these "system" and "user" modes, where in user mode some of the instructions are type-directed, there's going to need to be a fast way to flip back and forth. 2023-09-09 11:16:12 Right - since there's not a file system to "automate" parts of the storage management you get to handle those things yourself. 2023-09-09 11:16:47 but i meant you dont have to call all those functions 2023-09-09 11:16:51 Same with floating point - he rejects that too, in facor of scaled integer solutions. Which is really just you directly managing things the floating point library would do automatically. 2023-09-09 11:16:58 you just put the data on the block 2023-09-09 11:17:00 Right. 2023-09-09 11:17:03 no opening close etc 2023-09-09 11:17:14 Sure. But you do have FLUSH. 2023-09-09 11:17:25 You eventually have to make sure the block gets written back out. 2023-09-09 11:17:38 that is what makes his code smaller 2023-09-09 11:17:46 It's one reason. 2023-09-09 11:18:01 he just simplifies the whole concept 2023-09-09 11:18:15 then uses that simple concept 2023-09-09 11:18:28 Yeah. A file system might have N things it can do. But in a given app Chuck might only need two of those things. 2023-09-09 11:18:40 i always felt bad for doing that 2023-09-09 11:18:51 like it was dirty and buggier 2023-09-09 11:18:53 So he doesn't have the baggage of N-2 features hanging around - he just does the two things, manually. 2023-09-09 11:19:28 is like chuck was a ultra lazy person 2023-09-09 11:19:46 Your floating point library can probably calculate sin() and tan() and ln() and e^x() etc. 2023-09-09 11:19:51 You may not need ANY of those. 2023-09-09 11:20:02 Depends on what you're doing. 2023-09-09 11:20:07 i never used any of those 2023-09-09 11:20:22 Oh, I have, but I worked in a university research lab, modeling EM fields. 2023-09-09 11:20:45 I imagine they are VERY OFTEN not needed. 2023-09-09 11:21:06 Most floating point code probably just does + - * /. 2023-09-09 11:21:19 And the truth is those aren't hard to do with scaled integers. 2023-09-09 11:21:57 On the disk front, it may be that you KNOW that what you're loading and saving is, say, 2.5k. 2023-09-09 11:22:07 If your block size is 4k, then you don't need ANY file system help. 2023-09-09 11:22:20 Just pick a spot on the disk for it to live and BLOCK it there - you're done. 2023-09-09 11:22:42 You may not need a record in a directory of where it is - you may just have chosen a number. 2023-09-09 11:23:01 The complexity of the solution can be adjusted to precisely fit the complexity of the problem. 2023-09-09 11:23:52 I do think Chuck's attitude is very extreme. The common argument would be "But next month you're going to need to solve a different problem, and you're going to want it to use the same disk." 2023-09-09 11:24:05 So maybe more generic disk management is "long term" advantageous. 2023-09-09 11:24:12 Chuck just entirely rejects that type of reasoning. 2023-09-09 11:24:27 And I suppose there is a middle ground between the extremes. 2023-09-09 11:25:10 vms14: Let me note that if you wanted to write software for a 3D printer, or a cnc machine, you'd almost certainly need the trig functions. 2023-09-09 11:25:24 Because in both places you're dealing with where things are in space. 2023-09-09 11:26:30 If you need to go from A to B, you have to tell two separate motors how to move, and one of them moves distance*sin(angle) and the other distance*cos(angle). 2023-09-09 11:27:17 So you don't find that stuff ONLY in esoteric scientific analyses. 2023-09-09 11:30:21 chuck recommends to write a browser 2023-09-09 11:30:30 write  a new browser. It's a good application. It gives you access to a world of information. It's a good application and it one that I am trying to focus on in my spare time 2023-09-09 11:30:41 At the time he made that recommendation browsers were a LOT less complex than they are now. 2023-09-09 11:30:45 xd 2023-09-09 11:30:58 I suspect he was talking about just handling HTML. 2023-09-09 11:31:08 but a simple text browser could be fun 2023-09-09 11:31:19 Sure. 2023-09-09 11:31:46 i should write one and name it chuck 2023-09-09 11:31:53 Hee hee. 2023-09-09 11:32:07 I think a typesetting system could also be fun. 2023-09-09 11:32:21 Once again, though, LaTeX is... vast. 2023-09-09 11:32:43 but you mean something that generates latex code? 2023-09-09 11:33:04 No, I meant writing the code to take some specification of the document and produce the pixel patterns. 2023-09-09 11:33:35 Go from a human written text spec to a 2D array of pixels. 2023-09-09 11:33:36 and produce for example a png? 2023-09-09 11:33:45 Or a BMP, or whatever. 2023-09-09 11:34:01 There's a ton of issues involved with making text look good on a display. 2023-09-09 11:34:09 actually you just need to draw into a pixmap 2023-09-09 11:34:21 Yes, but WHAT YOU DRAW is the issue. 2023-09-09 11:34:29 In the end, you want it to be smooth, beautiful text. 2023-09-09 11:34:42 would you read font glyphs and use them? 2023-09-09 11:34:43 Of whatever size the user called for, maybe italicized, bold, etc. etc. 2023-09-09 11:35:04 Well, what if you want to support any font size at all? 2023-09-09 11:35:28 I'm talking about taking some sort of geometric specification of what the characters look like, and then dynamically making a bit image of the proper size. 2023-09-09 11:35:33 would you scale it with the same technique as the zoom? 2023-09-09 11:35:38 Not just having umpteen zillion different font tables. 2023-09-09 11:36:15 To some extent you scale in a standard way, but you can get "artifacts" in how the final image looks that you need to take steps to remove. 2023-09-09 11:36:23 That's my point, it's a deeply "subtle" job. 2023-09-09 11:36:32 It's an "area of expertise." 2023-09-09 11:36:40 you might want to use svg fonts 2023-09-09 11:36:54 they're declarative 2023-09-09 11:36:58 Yes, you might want something like that for your original character spec. 2023-09-09 11:37:08 But if your output device is bitmapped, you eventually have to cross that bridge. 2023-09-09 11:37:42 And large fonts aren't just zoomed up copies of small fonts - you need to fill in stuff and smooth stuff and so on. 2023-09-09 11:37:53 see a text browser is funnier 2023-09-09 11:38:17 I'm just pointing out that both of these are tasks that would lead to a lot of learning. 2023-09-09 11:39:04 There are so many interesting problems that would lead to learning, though. 2023-09-09 11:39:13 Another one is to write a baby SPICE system. 2023-09-09 11:39:24 Text spec of a circuit -> circuit's dynamical behavior. 2023-09-09 11:39:46 That gets you right into numerical analysis, which is a hugely interesting field. 2023-09-09 11:41:22 That's one thing Chuck did I find very interesting - he did all his own transistor circuit modeling, and he did it using fixed point numbers. 2023-09-09 11:41:41 And claimed he got more accurate results than off the shelf tools offered. 2023-09-09 11:42:27 Part of how he would have done that, though, would have been to recognize the boundaries of his own cicuit modeling needs and solved only those parts that needed solving. he didn't have to be prepared for any bizarre circuit a random user might toss at the tool. 2023-09-09 11:43:18 A big part of why Chuck's code is small is that he's good at recognizing what he DOES NOT need to do. 2023-09-09 11:43:52 a browser gets fun when you have to accept bad html 2023-09-09 11:44:01 Absolutely. 2023-09-09 11:44:07 which means any html you will fetch from internet 2023-09-09 11:44:26 Good path code is often fairly straightforward. 2023-09-09 11:45:17 The best way to do "error handling" in a system is to eliminate the possibility of the error happening in the first place. 2023-09-09 11:45:28 The only time you CAN'T do that is when a user is in the loop somewhere. 2023-09-09 11:45:55 In an embedded system where one automated thing is talking to another, you don't necessarily need sophisticated error checking. Just make sure there aren't any errors. 2023-09-09 11:46:30 A power supply that's only ever going to have one circuit connected to it, because it's hard-wired on a circuit board, doesn't need to watch out for a "wrong loaD" being connected. 2023-09-09 11:46:32 Etc. 2023-09-09 11:47:54 of course, a component failure in the "right load" could create a bad state - so you do have to be prepared for that. 2023-09-09 11:48:10 But it's just not as "open ended" a problem as it is when you're dealing with a human. 2023-09-09 11:48:30 For one thing, you have to assume the human is going to deliberately TRY to break you. 2023-09-09 11:51:06 Looks like APL's "array handling" goes beyond Python's and most others. In Python you don't really have a 2D array - you have an "array of arrays" instead. 2023-09-09 11:51:14 Hence [i][j] instead of [i,j]. 2023-09-09 11:51:22 But APL can deal with both. 2023-09-09 11:51:33 Up to arbitrary rank. 2023-09-09 11:53:03 To me the difference between an array and a list is that all items in an array are the same size, and they're situated in contiguous RAM. 2023-09-09 11:53:13 I.e., it's an array IN RAM. 2023-09-09 11:53:22 Whereas items in a list can be anything. 2023-09-09 11:58:27 So if you've got a real array and you store a complex number into one of its entries, you'd need to promote the entire array. 2023-09-09 11:59:58 Looks to me like addressing a multi-dimensional array would mean you needed to set up so that you could take the dot product of an index vector and a "dimension sizE" vector, or some derivative of a size vector. 2023-09-09 12:00:30 And somewhere there would be some tight assembly code for doing that. 2023-09-09 12:02:43 xelxebar: Maybe I need to launch myself a process of "one APL glyph per day" and just start working through them. According to your words last night I'll know the bulk of it in a couple of months. 2023-09-09 12:07:21 i think ill end using vim 2023-09-09 12:07:37 it makes more sense with this keyboard 2023-09-09 12:08:00 i get crazy with emacs hotkeys and not willing to make a setup 2023-09-09 12:08:22 plus i always wanted to escape from emacs anyways 2023-09-09 12:09:09 just need to set esc as control 2023-09-09 12:30:11 Use CapsLock. 2023-09-09 12:30:27 For control, I mean. 2023-09-09 12:30:54 I've always regarded emacs and vim as "similar undertakings." 2023-09-09 12:31:09 About the same amount of work required to get "competent" for either one of them. 2023-09-09 12:34:42 Re: that array indexing, performance would be higher if the "sizes" of each layer entity was a power of two. 2023-09-09 12:35:05 That could get quite wasteful in pathological cases, though. 2023-09-09 12:40:54 oh thats fine 2023-09-09 12:41:07 termux has an option to make the back key be space 2023-09-09 12:41:40 now i just need to get used to vi 2023-09-09 12:41:49 i know just some basics 2023-09-09 12:42:10 but i remember the hotkeys made sense even for mnemonic purposes 2023-09-09 12:42:44 it's hard to use emacs with this keyboard i get super confused 2023-09-09 12:43:48 lol back key be escape* 2023-09-09 13:06:01 Wait - don't you need the back key for... well, "backing up"? 2023-09-09 13:06:49 backups are good to have 2023-09-09 13:06:56 actually it was troubling me when pressed it by accident 2023-09-09 13:07:10 now it will even be useful 2023-09-09 13:07:14 :D 2023-09-09 13:07:42 and i hope i don't get confused like with emacs 2023-09-09 13:08:42 There are some handy little tricks for getting around quickly in vim. You can google up articles on it. Often the fastest way to get somewhere is to use search. 2023-09-09 13:09:02 Just pick any little substring long enough to be unique near where you want to go and fire off a search. 2023-09-09 13:09:09 Then cursor the rest of the way. 2023-09-09 13:09:38 The collapseos "simple editor" works this way too - you can move the insert point by searching. 2023-09-09 13:10:39 i had marks in comments in the past to search them xd 2023-09-09 13:10:48 I did like the emacs ability to inject a control string without having to "leave" insert mode. 2023-09-09 13:11:18 i think for this keyboard command/insert mode makes more sense 2023-09-09 13:11:43 as i don't really get any benefit using control + something hotkeys 2023-09-09 13:11:43 Yeah, if you're typing along and you think you're going to want to come back and polish what you're typing, it's easy just to stick a foo or soemthing in there and then search for all the foos later. 2023-09-09 13:12:16 it makes sense in a standard keyboard because of what they call tempo 2023-09-09 13:12:27 but here there is no tempo :/ 2023-09-09 13:14:11 lack of f t F T drives me nuts in other editors 2023-09-09 13:15:34 f t F T? 2023-09-09 13:16:51 Oh, one thing I find interesting in APL is the ability to take any complex array type thing and "put it in a box" and now it's basically a scalar. 2023-09-09 13:20:18 fE move to first E on line; 2fo move before second o on line, etc 2023-09-09 13:20:46 Oh, ok. 2023-09-09 13:20:55 whoops, 2to for before 2023-09-09 13:21:31 Wow - I didn't know about those. That's cool. 2023-09-09 13:21:38 I knew about the number prefix, of course. 2023-09-09 13:21:53 But that you just told me about - that looks damn useful. 2023-09-09 13:22:01 Thanks. :-) 2023-09-09 13:22:26 https://stackoverflow.com/questions/12495442/what-do-the-f-and-t-commands-do-in-vim 2023-09-09 13:23:43 What I think would be nice is a "transient" command method. 2023-09-09 13:24:18 Say you're in insert mode. I'd like to be able to just TAP the control key, and then do something like 20j or whatever. 2023-09-09 13:24:30 Get that mobility, but not actually have to do esc and i. 2023-09-09 13:24:52 So tapping control would get you a one-shot command. 2023-09-09 13:25:27 The general goal of minimizing esc/i iterations seems like a good one to me. 2023-09-09 13:26:39 idk how much lets you configure the editor, but it seems doable 2023-09-09 13:26:58 you just need to wrap the command into esc and i 2023-09-09 13:27:41 at least in emacs you can do a lot of stuff, and i've heard stuff that makes me feel like what you want is doable 2023-09-09 13:28:09 i'd like to make my own editor 2023-09-09 13:28:16 or some kind of rlwrap 2023-09-09 13:28:36 i want to bind words to hotkeys 2023-09-09 13:35:05 i wonder why do you use vi when you could be using your own editor 2023-09-09 13:38:12 im playing a bit with it and it feels much more comfortable 2023-09-09 13:38:54 and now i can almost code with one hand 2023-09-09 13:39:18 i couldnt even move with one hand with emacs 2023-09-09 13:39:23 unless using the screen 2023-09-09 13:40:38 thrig: so you move mainly with f t F T? 2023-09-09 13:42:05 ah it only works by lines 2023-09-09 13:42:08 :/ 2023-09-09 13:42:49 it's cool anyways 2023-09-09 13:43:12 if it worked on the whole file i would move mainly with that xd 2023-09-09 13:52:53 Implementing editors in Forth is always fun. :-) 2023-09-09 13:53:09 Block editing is considerably simpler than file editing, so you can more quickly get something you can play with. 2023-09-09 13:53:39 You know how EXPECT takes a buffer address and a max size? 2023-09-09 13:54:17 You can leverage that into block editing if you write it so that you can specify "the entire remainder of your block" as the "max size, but have EXPECT only "work on" and "print" the first line of that, up to the first carriage return. 2023-09-09 13:54:47 Then give yourself an entry into that code that allows the buffer to have pre-existing content in it, and allows you to position the cursor on entry. 2023-09-09 13:55:04 Then you have something that lets you "edit a line," but it will shift all the following lines around just the right way. 2023-09-09 13:55:20 So you just point it at the line you want to edit and use it - the rest takes care of itself. 2023-09-09 13:55:41 Of course, you may be moving thousands of bytes on every keystroke, but... computers are fast enough for that. 2023-09-09 13:56:04 And you do it with CMOVE, so it takes advantage of REP. 2023-09-09 13:57:48 My current editor is really just a line editor, but I have a command that will re-list the block as it stands now, with numbered lines, and then I just edit by line number. 2023-09-09 13:58:06 Commands to insert lines, delete lines, etc. 2023-09-09 13:58:14 It's crude, but it's functional. 2023-09-09 14:05:08 xelxebar: What I need to do with these APL glyphs is get myself a really clear picture of a multi-D array in mind and get real clear on what each one does to it. 2023-09-09 14:05:32 I have a suspicion that it's mostly about being able to re-arrange those arrays in various ways, pluck stuff out of them, etc. 2023-09-09 14:10:11 Take something like transpose, for example - you could hit a multi-D array with that at any level. 2023-09-09 18:01:59 KipIngram: Regarding demotion of number to smaller types, there's something called Comparison Tolerance that determines the delta for number to be equal. 2023-09-09 18:04:54 For picturing multidimensional arrays, it's... challenging... to try direct visualisation, but thinking about Rank and Shape often help a lot. 2023-09-09 18:06:52 That said, the vast majority of APL code just deals with scalars, vectors, and matrices. It's completely reasonable to bootstrap your intuitions on the primitives with these lower-dimensional domains. 2023-09-09 18:07:39 I *really* hope you get into APL. Would love to see how you marry Forth and APL to get the best of both. 2023-09-09 18:14:11 KipIngram: Possibly other languages fault here 2023-09-09 18:15:29 Confused meaning of 'dimension' 2023-09-09 18:16:17 But an NxN matrix is two-dimensional, but can represent something in N-dimensional space, or NxN dimensions.... 2023-09-09 18:17:14 http://clhs.lisp.se/Body/f_ar_d_1.htm#array-dimensions 2023-09-09 18:21:33 The examples on that page are bad 2023-09-09 18:22:08 Meh, the meaning is pretty obvious here, IMHO, so I think it's fine. But, yeah, 'rank' is the "correct" term, both in math and APL. 2023-09-09 18:22:24 The example pretty much says "array-dimensions gives you the array dimensions" 2023-09-09 18:22:42 CLHS also has ARRAY-RANK (don't think I've ever used that, have used dimensions a lot) 2023-09-09 18:24:25 In essence I believe it's reasonable to define dimension and rank this way, and it's consistent, and 'rank' means a few different things in maths already anyway 2023-09-09 18:25:09 But it needs definition, it can't be assumed, and certainly in C talk 'dimension' can mean either of those things depending on who you ask 2023-09-09 18:25:36 I like to use DIM as my "array length" macro name because it's short and people seem to know what I mean when I use it 2023-09-09 18:26:01 But I also describe x[3][3] as a "two dimensional array" so it is what it is 2023-09-09 18:33:56 Scary lights outside :( 2023-09-09 18:38:58 Think it's some laser show, really horrid light pollution 2023-09-09 18:40:47 xelxebar: I was just pointing out that rank means something very different in linear algebra. 2023-09-09 18:41:22 Has anyone here seen the Nishimura comet? 2023-09-09 18:42:14 Yes, x[3][3] is a two dimensional array, and could have rank anywhere from 1 to 3. Or maybe 0 too - what do they say the rank of a zero matrix is in linear algebra? 2023-09-09 18:42:32 I mean, it has to do with the number of linear relationships expressed in the matrix, and in the zero matrix there aren't any. 2023-09-09 18:42:53 Zero I'd guess 2023-09-09 18:42:59 i think it should be. 2023-09-09 18:43:17 Don't get hung up on it 2023-09-09 18:43:19 And otherwise (non-zero matrix) you'd have at least rank 1 and perhaps more. 2023-09-09 18:43:47 Apparently we will get best viewing on Tuesday 2023-09-09 18:43:56 However, they also use the word rank to talk about tensors. 2023-09-09 18:44:19 tensor of rank 2 has two indices. So that's the similar concept to how APL uses it. 2023-09-09 18:46:11 KipIngram: Definitely. Rank has different meanings in apl and linalg. 2023-09-09 18:48:32 For the latter, it's probably easier to think in terms of null space vs rank. Since an all 0 matrix sends everything to 0, the space spanned by it's output vectors has a zero dimension. 2023-09-09 18:49:38 Good point about tensors. Luckily (?) in APL we don't have to distinguish between upper and lower indices :P 2023-09-09 18:52:33 Yes, that sounds right to me. Rank plus nullity is always dimension, right? 2023-09-09 18:53:44 Oh, I may want to support covariant and contravariant ideas in whatever I come up with. It's kind of a necessary concept for various parts of physics. 2023-09-09 18:54:40 They dodge having to teach you anything about that in early physics by sticking really close to Cartesian coordinate systems, where the contravariant and covariant components are the same. 2023-09-09 18:55:59 It's still pretty easy to at least motivate the ideas though. Consider a velocity vector. Say you want to switch from feet as your length unit to inches. You have to multiply all of your velocity components by 12. You made the unit smaller, the components got bigger. That's contravarianT (contrary). 2023-09-09 18:56:33 Now consider your vector represents a power density. When you go from watts per square foot to watts per square inch, you have to DIVIDE your components by 144. 2023-09-09 18:56:38 That's covariant. 2023-09-09 18:56:58 So both of them are "vectors," but they behave entirely differently under coordinate system changes. 2023-09-09 18:58:14 So when you go from feet to inches, some of your vector components get bigger and some get smaller. That has to be kept proper track of when you're trying to do things "with full generality." 2023-09-09 20:31:08 You know, this 32655 chip has 128k of RAM but 512k of flash. It occurred to me that in this design I'm looking at I actually could place my headers in flash and block in needed bits. Then my RAM could be solid code/data. 2023-09-09 20:48:30 xelxebar, where does the 0 cell come from in this APL? 2023-09-09 20:48:33 5 5⍴⎕A 2023-09-09 20:48:35 ┌─────┬─┐ 2023-09-09 20:48:37 │ABCDE│0│ 2023-09-09 20:48:39 │FGHIJ│ │ 2023-09-09 20:48:41 │KLMNO│ │ 2023-09-09 20:48:43 │PQRST│ │ 2023-09-09 20:48:45 │UVWXY│ │ 2023-09-09 20:48:47 └─────┴─┘ 2023-09-09 20:51:47 I expected just the left box. 2023-09-09 20:52:36 Oh. Weird. Did it again: 2023-09-09 20:52:38 5 5 ⍴⎕A 2023-09-09 20:52:40 ABCDE 2023-09-09 20:52:42 FGHIJ 2023-09-09 20:52:44 KLMNO 2023-09-09 20:52:46 PQRST 2023-09-09 20:52:48 UVWXY 2023-09-09 20:52:50 THAt is what I expected. 2023-09-09 20:52:52 Don't know what happened the first time. 2023-09-09 20:55:59 So I'm definitely going assign some entire groups of opcodes to the same call instruction, so that I can use it as a "shortened opcode." The normal opcode parser will pick up some of the bits of the offset as "opcode bits," but those will be don't cares - it'll go to the same handling code regardless. The idea is to get a very compact format for making "local" calls (which will characterize most calls that 2023-09-09 20:56:01 appear just as a result of factoring). 2023-09-09 20:56:32 Won't be able to use that to call a built-in word that's likely far away, but "helper" words will tend to be close by. 2023-09-09 21:00:51 I see what happened with the above APL. Just before the first one I'd typed this: 2023-09-09 21:00:53 ⎕0 2023-09-09 21:00:55 ⎕: 2023-09-09 21:01:09 I thought that was just a failure, but it looks like it's prompting for something. 2023-09-09 21:01:39 I duplicated that only did the ⎕0 twice, and got a "double boxed" result. 2023-09-09 21:03:02 mmm tofu 2023-09-09 21:24:54 Anyway, this is going to make the system even more compact. The helper definitions will have no permanent headers and I'll be able to call helpers within 256 bytes of the calling instruction using basically just an opcode-sized field. 2023-09-09 21:25:56 And also any word that I've placed in the first 256 bytes of RAM, so whichever ones are the most commonly used that I choose to put there (those would be non-helper, generic Forth definitions). 2023-09-09 21:27:24 In that video where the guy presents the DB48X project (deployment of HP48 type system on the DM42), his first attempt was to just port the software over. But it was too big, so he had to re-impelemnt and try to make it more compact. I think this system I'm cooking up is compact enough that I could mae a run at a similar type project. 2023-09-09 21:27:53 Not that I'd go just try to copy what he's done, but I'd be able to get similar or superior complexity into the available space of the device. 2023-09-09 21:51:37 Oh, this is good... 2023-09-09 21:51:39 https://www.youtube.com/watch?v=VO2A6I3Woos 2023-09-09 22:09:41 My first look at it wasn't quite like his (his is better of course). What I saw was this: 2023-09-09 22:10:01 1 - 1/2 + 1/3 - 1/4 + 1/5 - 1/6 + 1/7 - 1/8 ... 2023-09-09 22:10:46 Now, note that 1-1/2 = 1/2, so replace the first two terms with 1/2. Then note that 1/3-1/4 = 4/12-3/12 = 1/12, so replace the next two terms with +1/12. 2023-09-09 22:11:06 1/5-1/6 = 6/30-5/30 = 1/30; replace those terms with +1/30. 2023-09-09 22:11:32 And so on. Each time the denominator increases by the previous increase plus eight. So we wind up with 2023-09-09 22:12:12 1/2 + 1/12 + 1/30 + 1/56 + 1/90 + 1/128 + ... 2023-09-09 22:12:16 That's as far as I got. 2023-09-09 22:12:43 Anyway, turns out it converges to ln(2); he demonstrates it visually in the video. 2023-09-09 22:13:47 Anyway, notice that the denominator DELTAS are 10, 18, 26, 34, ... 2023-09-09 22:14:18 BTW, I think my 128 denominator is wrong - just did some arithmetic in my head wrong. 2023-09-09 22:14:27 Or maybe the pattern fails if I keep pushing it out. 2023-09-09 22:41:04 Actually he demonstrates that the series is equal to many different things - turns out all of those are "cheats." I'm pretty sure it actually diverges. 2023-09-09 22:41:58 You can get false sums by monkeying with which items of the series you take at any given step. But the process I outlined up there doesn't cheat - it takes the terms in their logical order, as they come. I coded it up in Python and the result just kept getting bigger.