News for hackers. Stuff that matters.
Re:The early history of HP calculators by userbinator on Sunday September 10, 2017 @06:24AM (#15211595)
Notice the distinct lack of an '=' button --- HP's calculators have been almost exclusively RPN-based.

It's funny to watch other (newer) developers reactions when they ask to borrow the calculator that's usually on my desk (a 42S) and then give it back several minutes later, with a puzzled look on their faces.

Re:The early history of HP calculators by agumonkey on Sunday September 10, 2017 @07:09AM (#15211704)
"you've been stacked"

-- HP calc owner

Last year I finally read the whole manual (as a teen I only used the symbolic differentiator, most useful and magical to my brain at the time). Since I learned about Lisp, so RPN programming features appealed to me. I realized that:

1) RPN has lambda << 2 + >> means (lambda (...) (+ 2 ...))

2) RPN has a short syntax for them << a -> a 2 + >>

Yes, 1990 HP RPN had arrow notation out of the box. Take that ES6 !

Re:The early history of HP calculators by mschaef on Sunday September 10, 2017 @02:30PM (#15213515)
> 2) RPN has a short syntax for them << a -> a 2 + >>

The syntax is slightly different. What it should be is this

<< -> a << a 2 + >> >>

The arrow introduces a binding form that captures the top n levels of the stack into n named local variables. (There's also a lower level implementation that forgoes the names in favor of a lookup-by-ordinal scheme that's a lot faster.)

The other notable difference from what you might expect is that the lexical environment is not captured:

Consider this function:

<< -> a << << a 2 + >> >> >>

What it returns is a function object that looks like this, except that 'a' is a local variable reference rather than the global variable reference it looks like:

<< a 2 + >>

Evaluating this results in an error, because while 'a' is represented as a local variable reference, the environment containing the local binding for 'a' is no longer available.

Re:The early history of HP calculators by agumonkey on Sunday September 10, 2017 @02:49PM (#15213630)
You're totally right. I already forgot the deails.

I just put out my hp49.. god how I love these things.

ps: I just found out the latest attempt I did last years was a var called REC = << -> U << U U EVAL >> >> .. pretty sure I was trying a fixpoint CPS factorial in RPN

Re:The early history of HP calculators by mvaliente2001 on Sunday September 10, 2017 @09:28AM (#15212133)
HP48(S(X)) also came with two excellent manuals with hundreds of pages of documentation. My only regret is that when I was in college, I could have written better programs. I tended to write huge functions with a deep stack, hard to understand, debug and modify. Had I know what I know now, I would have written dozen of small function and relying more in lambdas... And I didn't know I can use named arguments.
Re:The early history of HP calculators by agumonkey on Sunday September 10, 2017 @09:45AM (#15212187)
at least you did write them, I have respect for people suffering complexity when they don't know better
Re:The early history of HP calculators by nemoniac on Sunday September 10, 2017 @08:07AM (#15211860)
If you're enjoying that, you'll find even more connections with Forth, also a very cool programming language.

https://en.wikipedia.org/wiki/Forth_(programming_language)

Re:The early history of HP calculators by agumonkey on Sunday September 10, 2017 @08:29AM (#15211943)
I love stack languages. Forth, Factor, Joy, Cat .. (all the concatenative crew).

ps: there are some Chuck Moore talks on youtube that are worth gold. His CPUs are heaven

Re:The early history of HP calculators by vram22 on Sunday September 10, 2017 @11:25AM (#15212585)
Can you please give links for those of his videos that you liked?
Re:The early history of HP calculators by agumonkey on Sunday September 10, 2017 @11:34AM (#15212634)
Re:The early history of HP calculators by vram22 on Sunday September 10, 2017 @11:37AM (#15212650)
Saw the links you posted, thank you.
Re:The early history of HP calculators by agumonkey on Sunday September 10, 2017 @12:00PM (#15212754)
You're welcome. Enjoy.
Re:The early history of HP calculators by throwaway7645 on Sunday September 10, 2017 @12:54PM (#15213036)
Have you used his greenarrays chips? If so I'd love to hear anything you have to say on them and your Forth experience in general.
Re:The early history of HP calculators by agumonkey on Sunday September 10, 2017 @03:01PM (#15213713)
oh no, I was far removed from this kind of things, I'm a java/python coder let's say. But I recently dug into low level electronics so I hope I can put my hands on one.
Re:The early history of HP calculators by throwaway7645 on Sunday September 10, 2017 @11:27PM (#15215687)
Same. I've only done microcontrollers/asm in college.
Re:The early history of HP calculators by b5 on Sunday September 10, 2017 @06:30AM (#15211607)
At my last job, which involved a lot of number work, my boss would often pick up my HP-12C to quickly calculate something we were talking about. Every single time, he'd say, "Your calculator is broken," then put it back on my desk. It became a running joke of ours.
Re:The early history of HP calculators by ece on Sunday September 10, 2017 @06:58AM (#15211676)
A 42S that a high school friend had was how I first learned about RPN and HP calculators. Bought a 48G soon after which I still have. I use the prime app on android now which works well when needed.