Re:Clac – A command-line, stack-based calculator with postfi...
by soveran on Thursday April 13, 2017 @02:09PM
(#14109466)
I'm not the author of the post, I just wrote the tool. I agree with you that it's not groundbreaking technology :-)
In fact, the code is extremely simple. As I mentioned in the README, I've used dc a lot and what I propose with clac is an improvement (for my taste) regarding the UI, as there's an always-visible representation of the stack that gets updated as you type. I recorded a short video to show it in action: http://files.soveran.com/misc/clac.mov
Re:Clac – A command-line, stack-based calculator with postfi...
by undershirt on Thursday April 13, 2017 @02:49PM
(#14109825)
I just want to say great work. The parent comment here didn't realize that you drastically improved the user experience by showing the stack, which I think makes all the difference here.
To make this clear, I would upload your video to gfycat and link the gif in your readme.
Re:Clac – A command-line, stack-based calculator with postfi...
by soveran on Thursday April 13, 2017 @03:52PM
(#14110374)
I just updated the README with a gif of that video. Thanks for the idea!
Re:Clac – A command-line, stack-based calculator with postfi...
by lexpar on Monday April 24, 2017 @03:34PM
(#14187347)
Just looked at the video, the 'as you type' updated stack info is actually pretty cool. I thought based on the description that it only printed the contents of the stack after a command was executed. This is much nicer.
You guys are right, I didn't realise it was this cool, and I was too quick to be cynical.
Re:Clac – A command-line, stack-based calculator with postfi...
by mannigfaltig on Thursday April 13, 2017 @05:13PM
(#14110967)
Actually, the prospect of maybe, randomly getting to the front page of HN with some small interesting program is a nice motivator for small side projects. Overall it's probably a good thing introducing people to new concepts and ideas along the way (in this case Forth, post-fix notation and stack-based evaluation strategies).
Re:Clac – A command-line, stack-based calculator with postfi...
by mwfunk on Thursday April 13, 2017 @06:33PM
(#14111385)
Sharing a side project, even a simple one, is hardly showing off. It would be showing off if he claimed it was some amazing earth-shattering new thing that's going to blow everyone's minds. On the other hand, being dismissive about its mundanity is clearly an attempt to show off.
Re:Clac – A command-line, stack-based calculator with postfi...
by daveguy on Thursday April 13, 2017 @01:56PM
(#14109345)
> I don't understand why things like this get posted to HN so often.
Nostalgia.
Re:Clac – A command-line, stack-based calculator with postfi...
by sevensor on Thursday April 13, 2017 @02:01PM
(#14109392)
Likewise, I don't see this replacing dc for me. The exciting thing is really the suggestion to consider what it would take to implement your own dc. Reimplementing dc was never an assignment I saw as a student, so I think it's valuable to point out that it's an interesting exercise.
Re:Clac – A command-line, stack-based calculator with postfi...
by hashhar on Thursday April 13, 2017 @01:48PM
(#14109259)
Also the command dc ships with most Linuxes. It is included with the bc package.
Re:Clac – A command-line, stack-based calculator with postfi...
by mccv on Thursday April 13, 2017 @02:01PM
(#14109391)
dc exists, and is great for quick shell script math. As an interactive calculator REPL it is... not the greatest. Having the stack represented on the right gets closer to the HP 48 experience.
Re:Clac – A command-line, stack-based calculator with postfi...
by lutusp on Thursday April 13, 2017 @02:15PM
(#14109519)
> I just don't understand why the author would think this is something worth showing off.
There's a large class of people who can be relied on to see this as a noteworthy accomplishment -- students. More experienced hands will note the absence of range checking and error trapping.
I hope this doesn't come off as snide... I just don't understand why the author would think this is something worth showing off.