I'm not sure how you draw the conclusion that there is no covered app store. Are you sure https://github.com/c3d/db48x/tree/dev/library is not covered, for example? More importantly, are you willing to indemnify me if some lawyer decides to argue that this projects falls under the law and that I should pay $7500 per child using it?
HN user
c3d
No, I am not ignoring the GPLv3. This is not a license, but a legal notice that residents of these states, by applying the GPL and freely running software that may violate local laws, are the ones that may have to deal with the consequences.
I clarified in a recently updated version of the text, and I refer the readers to this discussion. https://github.com/c3d/db48x/blob/dev/LEGAL-NOTICE.md
This is a valid point, and I was aware of it, though the wording was not clear enough. So I clarified in a recent commit. I also added Brazil and New.
Exactly
DB48x certainly has a GitHub site with freely downloadable pieces of software that can run on the calculator. For instance here: https://github.com/c3d/db48x/tree/stable/library
Some of these include contributions from third parties.
The problem is that the law is written without a precise enough wording that would ensure that there is no risk whatsoever for me. And the penalty is stiff, something like $7500 per child using the software.
As for mandating age verification, it's unclear to me how you think that it's possible to deliver an API giving age bracket info (in the case of DB48x, the idiomatic way would be an RPL command that returns that info) without having a facility to enter age or date of birth or something like that. So yes, everyone who reads the text interprets it as mandating age verification.
DB48x author here. To be fair, the definitions of "operating system", "application" or "user" are so vague that I decided to
1. Not take any risk 2. Take a stand
The point is more to draw attention
A video explaining the philosophy and technology behind the project. https://www.youtube.com/watch?v=jNOA39HnkcM
Sorry about that ;-)
It's a tribute to Hewlett and Packard, but taking the first names, and with the individuals reversed for balance.
I do not believe there is any possible infringement on a clearly new design, even if that design is intentionally reminiscent of the HP logo.
In theory yes. In practice, the TI 83/84 are probably not beefy enough, and the NumWorks has a keyboard that makes the endeavour really complicated.
There are three floating-point representations:
- A variable-precision decimal floating point that uses base-1000 internally with 10 bits for 1000 values instead of 1024, so reduced memory waste, and LEB128 for size and exponent encoding. So 1.23 is 5 bytes, and each decimal value has its own precision. The precision only affects computations, not stored objects, so you can adjust the precision for each step of a computation.
- IEEE754 hardware accelerated 32-bit and 64-bit binary floating point.
In line with RPL, there are many other object types, including arbitrary-precision integers (123 is 2 bytes, 100! is 68 bytes), symbolic expressions, programs, lists, and so on.
This works with Firefox 132.0, tested on Fedora 41 right now.
This is done on that page, though on some browsers it requires an explicit page reload. This works with Mozilla 132.0, just tested on Fedora 41.
SharedArrayBuffer is necessary to run multiple threads with EmScripten.
Could you open an issue on the project's web site about the trouble you had installing? (http://github.com/c3d/db48x). Thanks!
Also, were you aware of this tutorial: https://www.youtube.com/watch?v=rVWy4N0lBOI&list=PLz1qkflzAB...
There is a free iPhone version as well (called DB40X). Maybe some day give it a try?
A physicist working on the project used this to compute the space contraction for the https://en.wikipedia.org/wiki/Oh-My-God_particle, which presumably traveled at 0.9999999999999999999999951 time the speed of light. You cannot do that with your HP48GX directly using standard formulas, because it only has 12 digits of precision.
Let's see your Python answers to the following examples:
1. What happens if I rotate binary pattern 1001 right by 3 positions on a 18-bit PDP-9?
RPL code: 18 STWS 2#1001 3 RRC
Result: #8001 in base 16, #1000 0000 0000 0001 in base 2.
What about if I do this on 6 36-bit words? RPL code: 6 36 * STWS 2#1001 3 RRC
Result: #20 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001
2. What is the symbolic expression of the determinant of some 2x2 matrix? Program: [[1 y]['2+x' b]] DET
Answer: 'b-(x+2)·y' (shows graphically on calculator screen)
3. What is the output voltage of a voltage divider with input voltage 100V, R1=4kΩ, R2=10Ω Program: R1=4_kΩ R2=10_Ω V=100_V 'ROOT(ⒺVolt Divider;[V1];[1_V])' EVAL
Result: [ V1=99.75 V ]
Note that ⒺVolt Divider is a built-in equation, but you can of course put your own.
4. Verify if Ramanujan constant exp(sqrt(163)*pi) is an integer. Program: « 'exp(√ 163·Ⓒπ)'60 PRECISION →Num FractionalPart »
Result: -7.50E⁻¹³, so no, not an integer, but really close
5. Verify Maxwell's value for the speed of light, epsilon0 * mu0 * c^2 = 1. Program: '(√(Ⓒε0·Ⓒμ0))⁻¹' →Num
Result: 299 792 458.00 m/(F↑(¹/₂)·H↑(¹/₂))
Convert to SI units: UBASE
Result: 299 792 458. m/s
Convert to feet per second: ³⁷⁴ ⁷⁴⁰ ⁵⁷² ⁵⁰⁰/₃₈₁ ft/s or 983 571 056.43 ft/s.
(if you subtract the Ⓒc constant, you get -0.00031 11057 21 m/s)
6. Check the Collatz conjecture on 989345275647 Program: « if dup 1 ≠ then if dup 2 mod then 3 × 1 + else 2 ÷ end Collatz end » 'Collatz' STO 989345275647 Collatz
Result: 1 (conjecture is verified)
7. Given that it's now Nov 7, 00:07:51 and that a program I started on Nov 1st at 23:15:27 just finished, how long did it run? Program: 20241107.000751_date 20241101.231527_date - 1_h convert UVAL →HMS
Result: 120:52:24
(the "1_h convert UVAL →HMS" should really just be →HMS, but at the moment, →HMS is not smart enough to convert from days)Why not?
Keystroke count and progressive computations.
Let me illustrate using an example from a YouTube video called "The hardest Exam Question : Only 6% of students solved it correctly" (https://www.youtube.com/watch?v=NfgEPsm9Jzw), which is about a simplified formulation for (sqrt(2)-1)^10.
The first remark is that a CAS-capable calculator like DB48x can help with the symbolic part of the computation shown in the video. However, to be fair, DB48x still lacks some of the relevant HP48 interactive equation manipulation features to be able to demonstrate that. So let's focus for now on the numerical part.
The author shows that (sqrt(2)-1)^10 is the same as 3363-2378*sqrt(2). Let's evaluate that using bc.
Attempt 1: bc, then (sqrt(2)-1)^10-(3363-2378*sqrt(2))
Result: -985. Er... What?
OK. What is the option for precision again? man bc. Search for precision. Mentions the @ operator. Does not seem to do it. 5 minutes of search later, find that precision is called scale, that I need the -S option. I could also presumably use the -l option, which experimentally seems to set the scale to 20. Starting to remember why I am not a big fan of bc ;-)
Trying again. bc -l
(sqrt(2)-1)^10-(3363-2378*sqrt(2)) now gives me:
-.00000000000000000402.
Counting "bc -l" and ENTER keys, that's I believe 42 keystrokes.
Trying again with db48x: I need 23 keys using the most naive RPN data entry. The result is -1.57861 99E⁻²⁰ with the default 24-digit precision.
I can also enter the same algebraic expression as in bc directly in the simulator using copy-paste. I get a nice graphical rendering of the expression, which I can check, and then just one key (EVAL/=) to get the numerical value.
As another example, let's try to check if the Ramanujan constant in an integer:
bc -l
e(sqrt(163)*pi(20))
262537412640768743.98947654935272888605
That does not look like an integer to me. And it's way more than the 20 digits I would expect from scale. What is weird is that it gives me a false sense of accuracy, all the digits after "43.9" are bogus, as shown by switching the scaling to 100:
bc -l -S100
e(sqrt(163)*pi(100))
262537412640768743.9999999999992500725971981856888793538563373369908\ 627075374103782106479101186073126534265238592035363
21 keystrokes, and a result that is a bit hard to interpret with the default precision (scaling). In other words, it's pretty easy to get bogus numerical results and not know it.
With DB48x, after selecting a precision of 100, 11 keystrokes including menu selection to get the pi constant, and I get: 262 537 412 640 768 743.99999 99999 99250 07259 71981 85688 87935 38563 37336 99086 27075 37410 37821 06479 10118 60730 76
At least I can easily copy the results and the code to a document which avoids transcription errors.
This is also true with the DB48x simulator, which supports copy and paste both ways. This is how I copied the values above, or entered the exact same algebraic expression as in bc into the simulator.
I admire the project, although I would probably have taken a different path (emulation) to get the biggest effect with the smallest possible effort :-)
Emulators are stuck in the past, since they need to rely on the HP ROMs. So all the nice new features in DB48x, like variable-precision decimal arithmetic, support for higher-resolution graphics and colour, tail-recursion optimization, object size optimizations, polar and rectangular complex numbers or vectors, or the extensive Markdown-based builtin help would all be impossible to implement.
I wish there was a good HP50G emulator for iOS — there used to be one, but it was abandoned (contact me if you want to develop it and would like to get the source code, it was under the GPL and I got it from the author).
I have two pretty good emulators on my iPhone, one is iHP48, the other is i48. Both can emulate the HP50G if you load the correct ROM, IIRC.
That being said, I second the idea that if you got the source in GPL form, you should publish them on GitHub. Or share with me and I will do it, possibly restore it (I have vague plans to restore Emu71 as well, when I'm done with DB48x).
Where's the apostrophe (equiv. to quote in lisp)? That should be an easily accessible key not buried in a menu.
The apostrophe is on the XEQ key of the DM42, or "F". But in RPL, it is not to quote like in Lisp, but to introduce algebraic expressions (although it does quote names as a side effect).
On the simulator / web site, the symbol on the key looks like this: [' ()], it is on the second row on the rightmost column, see https://github.com/c3d/db48x/blob/stable/DB48X-Keys/DB48X-Ke....
The key is labeled like this because it serves a dual purpose to accommodate the smaller number of keys on the DM42 relative to the HP48. It adds a tick when not inside an expression, which in RPL begins an algebraic expression. When you are inside an algebraic expression, then you don't need tick anymore, so the key inserts parentheses inside.
- Why did he swap the log keys?
Because I personally prefer to have exp and ln rather than ln and log. I also would prefer to have y^x as a primary, unshifted key, and this change is coming soon.
But I recognize that keyboard layout is a personal preference, so I'm currently working on making this customizable. Recently, "User mode" has been introduced, which lets you reconfigure the keyboard the way you want. So if you want to restore decimal LOG as the primary key instead of EXP, then do this: 'LOG10' 24.1 ASN. You should be able to restore EXP to the original position with 'EXP' 25.2 ASN, but there is bug with shifted user keys that I need to fix. This should be fixed in the next release.
In addition, the very next release should offer three layouts:
1) One that is maximally compatible with DM42 / HP42, which I assume is what you want.
2) One that corresponds to the current layout, so that people with existing overlays can keep them.
3) One that corresponds to a new iteration of the key layout that is better suited for DB48x, which is currently being discussed on the HP Museum forum.
The current state is "on backburner by lack of time". Projects like https://grenouillebouillie.wordpress.com/2022/03/07/a-theory... and https://github.com/c3d/DB48X-on-DM42/tree/stable have been consuming most of my spare time cycles.
Here are factors playing a role in my current thinking:
1/ the LLVM debacle. I just can't follow them changing the APIs all the time. I gave up on LLVM for now.
2/ Rust being the first language introducing a concept that was not trivial to introduce via an XL library, lifetimes. I think that I nailed a design now, but it annoyed me for a while, and the design is not implemented.
3/ I spent some time documenting where I wanted to go, notably the type system. As a result, I found that the language was becoming complicated, which annoys me. I'm trying to get back to super-simple roots, but I have no clear path towards this goal yet.
4/ I want to to unify the self-compiling compiler and the dynamic one. The self-compiler only compiles an older dialect of the language.
The really ugly stuff is here: https://github.com/c3d/xl/blob/master/src/llvm-crap.cpp
I realized I forgot to share my most memorable piece of code ever: llvm-crap (Compatibility Restoration Adaptive Protocol)
Check out Pure. https://agraef.github.io/pure-lang/
This was what convinced me to switch to LLVM. I now regret that decision, but at the time, it sounded like a lot of fun.
There is no backtracking, but being able to implement Prolog on an XL basis was an important part of the original design of the "runtime" version of XL.
Let's ask the interpreter / compiler:
./xl -nobuiltins -parse /tmp/glop.xl -style debug -show
(infix is
is
is
)
So what it sees is a definition of a name 'is' as itself.Now, that name is very unlikely to be usable because `is` as an infix is so central to everything. As a matter of fact, it looks like even "is is 2" actually crashes the current implementation.
Oh well. I wonder what a sensible error message on this would be. Probably: "Bill Clinton denied to comment on the meaning of that statement".
You can do exactly that, and this is how this is defined in the built-in library
https://github.com/c3d/xl/blob/fast/src/builtins.xl#L222
How it works is what I tried to document in the document above. The trick is to have some fixed semantics on how rewrites are done, but a lot of freedom in how this is implemented. And this is far from perfect ATM.
For example, if you write "X is 2", this can be implemented as a constant, as a function returning a constant, or as a macro. However, if you write "X is seconds" in Tao3D, where "seconds" returns the current number of seconds in the clock, then it can no longer be a constant value. You still can use macro replacement (or inlining) or turn it into a function.
More details here: https://xlr.sourceforge.io/#compiling-xl
See the code around here to answer that question:
Definition of 'if' statement: https://github.com/c3d/xl/blob/fast/src/builtins.xl#L155
// If-then-else statement
if [[true]] then True else False is True
if [[false]] then True else False is False
if [[true]] then True is True
if [[false]] then True is false
Definition of loops (https://github.com/c3d/xl/blob/fast/src/builtins.xl#L222) // Loops
while Condition loop Body is
if Condition then
Body
while Condition loop Body
until Condition loop Body is { while not Condition loop Body }
loop Body is { Body; loop Body }
for Var in Low..High loop Body is
Var := Low
while Var < High loop
Body
Var := Var + 1Why do you think it's older? XL started as LX around 1993, and IIRC self-compiled in 2004 or so.