2023-09-18 03:27:06 hello guys 2023-09-18 03:27:07 whos online? 2023-09-18 05:38:21 Not me 2023-09-18 05:48:24 kinda 2023-09-18 06:00:27 ~I am 2023-09-18 08:56:18 I'm here. 2023-09-18 09:06:10 I'm also here now 2023-09-18 10:49:05 siesta: How've you been? I'm on vacation this week. :-) 2023-09-18 10:51:20 vacation? i thought you were retired 2023-09-18 10:51:29 No, not yet. 2023-09-18 10:52:15 Youngest daughter started college this fall - need to get her done and then I can start thinking about that. 2023-09-18 10:52:51 I suspect I'm going to like retirement quite a lot. 2023-09-18 10:53:20 poor keyboard 2023-09-18 10:53:21 hahhaha 2023-09-18 10:53:54 well actually typing code is not a big part of programming 2023-09-18 10:54:11 but i expect you will type a lot of code 2023-09-18 10:54:38 "Official" retirement age in the US is 67 these days. I'll be 61 in January. So by then that last daughter will be "launched" - maybe I'll just do the "standard approach." 2023-09-18 10:54:45 i assume it will be then when you start/focus with the operating system 2023-09-18 10:55:07 Ugh. I hope I get some stuff done before then, but yeah - you may wind up right. 2023-09-18 11:01:53 I agree re: typing code - I've always felt that the "thinking about it phase" is quite important too. But yeah - sooner or later you get around to needing to type. 2023-09-18 11:02:34 I don't like "figuring things out" at the keyboard - by the time I get there I want to KNOW how I'm going to do everything. 2023-09-18 11:22:04 We were talking over the weekend about run-time vs. compile-time. The thing is, regardless of what is done at run-time, the compiler still is going to need to have an "awareness" of the types of the stuff on the stack, just in order to handle its job properly. 2023-09-18 11:22:20 I'm sure that will allow some decisions to happen at compile time. 2023-09-18 11:23:32 KipIngram: in my case i do figure a lot of things at the keyboard, cause i'm in a learning process and what i mainly do is to check random ideas like the ones i always expose here 2023-09-18 11:23:34 xd 2023-09-18 11:23:51 but yes, mostly i'm always thinking and taking decisions 2023-09-18 11:24:02 Yes - when you're engaged in a learning process you often want to "tinker" at the keyboard. That's just a whole different activity. 2023-09-18 11:24:13 I was doing that over the weekend with Geogebra. 2023-09-18 11:24:38 It's really neat to be able to make those "ruler and compass" type drawings and tinker with them. 2023-09-18 11:24:49 but there's a lot to think before touching the keyboard 2023-09-18 11:25:05 Exactly the sort of thing you would DO with a ruler and compass in the old days, but the computer handles the tedious details. 2023-09-18 11:25:08 that's in part why i like so much to have a phone as my dev platform 2023-09-18 11:25:23 at any moment the editor is opened 2023-09-18 11:25:43 Yeah, you never know when a thought might occur to you. 2023-09-18 11:25:47 at any moment i can try random ideas or whatever, no matter where i am 2023-09-18 11:25:59 this is mainly why i wanted it 2023-09-18 11:26:32 emacs is open 24/7 with evil mode 2023-09-18 11:26:50 and in another session my abomination running in a repl 2023-09-18 11:27:13 https://imgur.com/a/jkkz7gI 2023-09-18 11:28:03 althought i guess i'll make prompt return a string instead of printing 2023-09-18 11:29:18 i don't have the dot word to print yet, cause i want to wrap it with stuff 2023-09-18 11:32:38 There's no law that says . has to print a number. That's just a "Forth cultural thing." 2023-09-18 11:34:05 Like, the simple act of storing someting in a variable. Forth calls it !, APL uses ←, other languages use =, etc. 2023-09-18 11:45:11 ! in scheme is also used to denote mutation 2023-09-18 11:45:50 and ? for predicates, where in lisp is a 'p' 2023-09-18 11:46:07 (number? x) (numberp x) 2023-09-18 11:47:01 there's a post or a list of forth conventions? 2023-09-18 11:47:20 http://www.forth.org/forth_style.html 2023-09-18 11:47:22 oh 2023-09-18 11:52:10 https://github.com/ForthHub/discussion/issues/73 2023-09-18 12:01:07 I really think of the explicit "customary names" as not terribly relevant. Just choices that got made somewhere along the line. 2023-09-18 12:02:02 onboarding new people is trickier if your DSL is totally different 2023-09-18 12:07:16 vms14: So, once you start working with the idea that your compiler is going to have to know stack item types, then that forces you to incorporate some way of having the source code specify that. I.e., you need to give each word an effects comment - "takes these types, makes these types." So that will immediately complicate the language if you initially didn't need that (which you don't in Forth). 2023-09-18 12:07:55 Forth stack comments are really ideal for that, but I've never been in the habit of using them pervasively, so it would be a pretty big change for me. 2023-09-18 12:08:07 I'd have to acclimate myself to how it would change the appearance of the source code. 2023-09-18 12:10:34 you can infer them 2023-09-18 12:10:36 We're used to seeing those only immediately after the word name in a : definition, but really you could inject one anywhere in the code. 2023-09-18 12:11:06 so, if two paths joined up and the compiler couldnt suss out what the stack would look like there, you could "inform it." 2023-09-18 12:11:29 That's what I'm talking about here. 2023-09-18 12:11:37 You can create situations in which you can't infer them. 2023-09-18 12:11:49 if al words have a return type you can 2023-09-18 12:12:14 even if not you could 2023-09-18 12:12:20 : foo ... IF SWAP THEN ... ; 2023-09-18 12:12:28 What's the type situation in the second ...? 2023-09-18 12:12:43 You don't know until run-time when you know whether or not the IF fired. 2023-09-18 12:13:09 Or, for that matter, just ?DUP. 2023-09-18 12:13:27 The type picture of the stack depends on which way it acts. 2023-09-18 12:13:35 hmm 2023-09-18 12:13:48 no idea how others do 2023-09-18 12:14:08 I'm just saying that in any such situation the compiler could demand that you insert a stack picture. 2023-09-18 12:14:17 supposedly foo would have to mark what type returns 2023-09-18 12:14:23 Or, you might need to tell it how to handle either situation. 2023-09-18 12:15:04 At run time all becomes clear, but you can't necessarily anticipate those things at compile time. 2023-09-18 12:15:17 This is WHY you may need some run-time choice capability too. 2023-09-18 12:15:35 If you could infer EVERYTHING, then you wouldn't need any run-time choices. 2023-09-18 12:15:41 And that's "ideal." 2023-09-18 12:15:47 it's harder, but they do achieve type inference in compilers somehow 2023-09-18 12:15:53 But I just don't think you can assume you'll always be able to do it. 2023-09-18 12:16:25 but usually on those langs you specify what the function takes and returns 2023-09-18 12:16:32 ah no xd 2023-09-18 12:16:45 Yeah, but IF ... THEN isn't a function. 2023-09-18 12:16:53 well no idea how they do, i assume they have a way to follow a chain 2023-09-18 12:17:19 Or, here: 2023-09-18 12:17:36 ... SQRT ... 2023-09-18 12:17:44 squirt here 2023-09-18 12:17:45 At , is the item on the stack real or complex? 2023-09-18 12:18:15 Imagine a polynomial root solver. 2023-09-18 12:18:35 For, say, a cubic. You know you'll have one real root, but the other two might be real or might be complex conjugates. 2023-09-18 12:19:02 You could just say you were going to treat all numbes as complex, and that will solve the problem. 2023-09-18 12:19:16 But there are downsides of that performance-wise, output readability wise, etc. 2023-09-18 12:19:23 supposedly if you don't change types in a variable or 'value' you can add their type info 2023-09-18 12:20:21 can also keep track of their casts to other values or whatever 2023-09-18 12:20:51 i have no idea, compiling is something i can't talk about 2023-09-18 12:21:06 The main point I'm trying to make is that sometimes the end result depends on the VALUE of the data - not just on its type. 2023-09-18 12:21:22 Square root of a real number just isn't always a real number. 2023-09-18 12:23:27 The product of two matrices might be a matrix, or it might collapse to a scalar, depending on the dimensions of the input matrices. Do you really want different types for every distinct dimensionality? 2023-09-18 12:24:29 A 5-row, 1-column matrix times a 1-row, 5-column matrix is a 5x5 matrix. But a 1-row, 5-column times a 5-row, 1-column product is a NUMBER. 2023-09-18 12:25:35 Now in that case you could have a "row vector type" and a "column vector type' and those * operations would just be different operations. But the more you try to go to "general support" the harder it all becomes. 2023-09-18 12:27:32 this is one of the things what I do not like about types,  the 'generalization' attempts that often fail miserably 2023-09-18 12:28:33 the other is only typing variables, arguments and returns 2023-09-18 12:30:37 here is a thing, I can have a variable that has a guard that only allows/coerces-to certain values that it can hold. 2023-09-18 12:31:42 these values could themselfs by typed (having a tag or such) saying for instance that it is a ponter into a spefic ROM 2023-09-18 12:33:02 I probably can go on and on 2023-09-18 12:34:58 Yes, I can imagine just typing 17+j3 and having the system know that there is now a complex value on the stack. 2023-09-18 12:35:09 This definitely applies to things that may never be stored in a variable. 2023-09-18 12:36:09 another thing is operator overloading. C++ is notorious for this missuse 2023-09-18 12:36:45 Yeah, I'm pretty sure I want operator overloading. I just want to be able to say * and have that multiply whatever the top two items on the stack are. 2023-09-18 12:36:58 Integers, floats, complex, vectors, matrices, etc. 2023-09-18 12:37:13 Chuck would strongly disapprove. 2023-09-18 12:37:53 And I understand his reasoning - for some very specific problem it's very likely I could code the whole thing more efficiently by writing "app specific" algorithms. 2023-09-18 12:38:16 He just hasn't really done a lot of work on "generic tools." 2023-09-18 12:38:25 I rather go the Lua 5.4 or E way of translating such into object method calls 2023-09-18 12:38:29 He'd likely say you shouldn't even want them. 2023-09-18 12:39:17 later historians would come to debate whether Chuck was a historical figure or not 2023-09-18 12:39:28 It's just hard for me to imagine a FRIENDLY scientific computing package where I can't just multiply whatever's on the stack. 2023-09-18 12:39:50 then again I rather dislike contemporary equations notation 2023-09-18 12:41:14 when I was learning about alternating current stuff I deliverately used the MS Word equation editor to translate the equations into MathML that is used in docx 2023-09-18 12:41:16 As I go down this APL road, I don't want to be thinking about 2x2 arrays, 2x2x3 arrays, etc. - or even 2D arrays, 3D arrays, etc. I want "arrays." 2023-09-18 12:41:35 Which means that the data structure will have to specify everything: the number of dimensions, the size in each dimension, etc. 2023-09-18 12:41:47 no, you want matrixes 2023-09-18 12:41:51 And the algorithms will have to use that information to know what to do. 2023-09-18 12:42:00 KipIngram: Rather than invoking the name of Chuck, I will say the Forthy way to do this is to have * etc be whatever the most app-appropriate def of * is 2023-09-18 12:42:14 i.e. don't use generic names, name things for the current app 2023-09-18 12:42:16 Yes. 2023-09-18 12:42:26 And that doesn't require not having generic code 2023-09-18 12:42:41 But you might need some kind of renaming maybe to make things nicer 2023-09-18 12:42:41 No doubt about that - Forth would say that I need to know what my data looks like and CHOOSE the specific word that is right for that case. 2023-09-18 12:43:03 * F* C* dot* cross* M* etc. 2023-09-18 12:43:09 So I could have Forth use * for matrices if it made sense, by doing : * MATRIX* ; 2023-09-18 12:43:24 And I've made a dialect 2023-09-18 12:43:46 But tomorrow I do something where I don't want * as matrices, well if it's a different app it doesn't need the same names 2023-09-18 12:43:49 I know. I guess my whole point is that I just don't regard that approach as adequate for the sort of general scientific environment I'm wanting. 2023-09-18 12:43:58 having an algorythm 'know what to do' is an ask, like in the 'Dont ask, tell' principle, which is to me an design/code smell. (Having something asking what something else is and changing the behaviour based on that) 2023-09-18 12:44:12 But i am thinking about a general tool, and not a program for any one specific application. 2023-09-18 12:44:50 Chuck would tell me that I shouldn't write such a tool. I should wait until I'm faced with a specific problem and then solve that problem. 2023-09-18 12:44:55 'Forth' as most of us know it is itself a general tool and not application-specific 2023-09-18 12:45:03 Although it certainly does some apps better than others 2023-09-18 12:45:17 I hope you wanted a dot matrix printed report and command line data entry 2023-09-18 12:45:32 yeah, but having an objsys where the 'arrays', 'matrixes' are objects makes more sense to me 2023-09-18 12:45:38 That's probably one reason Chuck winds up writing much more compact code. I think his whole thought process is in that "case specific mode." 2023-09-18 12:46:45 If you think about it, though, this is the whole reason we all have operating systems on our computer to start with. 2023-09-18 12:46:58 so we can readily chase after a lot of different problems. 2023-09-18 12:47:47 hmm... I think Chuck is more like an MCU programmer than anything else 2023-09-18 12:47:54 Zarutian_iPad: to me an "object" is something that sits in RAM. 2023-09-18 12:48:05 I want to be able to type in a literal vector or matrix. 2023-09-18 12:48:37 I think sometimes when I use these terms I'm not being as specific as a computer scientist might be. 2023-09-18 12:48:52 to some extent i do think of these things as objects. 2023-09-18 12:49:14 When I type in a literal vector, I see that as an "object" that gets put on a heap with a pointer to it on the stack. 2023-09-18 12:49:36 And if I then type *, well, it's going to use that info in the heap to figure out what to do - that feels like a "method" to me. 2023-09-18 12:49:45 KipIngram: what you typed in gets allotted into RAM and then if nothing refers to it at the end of the calculation, gets gc'ed 2023-09-18 12:49:46 That literal vector would have a "method" named *. 2023-09-18 12:49:56 Yes. 2023-09-18 12:50:03 One way or another. 2023-09-18 12:50:31 I'm just not promising that I use terms like "object" and "method" and so on in what might be considered a strictly correct way, by a purist. 2023-09-18 12:51:23 in that objsys I described I do not have a vtable like in c++ or such. Just an xt that gets the method invocation and can decide which method to use based on the selector, etc 2023-09-18 12:52:06 But to make that decision it's going to need SOMETHING LIKE a table or something SOMEWHERE. 2023-09-18 12:52:14 basically using the same-ish idea that CREATE and DOES> are 2023-09-18 12:52:17 The decision information has to be placed somewhere. 2023-09-18 12:53:06 And when I type a 'literal somethin' directly into the system, the system has to be able to decide what that thing is, so that it can associate the right type info with it. 2023-09-18 12:53:20 in a jumptable in the code that the xt points to. This allows for more flexibility and possible composition of traits 2023-09-18 12:53:50 I don't think we're disagreeing. 2023-09-18 12:53:56 We're just talking past each other. 2023-09-18 12:54:27 or it can be a one if statement that handles a particular method and delegates the rest to another word 2023-09-18 12:56:15 hmm... usually what I have seen regarding using types is there often is something like js`typeof(a) == "number"` or js`instanceof(specimen, constructor)` used as part of a condition of an if statement 2023-09-18 12:57:40 that approach is brittle as hell 2023-09-18 13:00:45 how Lua does operator overloading or how the numerical tower in Scheme/CommonLisp does the same is worth looking at as ideamine 2023-09-18 13:02:19 jenga tower 2023-09-18 13:20:12 Generally speaking I'd expect "performance" and "brittleness" to go together, and I'm just now sure yet exactly where I want to land. "High performance, zero brittleness" is unlikely to exist. 2023-09-18 13:20:59 there are enough ambious pzumas in the world already 2023-09-18 13:21:13 When a human being works problems like the ones I'm thinking about by hand, we just gracefully morph from one type to another in whatever way makes sense. But computers can't just "know to do" such things - one way or another they have to be told. 2023-09-18 13:21:49 I'm not "choosing" or "ruling out" any specific way of doing that yet. 2023-09-18 13:21:53 why does 3 2 1 swap swap result in 1 2 3 in gforth? 3 2 1 dup nip makes more sense to me 2023-09-18 13:22:15 It wouldn't. 2023-09-18 13:22:21 It would result in 3 1 2 2023-09-18 13:22:36 3 2 1 swap swap . . . 1 2 3 ok 2023-09-18 13:22:57 Oh, I was describing the "stack," not the output you'd get from . . . 2023-09-18 13:23:08 Ah, that's where I'm confused 2023-09-18 13:23:09 3 1 2 . . . would print 2 1 3 2023-09-18 13:23:30 Usually when you write a Forth stack state you put deeper items to the left, items nearer the top to the right. 2023-09-18 13:23:47 : SWAP ( a b -- b a) ... ; 2023-09-18 13:24:12 Anything deeper than the stuff shown in such a "stack effect comment" is just left unaffected. 2023-09-18 13:25:49 That helps, thank you 2023-09-18 13:25:58 Sure thing. 2023-09-18 13:26:32 Your Forth may have a .s word that prints the whole stack, and it will likely print it the way I described, deeper left, shallower right. 2023-09-18 13:26:58 yeah, I do see that 2023-09-18 13:27:42 I'm trying to come up with a one liner for creating a stack state of 3 2 1 and then reversing it. That's my end goal. I'm hoping it doesn't take me an entire day to do this :) 2023-09-18 13:28:13 :-) 2023-09-18 13:28:35 Look into words OVER and ROT and -ROT. Shouldn't take you too long. 2023-09-18 13:29:06 3 2 1 dup swap nip (pretty sure that's it) 2023-09-18 13:29:27 dup swap doesn't actually do anthing more than just dup. 2023-09-18 13:29:37 The swap will be swapping two equal items. 2023-09-18 13:29:51 Then nip will just discard one of them. 2023-09-18 13:29:55 oh, I keep getting confused with the `.` 2023-09-18 13:30:05 So dup swap nip does nothing at all. 2023-09-18 13:30:09 .s shows <3> 3 2 1 2023-09-18 13:30:23 looking into rot and -rot 2023-09-18 13:30:50 You'll get it. I'm refraining from helping - you're trying to learn here, so I'll leave the experience for you. :-) 2023-09-18 13:33:16 viking swimming lessons 2023-09-18 13:41:24 3 2 1 -rot swap (seems to have done it) 2023-09-18 13:43:46 3 2 1 (.s <3> 3 2 1 ok) -rot swap (.s <3> 1 2 3 ok) 2023-09-18 13:51:03 Nice. 2023-09-18 13:51:37 You get good at such dances with some practice. 2023-09-18 13:51:48 you start to just get a "feel" for it all. 2023-09-18 13:52:19 Of course, in a real Forth program you'd try to write earlier code so that you didn't need something like that - plan it so the numbers wind up the way you want them. 2023-09-18 13:52:32 it's funny cause supposedly being good at stack manipulation means you are a bad forthwright 2023-09-18 13:52:47 It does send a mixed signal, yes. 2023-09-18 13:53:04 You should be good at stack noodling, but then again you shouldn't NEED to be good at it. 2023-09-18 13:53:44 If I had to guess I'd say most people's experience curve took them through the "good at noodling" phase on their way to "don't need to noodle." 2023-09-18 13:54:02 heath: how it is going your forth experience? 2023-09-18 13:54:18 it's cool to see people interested in forth 2023-09-18 13:56:16 this reminds me about similar stuff when the novice uses the simplest option cause it is the simpler, while others do elaborate tricks and alike, and at the end the pro chooses to do the same as the novice because it is the simplest option 2023-09-18 13:56:50 he does not need to show anyone what he knows 2023-09-18 13:57:30 i kind of like it, cause i try to avoid "smart code" 2023-09-18 13:58:32 i prefer to code like a noob even when an option is shorter, cause this option does not give any benefit and makes reading more difficult as a novice can't understand it 2023-09-18 13:59:08 but i like to learn shorter ways to do stuff and use them 2023-09-18 14:27:53 vms14: it's fun! I have To Mock a Mockingbird lying around, and I'd like to go through that with gforth, but first, I'm reading the info pages 2023-09-18 14:41:17 There are certain patterns that you see a lot and learn and get more proficient with regarding the stack 2023-09-18 15:39:06 and you can always make your own words 2023-09-18 15:39:17 actually you are encouraged to do that 2023-09-18 15:48:09 The info pages for gforth are actually alright 2023-09-18 15:48:26 heath: Also get the latest version of gforth, it's not available on most distros 2023-09-18 15:48:32 If yours says 0.7.3 it's not the latest 2023-09-18 15:48:58 Although having 0.7.3 installed is a prerequisite for building the latest 2023-09-18 15:49:04 seems to be anyway 2023-09-18 15:51:51 https://www.complang.tuwien.ac.at/forth/gforth/Snapshots/current/ 2023-09-18 16:01:50 I'm getting close to being able to share a Forth I've written over the last week or so 2023-09-18 17:16:29 :O 2023-09-18 17:17:44 that server has modperl mod python and ph 2023-09-18 17:17:48 php 2023-09-18 17:18:11 veltas: you never talk about your forth :/ 2023-09-18 17:31:12 the first rule of forth club... 2023-09-18 17:31:31 ...is beeing retro? 2023-09-18 17:35:39 it's you don't talk about your forth 2023-09-18 17:40:48 I've got one for the ZX Spectrum but I've been writing one for x86 recently 2023-09-18 17:44:13 are you going to document it? 2023-09-18 17:45:05 Well first I need to write it, but I'm almost at a state where it's worth sharing the in-progress code 2023-09-18 23:39:38 This is apt to sound a little loony, but I'm starting to think maybe there's some kind fo a fusion possible here between the array related stuff I've been talking about and Wildberger's rational number emphasis and the projective geometry way of looking at things that lets one clear fractions. I'm starting to think maybe I could do some very general computing using just arrays of integers. 2023-09-18 23:40:35 Practically speaking, the projective stuff "jumps you up a dimension." to do a two-dimensional analysis, you use three dimensions - the third one absorbs what would be the "constants" in the 2D equations and is key to allowing the integer representation for everything. 2023-09-18 23:40:48 A 3D analysis would involve 4D geometry. 2023-09-18 23:41:11 So it's like you "pay" by taking on an additional dimension, but you get all kinds of benefits from doing so.