2023-01-16 07:07:01 KipIngram: ya a complaint about the Prime is that RPN doesn't seem well integrated :/ 2023-01-16 08:59:29 That implies it's something of a lost art in the company. That's a shame. 2023-01-16 09:31:21 Challenge of the day is to figure out what this does: if (!(~reg & (mask1 | mask2))) 2023-01-16 09:31:36 If mask1 and mask2 are the masks of two bits, for a register value reg 2023-01-16 09:38:51 test case time? 2023-01-16 09:42:39 Well mask1 mask2 would be better named flag1 flag2 2023-01-16 09:48:57 It's just testing if bits from either mask are unset in reg, no? 2023-01-16 09:50:58 The `!` seems kind of redundant (and irksome) there, but I guess it must be some sort of exceptional case. 2023-01-16 10:10:50 maybe the ! is to make it a "well-formed flag" or whatever the term is 2023-01-16 10:10:56 all ones or all zeroes 2023-01-16 10:13:12 KipIngram: definitely. the story of the last few models of HP calculators is fascinating if you havent looked into it. some French guys, some of them in high school, wrote a new UI and added other awesome stuff like CAS to the HP-48GX so HP hired them and turned that into the HP-49G. one of those guys worked on the successor calculators and I think it was him and another guy they hired who made the Prime 2023-01-16 10:13:37 then those two guys got transferred to other stuff as of last year 2023-01-16 10:17:54 Sure, ! and !! make it well formed, but I just meant that since it's used as an `if` rather than an `else`, it's probably an exception. 2023-01-16 10:18:25 And that'll be in the range of zero or non-zero. 2023-01-16 10:25:57 oh missed the `if` part. ya doesnt seem that useful 2023-01-16 10:26:57 I'm just nitpicking. 2023-01-16 11:48:58 Oh, I miseed the if as well - it was alone at the end of the previous line in my view. 2023-01-16 11:49:46 MrMobius: That's an interesting story, and almost seems to imply that somewhere along the line HP "forgot" how to do RPN well. 2023-01-16 11:50:14 If they had to hire clever kids to get a product out the door. 2023-01-16 11:50:36 I had a lot of admiration for HP in the early days. 2023-01-16 11:51:45 But they kind of just fell prey to the corporate disease over the years. 2023-01-16 11:52:13 One of the best things about the 1980 or so calculators was how their keys operated. It stood them out. 2023-01-16 11:52:24 Then they just cost cut that marvelous behavior right out of existence. 2023-01-16 11:52:54 I understand the desire to cut costs - it's a worthy endeavor. But you shouldn't throw the baby out with the bath water. 2023-01-16 11:52:59 And that's exactly what they did. 2023-01-16 11:53:27 There's such a thing as saying "This is the right answer, and it's not going away - EVER." 2023-01-16 11:54:27 But it takes an enlightened leader to enforce that kind of thing, and I guess sooner or later you're going to get crap leaders. 2023-01-16 11:54:59 I think the decline of HP began the minute Hewlett and Packard were no longer personaly running it. 2023-01-16 11:57:31 According to Wikipedia. Hewlett stepped down as CEO in 1978. 2023-01-16 11:57:47 That fits perfectly - they got a small number of years on "inertia." 2023-01-16 11:58:22 the 1980s was also the era of "take corpration over, wring it dry, toss it aside" 2023-01-16 11:59:18 Yes. 2023-01-16 12:00:03 The very idea that the leaders of corporations are primarily driven by the interests of the shareholders is crap. They pay lip service to it, but they're looking out for THEMSELVES, and whenever they want they can jump s hip and go to a new company. 2023-01-16 12:00:53 So the whole model is fundamentally flawed. 2023-01-16 12:01:08 Any model that separates "control" fROM " ownership" is. 2023-01-16 12:02:08 Honestly, shareholders aren't interested in the future of the company either. Because THEY can jump ship anytime they want by just selling their shares. 2023-01-16 12:02:33 There's just nothing about the model that fosters the long term success of the business endeavor itself. 2023-01-16 13:06:29 do you make word names in past form? 2023-01-16 13:07:15 generally no ("why is it in past??") 2023-01-16 13:07:21 don't remember where I read about it, but in some forth post I saw a guy saying past forms could be used 2023-01-16 13:07:39 as being a rpn lang, it could make more sense 2023-01-16 13:08:59 " I'll kill you" enemy said 2023-01-16 13:09:01 xD 2023-01-16 13:09:30 and then you have to worry about aorist, etc 2023-01-16 13:10:08 still it could be 'says' 2023-01-16 13:11:28 well after all no one will use the lang except me 2023-01-16 13:11:39 or just 'say'f 2023-01-16 13:12:21 but still I worry about readabilty 2023-01-16 13:13:03 I can't worry about performance :/ 2023-01-16 13:50:45 people: you should write good code. me: makes a word named '#!/usr/bin/env' that discards a line of code 2023-01-16 14:11:05 I've never given it conscious thought, but I think I generally go for present tense. SAY ACT etc. And Forth comes with SWAP DUP ROT etc. 2023-01-16 14:11:21 I think of it as me issuing a command to the computer. 2023-01-16 14:11:44 You can't tell it to do something in the past. Wow - that would be powerful, wouldn't it? :-) 2023-01-16 14:12:10 To me past forms would be describing what had already happened. 2023-01-16 14:15:37 This is why I've had a hard time really getting my head around functional programming. I guess I think that's about describing relationships that are taken to be "timeless." I never really see how that lets me command things to happen. 2023-01-16 14:16:18 I.e., how do I get from describing a timeless world to "making changes happen" in the world? 2023-01-16 14:16:35 well the first principle of fp is that a function with the same arguments will always return the same value 2023-01-16 14:17:03 mainly, no state or side effects 2023-01-16 14:17:07 something about a monoid uh endofunctor uh 2023-01-16 14:17:10 Now, if my goal was to find the solution to a math problem or something, then functional makes a lot of sense - I'm specifying "constraints," and when I've specified enough then the values of interest become fully defined. 2023-01-16 14:17:27 Yeah, the lingo doesn't really help either. 2023-01-16 14:17:36 I run into the same thing trying to read some math papers. 2023-01-16 14:17:58 Most of these areas of math have fancy language that keep you from following the paper unless you are familiar with it. 2023-01-16 14:18:17 And often the CONCEPT represented by those terms is something perfectly clear to me - I just don't know it by that name. 2023-01-16 14:18:31 Like, why is "bijective" better than "one-to-one"? 2023-01-16 14:18:50 so normies won't understand 2023-01-16 14:18:50 One-to-one actually SAYS what's going on. Bijective seems like an unnecessary new label for the same idea to me. 2023-01-16 14:18:59 Well, right - I think that's it exactly. 2023-01-16 14:19:13 It wraps the priesthood in more robes. 2023-01-16 14:19:37 also people seem to like to use random names to feel more smart 2023-01-16 14:19:39 xD 2023-01-16 14:19:40 It's like they don't really WANT to make things clear to as many people as possible - they want a little club in which they're "special.' 2023-01-16 14:20:12 I'd guess it's a mix of exclusiveness and ego 2023-01-16 14:20:53 I felt that way about agile development too, as I got familiar with its details. My reaction was along the lines of "This is more or less how I've always done development - it just has a lot of new words attached and an increased level of religious fervor." 2023-01-16 14:21:00 like "hey look at the words I'm using, I'm smart" 2023-01-16 14:21:10 ^^ I do think that's part of it. 2023-01-16 14:21:36 KipIngram: well about agile, it turns that people wasn't working that way until recently 2023-01-16 14:21:48 for them is like they discovered something new 2023-01-16 14:21:53 To me, the core concept of agile - what it's really all about when you strip off all the wrapping - is "long term plans are fuzzy, near-term plans are sharper." 2023-01-16 14:22:01 And that just seems like the common sense way to do it to me. 2023-01-16 14:22:02 if you have a repl then agile means nothing 2023-01-16 14:22:45 Over the years I've seen guys present program plans with Gantt charts that show activities down to the level of 2-hour tasks six or eight months in the future. 2023-01-16 14:22:48 And that's just silly. 2023-01-16 14:27:15 well have in mind that development in the past was plan first, code later 2023-01-16 14:27:46 with the time they realized you can't plan the whole thing, and the structure gets defined in the process 2023-01-16 14:28:10 as then you realize some stuff that fucks the plan 2023-01-16 14:28:26 first one to mention agile goes over the waterfall in a barrel 2023-01-16 14:28:38 then they realized it's better to do a bit and see how it goes 2023-01-16 14:29:51 kind of similar to the bottom up/top down approach 2023-01-16 14:29:59 or at least it reminds me to that 2023-01-16 14:38:13 vms14: I don't wholly agree. I think you can't plan ALL THE DETAILS before starting, but you can certainly plan what I usually think of as "the architecture." It's very important to give enough up front thought to that aspect to be sure that you've got a solution that you can deploy without running into "gotchas." 2023-01-16 14:38:38 So I think you very much SHOULD have at least a sort of picture of the entire process in your head. 2023-01-16 14:38:53 Parts may be fuzzy, but you have to envision them at least well enough to believe that you can make them happen. 2023-01-16 14:39:31 engineering might be different from pure research 2023-01-16 14:40:09 I never worked in a team or enterprise, so I can't really talk 2023-01-16 14:40:34 still when I want to do something I think a bit of the steps I want to do 2023-01-16 14:40:59 like I'd start with X, then do Y, later ... but I don't put much effort into it 2023-01-16 14:50:36 Well, it depends on what the goals are - if you're planning to develop something that has new capabilitys and exploits newly available technology, it's probably good to give it a fair degree of thought. Sometimes a path that looks good at first turns out to have a "flaw" - a roadblock. If you can recognize that before you start, instead of when you actually run into it after weeks or months of effort, 2023-01-16 14:50:38 that's good. 2023-01-16 14:52:42 I've always liked the way Stephen Covey put it, in one of his time management books - he said "All things are created twice." There's the actual creation, but before that there's "creation in your mind's eye." 2023-01-16 14:53:43 then you learn about the folks who can't imagine things 2023-01-16 14:56:28 well most of the time I wait before coding and try to think about the problem away from a computer 2023-01-16 14:58:10 what I should do is to take a paper, and I never do it 2023-01-16 14:58:41 but for some reason a pen and a paper help a lot to think and represent the problem 2023-01-16 14:59:08 I mean, more than if you use paint or write a txt file xD 2023-01-16 15:36:39 I do both of those things (when the problem is deep enough to call for it). First I just thing. I've always found I can handle things up to some extent that way. Then, sometimes I'll get out paper and pencil - that's when the problem is complex enough that I can't juggle in my head well enough to feel confident I've got a good plan. 2023-01-16 15:37:09 This is exactly what I did on the processor work a couple of weeks ago. For a while it was just in my head, then I started sketching out rough circuits. 2023-01-16 15:37:18 Then finally started typing Verilog. 2023-01-16 15:37:40 But by then I had a clear picture of the circuit I wanted to implement. 2023-01-16 18:45:07 It seems that a common test for floating point precision is to start with 9, take sin(), then cos(), then tan(), and then atan(), acos(), and asin(). 2023-01-16 18:45:15 Of course, that should produce 9, ideally. 2023-01-16 18:45:29 So then subtract 9 from whatever you get from that, and see how small it is. 2023-01-16 18:45:39 WP34S gives about 2e-11. 2023-01-16 18:45:54 In double precision mode (128-bit floats), it gets 6e-29. 2023-01-16 18:49:41 asin(acos(atan(tan(cos(sin(9))))))? 2023-01-16 18:50:00 Yeah, that looks right. 2023-01-16 18:50:08 python yields something less than 1. 2023-01-16 18:50:35 sometimes you have to yell at a language to make it use doubles instead of floats 2023-01-16 18:50:56 Outch. 2023-01-16 18:50:59 Ouch. 2023-01-16 18:51:06 You dont get back 9? 2023-01-16 18:51:13 I'm trying that too, now. 2023-01-16 18:51:17 0.4247779607693797 2023-01-16 18:54:41 Oh, sorry - 9 degrees. 2023-01-16 18:54:52 You'll need to convert that to radians before pumping it through the functions. 2023-01-16 18:54:57 I got 9.000000000000012 2023-01-16 18:55:50 If I subtract 9 I then get 1.243e-14. 2023-01-16 18:56:03 So that beats the calculator in standard mode by a factor of a thousand or so. 2023-01-16 18:56:13 floats can run into catastrophic cancellation and various other fun things 2023-01-16 18:56:14 But doesn't even come close to the calculator in double mode. 2023-01-16 18:56:21 Yeah. 2023-01-16 19:03:41 Hmmm. Looks like there's a high precision math package in python called mpmath. 2023-01-16 19:03:59 Oh, it's arbitrary precision. 2023-01-16 19:04:01 Wow. 2023-01-16 19:04:11 https://mpmath.org/ 2023-01-16 19:05:31 That's fairly impressive. 2023-01-16 19:35:26 I assume this is just built on top of the stcok arbitrary precision support Python already has, out of the box, for integers. 2023-01-16 19:35:52 I bet they just built floats out of a python integer mantissa and a python integer exponent. 2023-01-16 20:18:29 it uses python under the hood rather than C? 2023-01-16 20:51:37 Well, I don't know - I was just speculating. It would be fairly easy to build an arbitrary floating point system if you already had arbitrary integers. 2023-01-16 21:02:41 ah - it looks like there are two ways it can work. 2023-01-16 21:02:52 One is, in fact, using Python integers. 2023-01-16 21:03:16 The other is using a package called gmpy. 2023-01-16 21:03:32 https://pypi.org/project/gmpy/ 2023-01-16 21:03:37 And that is C-coded. 2023-01-16 21:03:44 And is much faster, of course. 2023-01-16 21:03:49 https://pypi.org/project/gmpy/ 2023-01-16 21:31:42 neat 2023-01-16 22:08:25 Yeah, I'm pretty impressed that that's such a readily available capability. 2023-01-16 22:09:57 I'm almost tempted to write a calculator app for my computer, just to have a place to experiment with user interface ideas and while I'm at it set it up for arbitrary precision. 2023-01-16 22:11:28 Only problem with that is that I just have very little yen to wade into fancy Linux graphics. 2023-01-16 22:18:15 It's interesting to speculate on how this emulator was done. Looks to me like he has one image, that's basically the entire calculator, with nothing in its display. Then there's a whole slew of small images, each of which contains on litle "annunciator" that can be turned on in the display. 2023-01-16 22:18:50 That big background never changes - the rest of the work is just to slap the annuciators in place when they're needed and then background color them out when they're not. 2023-01-16 22:23:09 But I'd want to be able to change the writing on the keys, when I hit the shift buttons. 2023-01-16 22:24:04 There are three different key sizes on the WP34S emulator. 2023-01-16 22:24:39 The top two rows have six buttons. The remaining row has five buttons, except on the first five-button row the Enter key occupies the space of two keys. 2023-01-16 22:38:51 The docs for this mpmath package are worth perusing. 2023-01-16 22:41:55 Nice collection of important functions. 2023-01-16 22:52:35 This whole little trip we've taken into thinking about calculators has made me think my "general ideas" about what I've referred to as an "Octave like" application in Forth (someday) is on the right track. It seems right to me that your X register (and therefore all of your stack items) should be able to "contain" any type of numerical quantity. If you want to work with integers, it holds integers. And so 2023-01-16 22:52:37 on, for floating point, complex, vectors, matrices, etc. 2023-01-16 22:52:49 So basically that should just be a stack of pointers to data items.