HP Forums
DB48X: HP48-like RPL implementation for DM42 - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Not quite HP Calculators - but related (/forum-8.html)
+--- Thread: DB48X: HP48-like RPL implementation for DM42 (/thread-20157.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24


DB48X: HP48-like RPL implementation for DM42 - c3d - 07-08-2023 11:00 PM

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.


RE: DB48X: HP48-like RPL implementation for DM42 - grbrum - 07-09-2023 09:32 PM

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.



RE: DB48X: HP48-like RPL implementation for DM42 - xerxes - 07-09-2023 11:51 PM

(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.


RE: DB48X: HP48-like RPL implementation for DM42 - Helix - 07-10-2023 12:07 AM

(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.


RE: DB48X: HP48-like RPL implementation for DM42 - c3d - 07-10-2023 07:19 AM

(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).


RE: DB48X: HP48-like RPL implementation for DM42 - c3d - 07-10-2023 07:21 AM

Pre-release v0.2.3 is here: https://github.com/c3d/DB48X-on-DM42/releases/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)


RE: DB48X: HP48-like RPL implementation for DM42 - spiff72 - 07-10-2023 01:19 PM

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?


RE: DB48X: HP48-like RPL implementation for DM42 - nickapos - 07-10-2023 03:08 PM

(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.


RE: DB48X: HP48-like RPL implementation for DM42 - TomC - 07-10-2023 03:41 PM

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.



RE: DB48X: HP48-like RPL implementation for DM42 - Helix - 07-10-2023 09:46 PM

(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.


RE: DB48X: HP48-like RPL implementation for DM42 - c3d - 07-11-2023 10:16 AM

(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]


RE: DB48X: HP48-like RPL implementation for DM42 - c3d - 07-11-2023 10:17 AM

(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).


RE: DB48X: HP48-like RPL implementation for DM42 - spiff72 - 07-11-2023 11:59 AM

(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/reversepolishlisp/

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/blob/stable/Keyboard-Layout.png

There's also a smaller one here:
https://github.com/c3d/DB48X-on-DM42/blob/stable/sim/keyboard-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?


RE: DB48X: HP48-like RPL implementation for DM42 - c3d - 07-11-2023 04:48 PM

(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/reversepolishlisp/

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/blob/stable/Keyboard-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/blob/stable/sim/keyboard-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).


RE: DB48X: HP48-like RPL implementation for DM42 - spiff72 - 07-11-2023 05:41 PM

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...


RE: DB48X: HP48-like RPL implementation for DM42 - pascal_meheut - 07-12-2023 07:39 AM

(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).


RE: DB48X: HP48-like RPL implementation for DM42 - Claudio L. - 07-14-2023 02:54 AM

Very nice project!!
Thanks for doing this. The DM hardware platform finally has an RPL firmware.

Cheers!


RE: DB48X: HP48-like RPL implementation for DM42 - Gjermund Skailand - 07-14-2023 07:58 AM

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


RE: DB48X: HP48-like RPL implementation for DM42 - c3d - 07-16-2023 08:20 AM

(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).


RE: DB48X: HP48-like RPL implementation for DM42 - c3d - 07-16-2023 08:21 AM

(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.