Post Reply 
DB48X: HP48-like RPL implementation for DM42
07-08-2023, 11:00 PM
Post: #1
DB48X: HP48-like RPL implementation for DM42
I am happy to announce a new implementation of RPL for the DM42, called DB48X. The current pre-release is 0.2.2, but this is changing fast.

This also means that there is a new entrant for the N-queens benchmark. DB48X currently runs at 528ms while on USB power, 2133ms while on battery.

I gave a talk about this project at FOSDEM this year. You can see what it looks like in that video, as well as the design philosophy behind it.
Find all posts by this user
Quote this message in a reply
07-09-2023, 09:32 PM
Post: #2
RE: DB48X: HP48-like RPL implementation for DM42
This is very cool.
(07-08-2023 11:00 PM)c3d Wrote:  I am happy to announce a new implementation of RPL for the DM42, called DB48X. The current pre-release is 0.2.2, but this is changing fast.

This also means that there is a new entrant for the N-queens benchmark. DB48X currently runs at 528ms while on USB power, 2133ms while on battery.

I gave a talk about this project at FOSDEM this year. You can see what it looks like in that video, as well as the design philosophy behind it.
Find all posts by this user
Quote this message in a reply
07-09-2023, 11:51 PM
Post: #3
RE: DB48X: HP48-like RPL implementation for DM42
(07-08-2023 11:00 PM)c3d Wrote:  This also means that there is a new entrant for the N-queens benchmark. DB48X currently runs at 528ms while on USB power, 2133ms while on battery.

Very nice project. Thank you for the test results.

Calculator Benchmark
Find all posts by this user
Quote this message in a reply
07-10-2023, 12:07 AM
Post: #4
RE: DB48X: HP48-like RPL implementation for DM42
(07-08-2023 11:00 PM)c3d Wrote:  I gave a talk about this project at FOSDEM this year. You can see what it looks like in that video, as well as the design philosophy behind it.

As I find RPL superior to RPN, this project could justify the purchase of a DM42. Smile
And I like very much the interface!

I have some basic questions:
- how to quickly access the variables menu? I don’t remember seeing it in the video.
- will comments be possible inside programs, apart from the inelegant "text" DROP ?
- will list processing be available, like in the HP48 G/GX or the HP50G?
- I know it’s very premature, but if variable floating-point precision is implemented some day, will it replace the fixed floating-point precision library? I don’t like the idea of scarifying speed to gain useless precision.

Jean-Charles
Find all posts by this user
Quote this message in a reply
07-10-2023, 07:19 AM
Post: #5
RE: DB48X: HP48-like RPL implementation for DM42
(07-10-2023 12:07 AM)Helix Wrote:  
(07-08-2023 11:00 PM)c3d Wrote:  I gave a talk about this project at FOSDEM this year. You can see what it looks like in that video, as well as the design philosophy behind it.

As I find RPL superior to RPN, this project could justify the purchase of a DM42. Smile
And I like very much the interface!

I have some basic questions:
- how to quickly access the variables menu? I don’t remember seeing it in the video.
- will comments be possible inside programs, apart from the inelegant "text" DROP ?
- will list processing be available, like in the HP48 G/GX or the HP50G?
- I know it’s very premature, but if variable floating-point precision is implemented some day, will it replace the fixed floating-point precision library? I don’t like the idea of scarifying speed to gain useless precision.

- You access the variables menu with the RCL key. Good point that I need to highlight that in my next video.
- Traditionally, comments in RPL begin with @ I believe, but this is only when importing files. Comments are historically dropped by the parser, never to be seen again. This behavior does not suit me, and the @ separator is a bit ugly too. So I'm likely to think of something else. I filed an issue, feel free to comment there.
- Yes, list processing is planned
- At the moment, variable precision is half-implemented. The `Precision` and `SetPrecision` setting currently selects between 32-bit, 64-bit and 128-bit BID representation. I plan to implement variable precision if that fits in the limited ROM space. Otherwise, will be reserved for the next-generation calculator (i.e. the DM32 platform).
Find all posts by this user
Quote this message in a reply
07-10-2023, 07:21 AM
Post: #6
RE: DB48X: HP48-like RPL implementation for DM42
Pre-release v0.2.3 is here: https://github.com/c3d/DB48X-on-DM42/rel...tag/v0.2.3.

