DM 48 .... WHY NOT ?!!!

General discussion about calculators, SwissMicros or otherwise
JVDB
Posts: 8
Joined: Fri Jun 05, 2020 11:15 pm

Re: DM 48 .... WHY NOT ?!!!

Post by JVDB »

tbh... the 48G is also my goto one (over the prime). for sure when i need to calculate some eigenvalues and vectors. here's where I really like the rpn...
CalcFreak
Posts: 28
Joined: Tue Apr 24, 2018 8:42 am

Re: DM 48 .... WHY NOT ?!!!

Post by CalcFreak »

:mrgreen:
zx_spectrum
Posts: 13
Joined: Sun Mar 04, 2018 7:55 pm

Re: DM 48 .... WHY NOT ?!!!

Post by zx_spectrum »

grsbanks wrote:
Wed May 20, 2020 11:42 am
As has been said many times, HP have released the ROM of the 48G/GX for personal use, not commercial, which would mean that SwissMicros would have to release their hypothetical "DM48" without the ROM of the original calculator until HP decides to release the ROM for use other than personal.

I seriously doubt SwissMicros would agree to releasing a calculator without a ROM and telling users that they have to download it and install it themselves. That way lies far too much pain and trouble. It's just not going to happen IMO.
well SM can release DM48 with NewRPL firmware and 48G keyboard and then we will do the rest with 48G ROM.. not difficult
zx_spectrum
Posts: 13
Joined: Sun Mar 04, 2018 7:55 pm

Re: DM 48 .... WHY NOT ?!!!

Post by zx_spectrum »

48GX wrote:
Wed May 20, 2020 3:36 pm
jonmoore wrote:
Wed May 20, 2020 1:50 pm
But surely a far better route to RPL goodness, would be to utilise SM hardware to host NewRPL. That way you're getting 48/49/50 style user experience without any IP issues, and because it's coded in C, it's very fast.

NewRPL is close to being '50g' feature complete (minus the CAS), so that's a plus too.

On the negative side, all that power comes with a substantial increase in complexity compared to classic RPN calculators. It's not something that bothers me personally, but does that fit with the SM brand, which historically has centred on the direct simplicity of RPN.
Wow! This may be the bridge we need for a DM48. newRPL looks great. Am going to load it on a 50G and give it a whirl. Looks promising to me! Maybe DM48 could ship with newRPL but allow us users to load a 48G ROM. Would be a great compromise.
exactly..
tumble2k
Posts: 4
Joined: Thu Dec 22, 2022 8:17 pm

Re: DM 48 .... WHY NOT ?!!!

Post by tumble2k »

I'm new here. I don't own SM hardware, but I do have an HP32SII and an HP50g. I also owned an HP48SX and an HP100LX when they were in production.

I wanted to comment on RPL from the point of view of an embedded software engineer who works mainly in C++ but uses Python occasionally and has fun with various Lisps. I have seen some very positive and very negative comments on RPL, and thought maybe I could add some more confusion to the discussion.

The HP museum website has some good insights on why RPL was created. I look at it from this point of view: HP needed to create a CAS system. This requires a language that is good at parsing. For that you need unbounded stack, unbounded recursion, list processing, to name a few. HP created an interpreted language: RPL to solve this problem, which in my mind is just a cross between FORTH and Lisp. In fact, you can say that FORTH is just Lisp "inside out and backwards":

Code: Select all

2 3 + 4 *
in LisP is

Code: Select all

(* (+ 2 3) 4)
You could say RPN and FORTH lost all of the parentheses while Lisp got all of the parentheses.

RPL is truly a high level language compared to RPN. For example, it provides structured programming as in the factorial example below:

Code: Select all

<< -> n
  << IF 'n==0' THEN 1
    ELSE n 1 - fact n *
    END
  >>
>> 'fact' STO
The IF THEN ELSE END structure is simpler than the similar structure in RPN and allows the specification of a block of code without labels. You might be thinking that this is kind of a dumb example because nobody in their right mind would compute a factorial this way, but this is exactly the sort of code that is used for parsing through a complex equation.

RPL also has the list data type, so it's is truly a Lisp (hence its name). However, I think it has some limitations. If you look at the factorial code in Scheme you get:

Code: Select all

(define fact(n)
  (if (= n 0)
    1
    (* n (fact (- n 1)))
  )
)
With a combination of indentation and parentheses, you know exactly what each operator is operating on. In contrast, in the RPL code when you look at the ELSE clause you see:

Code: Select all

n 1 - fact n *
It takes a little brainpower to see that fact gobbles up n 1 - and * gobbles up the n. FORTH is even more obscure. In FORTH the factorial function looks like this:

Code: Select all

: fact
  DUP 0 = IF
    DROP 1
  ELSE
    DUP 1 - RECURSE *
  THEN
;
To analyze this you have simulate the stack operations in your head. Throw a few OVERs and SWAPs in there and you're completely lost. RPL's local assignment operator (similar to LET in Clojure) is a godsend for clear code. To make it even more clear you could use an expression

Code: Select all

<< -> n
  << IF 'n==0' THEN 1
    ELSE 'n*fact(n-1)' EVAL
    END
  >>
>> 'fact' STO
The use of an algebraic expression is not something allowed in Lisp dialects. RPL is definitely designed for scientific computations.

So RPL is kind of a high level evolution of RPN, and it has the oomph to power the CAS system. For the smallest computations it's a bit heavyweight, but for complex code I think it offers real advantages over RPN. The hp48/49/50 series has an operating system designed around this language. How great is that? Sign me up for a DM48!
BruceH
Posts: 82
Joined: Sat May 06, 2017 2:39 am

