5 ms·
I don't understand why things like this get posted to HN so often. This kind of program is a very common exercise in university courses and appears in countless
by lexpar 9y ago
I don't understand why things like this get posted to HN so often. This kind of program is a very common exercise in university courses and appears in countless programming books. Heck, you implemented it in C, and this exact exercise appears in K&R C.
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.
- hashhar 9y agoAlso the command dc ships with most Linuxes. It is included with the bc package.
- mccv 9y agodc 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.
- daveguy 9y ago> I don't understand why things like this get posted to HN so often. Nostalgia.
- sevensor 9y agoLikewise, 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.
- soveran 9y agoI'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 http://files.soveran.com/misc/clac.mov
- undershirt 9y agoI 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.
- soveran 9y agoI just updated the README with a gif of that video. Thanks for the idea!
- lexpar 9y agoJust 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.
- lutusp 9y ago> 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.
- mannigfaltig 9y agoActually, 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).
- mwfunk 9y agoSharing 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.