Bug fixes:

- Memory corruption in division of large numbers (#70)
- Parsing 'X⁻¹+(Y²+Z³)' resulting in syntax error (#76)
- Parsing -80/60 resulting in 4/3 (sign lost) (#78)
- Large numbers written to state file had separators (#83)
- Render names on stack as 'ABC' instead of 'ABC' (#84)
- Evaluate names as 'ABC' and not ABC (#86)
- Directory corruption following purge (#87)
- Local blocks now always execute (#90)
- Correct spacing of control structures on stack

Features:

- Keyboard binding to create lists (#89)
- Implementation of for loops (#92)
Find all posts by this user
Quote this message in a reply
07-10-2023, 01:19 PM
Post: #7
RE: DB48X: HP48-like RPL implementation for DM42
This looks really interesting!

I actually just ordered a DM42 over the weekend here, but it won't arrive for 3-4 weeks.

I was planning to run C47 on it (with an overlay for the keyboard), but this one looks very promising to me...

Can you answer a basic question about how the DM42 runs these alternate calculators?

Does DB48X run alongside the existing DM42 calc firmware? (Is it just a program that you can exit from and go back to the DM42 calculator?) Could you have DB48X and C47 BOTH available and switch between them?
Find all posts by this user
Quote this message in a reply
07-10-2023, 03:08 PM
Post: #8
RE: DB48X: HP48-like RPL implementation for DM42
(07-08-2023 11:00 PM)c3d Wrote:  I am happy to announce a new implementation of RPL for the DM42, called DB48X. The current pre-release is 0.2.2, but this is changing fast.

This also means that there is a new entrant for the N-queens benchmark. DB48X currently runs at 528ms while on USB power, 2133ms while on battery.

I gave a talk about this project at FOSDEM this year. You can see what it looks like in that video, as well as the design philosophy behind it.

Very nice presentation, even though I am not a DM42 owner I still enjoyed it. DB48X might be the reason I get one, one day.
Find all posts by this user
Quote this message in a reply
07-10-2023, 03:41 PM
Post: #9
RE: DB48X: HP48-like RPL implementation for DM42
OH my!! This sounds great - I will try it out shortly on the DM42.

In particular, I require complex number handling - so I look forward to that 'update'.

Cheers,
TomC

(07-08-2023 11:00 PM)c3d Wrote:  I am happy to announce a new implementation of RPL for the DM42, called DB48X. The current pre-release is 0.2.2, but this is changing fast.

This also means that there is a new entrant for the N-queens benchmark. DB48X currently runs at 528ms while on USB power, 2133ms while on battery.

I gave a talk about this project at FOSDEM this year. You can see what it looks like in that video, as well as the design philosophy behind it.
Find all posts by this user
Quote this message in a reply
07-10-2023, 09:46 PM
Post: #10
RE: DB48X: HP48-like RPL implementation for DM42
(07-08-2023 11:00 PM)c3d Wrote:  This also means that there is a new entrant for the N-queens benchmark. DB48X currently runs at 528ms while on USB power, 2133ms while on battery.

I would be curious to know the result for this benchmark too.

Jean-Charles
Find all posts by this user
Quote this message in a reply
07-11-2023, 10:16 AM
Post: #11
RE: DB48X: HP48-like RPL implementation for DM42
(07-10-2023 09:46 PM)Helix Wrote:  I would be curious to know the result for this benchmark too.

I used the following program:

Code:

« Ticks 0 1 10000
for i
    i atan sin exp cbrt +
next Ticks Rot - »

The result for 10'000 loops is
- USB: 12.5s (stock DM42 is 26s)
- Battery: 36.4s (stock DM42 is 65.73s)
[/code]
Find all posts by this user
Quote this message in a reply
07-11-2023, 10:17 AM
Post: #12
RE: DB48X: HP48-like RPL implementation for DM42
(07-10-2023 01:19 PM)spiff72 Wrote:  an you answer a basic question about how the DM42 runs these alternate calculators?

Does DB48X run alongside the existing DM42 calc firmware? (Is it just a program that you can exit from and go back to the DM42 calculator?) Could you have DB48X and C47 BOTH available and switch between them?

You can have them both on the FAT partition and load them alternatively. This involves a reflashing, but it takes about 30 seconds. I plan to do a video update on YouTube showing this process.

Both the DM42 and DB48X programs can save state to disk and reload some saved state automatically on program restart. You can have as many such state files as you want, but the name of the last state file you used intentionally persists across resets. However, since DM42 and DB48X can't use each other's files, when you switch, you start with a "Memory Clear" and need to explicitly load a state file of the correct kind. So the switch with state takes 10-20 seconds more to go through the menus and select the state file. All in all, it takes less than a minute to switch to another "mode" (but it's not instantaneous).
Find all posts by this user
Quote this message in a reply
07-11-2023, 11:59 AM
Post: #13
RE: DB48X: HP48-like RPL implementation for DM42
(07-11-2023 10:17 AM)c3d Wrote:  
(07-10-2023 01:19 PM)spiff72 Wrote:  an you answer a basic question about how the DM42 runs these alternate calculators?

Does DB48X run alongside the existing DM42 calc firmware? (Is it just a program that you can exit from and go back to the DM42 calculator?) Could you have DB48X and C47 BOTH available and switch between them?

You can have them both on the FAT partition and load them alternatively. This involves a reflashing, but it takes about 30 seconds. I plan to do a video update on YouTube showing this process.

Both the DM42 and DB48X programs can save state to disk and reload some saved state automatically on program restart. You can have as many such state files as you want, but the name of the last state file you used intentionally persists across resets. However, since DM42 and DB48X can't use each other's files, when you switch, you start with a "Memory Clear" and need to explicitly load a state file of the correct kind. So the switch with state takes 10-20 seconds more to go through the menus and select the state file. All in all, it takes less than a minute to switch to another "mode" (but it's not instantaneous).

Thanks for that info!

I noticed the link to your github is broken on this site:
https://fosdem.org/2023/schedule/event/r...olishlisp/

The link directs to:
https://github.com/c3d/db48x-on-dm42/tree/sim

But /tree/sim doesn't seem to exist. Wiping out the '/tree/sim' works though.

I also saw that you had a PNG file representing an overlay design for the KB in the github repo. Is this "official", or do you see it changing?
https://github.com/c3d/DB48X-on-DM42/blo...Layout.png

There's also a smaller one here:
https://github.com/c3d/DB48X-on-DM42/blo...-db48x.png

I would probably make my own overlay for this once I have my DM42 in hand, but it would be great if you had a version that had "blanks" for the keys so my cutter software could cut the openings.

On that overlay image linked above, why is there an orange and blue bar under the COS and TAN keys?
Find all posts by this user
Quote this message in a reply
07-11-2023, 04:48 PM
Post: #14
RE: DB48X: HP48-like RPL implementation for DM42
(07-11-2023 11:59 AM)spiff72 Wrote:  Thanks for that info!

I noticed the link to your github is broken on this site:
https://fosdem.org/2023/schedule/event/r...olishlisp/

The link directs to:
https://github.com/c3d/db48x-on-dm42/tree/sim

But /tree/sim doesn't seem to exist. Wiping out the '/tree/sim' works though.

Yes. The link should have been to the top-level repository. Can't edit it now, unfortunately.

Quote:I also saw that you had a PNG file representing an overlay design for the KB in the github repo. Is this "official", or do you see it changing?
https://github.com/c3d/DB48X-on-DM42/blo...Layout.png

Define "official" :-)

This is mostly a reminder of where I see things fitting currently. There is a cutout version of it too, though I don't believe I published it. I will add it to the repository later today.

Quote:There's also a smaller one here:
https://github.com/c3d/DB48X-on-DM42/blo...-db48x.png

I would probably make my own overlay for this once I have my DM42 in hand, but it would be great if you had a version that had "blanks" for the keys so my cutter software could cut the openings.

On that overlay image linked above, why is there an orange and blue bar under the COS and TAN keys?

Bad editing from the source image (which I think I lifted from the C43 or C47 web site).
Find all posts by this user
Quote this message in a reply
07-11-2023, 05:41 PM
Post: #15
RE: DB48X: HP48-like RPL implementation for DM42
Thanks!

I was just looking at the C47 overlay graphic that they provide (PDF format "card"). I'm working on how to manipulate that file to generate a "cuttable" image on my Cricut. I think I just got it sorted a bit ago, but I can't do a test fit until I have my DM42. Their template card is confusing because they provide some green "targets" that are supposed to be spaced a specific distance apart, but they also reference the dims of the background of the actual graphic. If I scale them in software to match the green targets, the background is slightly off, and obviously scaling the background image to match causes the green target spacing to be off. So I have two graphics - each scaled per their dims to try out :-)

When the time comes, I can probably use the image you already have out there, now that I know how to "clip" out the key cutouts from working on the C47 overlay. I should be able to just copy the cutouts from C47 file to this one in Inkscape.

I also noticed those orange and blue bars are present on the C47 graphic (after I asked about this on yours). That seems to correspond to the WP43 layout for the shift keys - so maybe the C47 team didn't clean that up either! On the other hand, I don't see those bars on the WP43 reference image I have...
Find all posts by this user
Quote this message in a reply
07-12-2023, 07:39 AM
Post: #16
RE: DB48X: HP48-like RPL implementation for DM42
(07-11-2023 05:41 PM)spiff72 Wrote:  That seems to correspond to the WP43 layout for the shift keys - so maybe the C47 team didn't clean that up either!
I would say this is because the C47 can be configured with several keyboards layouts using the KEYS menu (shift-shift-1).
Find all posts by this user
Quote this message in a reply
07-14-2023, 02:54 AM
Post: #17
RE: DB48X: HP48-like RPL implementation for DM42
Very nice project!!
Thanks for doing this. The DM hardware platform finally has an RPL firmware.

Cheers!
Find all posts by this user
Quote this message in a reply
07-14-2023, 07:58 AM
Post: #18
RE: DB48X: HP48-like RPL implementation for DM42
Indeed, looks like I need to get to a second DM42.
Do you have 20-30KB free flash for e.g matrix operations ?
br Gjermund
Find all posts by this user
Quote this message in a reply
07-16-2023, 08:20 AM
Post: #19
RE: DB48X: HP48-like RPL implementation for DM42
(07-14-2023 02:54 AM)Claudio L. Wrote:  Very nice project!!
Thanks for doing this. The DM hardware platform finally has an RPL firmware.

Cheers!

For many aspects, I've been inspired by your newRPL. I still have to implement an equivalent of your large real numbers. I'll do that last, if the rest fits (the DM42 has less available memory than the HP50G).
Find all posts by this user
Quote this message in a reply
07-16-2023, 08:21 AM
Post: #20
RE: DB48X: HP48-like RPL implementation for DM42
(07-14-2023 07:58 AM)Gjermund Skailand Wrote:  Indeed, looks like I need to get to a second DM42.
Do you have 20-30KB free flash for e.g matrix operations ?
br Gjermund

I am in the process of finishing complex operations. Matrix and vector come next. I hope that I will have enough space, but there are good chances: I'm currently compiling at O2, so I could compile with -Oz if I really need to save space.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 10 Guest(s)