Re: DM 48 .... WHY NOT ?!!!

Post by BruceH »

tumble2k wrote:
Fri Dec 23, 2022 6:59 pm
I look at it from this point of view: HP needed [RPL] to create a CAS system.
Not really.

System RPL was first used on the HP-18C which never had a CAS, nor did any of its descendants. User RPL was used on several models (HP28C, HP28S, HP48S, HP48SX, HP48G, HP48GX, and HP 48G+) before a a CAS was first introduced.

Being able to enter and display algebraic expressions in RPL is certainly helpful when interfacing with a CAS but it's not the reason that RPL was created.
dlachieze
Posts: 613
Joined: Thu May 04, 2017 12:20 pm
Location: France

Re: DM 48 .... WHY NOT ?!!!

Post by dlachieze »

BruceH wrote:
Mon Dec 26, 2022 1:15 am
tumble2k wrote:
Fri Dec 23, 2022 6:59 pm
I look at it from this point of view: HP needed [RPL] to create a CAS system.
Not really.
RPL was created for Symbolic Math, as explained in this extract of "The HP-28C: AN INSIDER'S PERSPECTIVE - William C. Wickes, HP-28C Project Manager" , published in HPX Exchange V1N1 - January/February 1987:

"BEGINNINGS
The HP- 28C project had its origins about 2-1/2 years ago, as the HP-71 application ROM projects were winding down. At that time, the team that had produced the 71 Math and FORTH/Assembler ROMs turned their attention to designing a calculator operating system. We were convinced that the next generation of calculators should support symbolic mathematics-- the ability to use calculator operations on quantities represented by symbols that don’t first have to be converted to numbers.
After some study, it became clear that the HP 71 and the HP 41C operating systems and user languages are unsuited for this purpose, because of their lack of any method of applying functions to unevaluated expressions (programs). Likewise, PC-based systems and languages that support symbolic math are too profligate of ROM and RAM to be practical for a handheld.

In the end, we began developing a new operating system customized for our requirements. This development was completed about a year later, and we turned our attention to the implementation of a symbolic math calculator. Meanwhile, the HP-18C project had begun a parallel development, and became the first product based upon our new operating system. It uses the same internal language and execution logic as the HP-28C, even though its external user interface is quite different. Although the 18C does not provide any symbolic math capability directly to the user, the Solver does perform some rudimentary symbolic manipulations as part of its "direct" solve.

The new operating system and language is based upon a combination of FORTH and LISP and is known informally at HP as "RPL" (for Reverse-Polish LISP). Although FORTH’s rigid memory management and utter lack of user protection make it unsuitable as a calculator language, it happens that its threaded interpretation logic and unlimited data and return stacks are ideal for manipulation and evaluation of symbolic expressions. RPL execution is based on a generalization of the FORTH "inner loop." (in fact, the bit-bangers among you may be interested to know that the Saturn CPU in the new products has a new opcode. PC=(A), to optimize threaded execution)

LISP is the traditional language used for implementation of computer symbolic math. RPL borrow heavily from LISP, particularly in its implementation of list manipulations and lambda variables (local variables in the HP-28C terminology).

The basic user interface of the HP-28C was laid out in a 3-day team meeting that took place in January, 1985, as the operating system development was in its final stages. Formal work on the HP- 28C firmware was begun in May, and completed in June 1986. "
DM42: 00425 - DM41X: β00066 - WP43: 00042
tumble2k
Posts: 4
Joined: Thu Dec 22, 2022 8:17 pm

Re: DM 48 .... WHY NOT ?!!!

Post by tumble2k »

Well corrected. Thank you.

I continue to be amazed by the power of RPL. Here is a toy example of macros, a type of metaprogramming. It requires the development library (256 ATTACH) to run. It took a lot of effort to get around the syntax checking to enter in this code.

Code: Select all

<< -> l
  << << >> ->LST DUP TAIL
     SWAP HEAD 1 ->LIST
     l + SWAP + ->PRG
   >>
 >> 'LAMBDA' STO
 
 << S~N STO >> 'DEFN' STO
 
 << -> n
   << n 1 ->LIST { + } + LAMBDA
     "INC" n + DEFN
   >>
 >> 'MKINCn' STO
 

Code: Select all

14 MKINCn
9 INC14
gives

Code: Select all

23
There are probably better ways to implement this. I haven't even looked into sysRPL at all.
DavidM
Posts: 14
Joined: Mon Nov 13, 2017 8:31 pm

Re: DM 48 .... WHY NOT ?!!!

Post by DavidM »

That's a great example of an RPL program building another program and storing it for subsequent use.

RPL's "everything is an object" approach helps to facilitate that type activity, and you've put it to good use here.

As for code improvement, I don't think the "1 →LIST" steps are required (in either place), but it's possible that I've overlooked some scenario which forced you to include them. Generally speaking, + will append or prepend a single element to a list. Which side it is added to simply depends on the stack order. The single element doesn't have to be encapsulated in a list for that to work.

Thanks for posting!
whuyse
Posts: 198
Joined: Thu Dec 21, 2017 1:23 pm

Re: DM 48 .... WHY NOT ?!!!

Post by whuyse »

DavidM wrote:
Tue Dec 27, 2022 4:27 pm
The single element doesn't have to be encapsulated in a list for that to work.
Unless it is a list itself..
Cheers, Werner
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
Post Reply