frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Haskell, Reverse Polish Notation, and Parsing

https://mattwills.bearblog.dev/haskell-postfix/
43•mw_1•3d ago

Comments

jacksonslipock•3d ago
Made me feel like I understand monads finally...will read again in a couple days when I inevitably forget.
kibwen•6h ago
Agreed that RPN (and stack machines) are beautiful and underappreciated. Unfortunately, it's for a relevant reason that I have to push back against the author's newfound love of recursion. Like everyone else I had the same brain-exploding moment when I realized that recursion was possible and how if forced me to re-think what functions were capable of, but now that I'm old and ornery I'm of the Hot Take that recursion is a clumsy alternative to a loop, not the other way around. Which is to say, if a portion of a program is going to threaten to execute for an unbounded amount of time, I want that fact to be explicitly called out in the code via a looping construct, rather than having to worry whether any random function call is going to recur (or even mutually recur), to say nothing of the efficiency of holding onto a single piece of loop-relevant mutable state rather than forcing my runtime to handle an unbounded number of stack frames. If your language both guarantees tail recursion and calls it out syntactically, then you get a pass, otherwise I'd be perfectly happy working in languages that didn't support recursion at all.
Jaxan•5h ago
If I have to traverse a tree, then recursion is more natural to me. With a loop you’ll have to manually use a stack (it’s fine, but more error prone). For lists, I rarely write loops or recursion. It’s mostly folds and maps.
odyssey7•5h ago
Linear recursion vs tree recursion.
agumonkey•4h ago
I don't know man, very often sophisticated problems require recursive thinking (even if you don't write it so later on) to be able to see similarities in sub problems. Just last week I had to resort to this to flatten-index json files. I started confused and then made an inductive leap and the solution unfolded itself (no pun intented) as a two-liner.

It's way beyond brain-teaser for me, it's the sharpest tool I know of.

odyssey7•3h ago
Recursion isn't about writing functions, it's the foundation of scalable systems.

Deep learning with backpropagation? That's the chain rule of calculus applied recursively over a network, as described by Rumelhart, Hinton, and Williams. We owe LLMs and emerging AI to recursive ideas.

The internet? It's a recursive structure made up of an arbitrary number of interconnected servers. We owe the information era to recursion.

Database queries and programming languages? We prove correctness by reasoning recursively. We architect entire systems of arbitrary size, with correct behavior, simply by specifying the properties of their element types.

Sure, you could probably block recursion within the scope of a program's compilation. But when you're developing scalable systems, recursion is their natural language. The powerful recursive algorithms for these systems are symptoms of their scalability, not mere implementation choices. When forced, stacks and other recursion workarounds are obstacles that get in the way of innovation.

Plus, real-world systems aren't single programs compiled together. When microservice A calls microservice B, there's potential for recursion, regardless of whether the programming language of either microservice supports it. Programmers still have to think recursively. No programming language annotation is going to change that.

The Great Pyramid contains a combinatorial explosion of smaller pyramids inside it. They made it out of blocks. Forty centuries look down upon us.

HappMacDonald•1h ago
I won't badmouth your preference of one form of iteration over another, but I don't follow what you're trying to say about what functions do.

It's not clear if you mean "the functions that you write" or "the functions that other people (library providers? Colleagues? Juniors?) write.

The functions you write do what you tell them to do. If you don't tell them to recurse, then they don't. If you do tell them to recurse, then that has whatever frame optimization or boundedness guarantees that you bake into it (which is the same responsibilities you take on writing a loop just packaged in a slightly different form).

The functions black-boxed by a library aren't something you have a lot of control over, nor in most cases are those black boxed by colleagues. Your concerns sound as though they target these cases, though your preferences really have no traction here.

jcalvinowens•59m ago
I've always felt like RPN is a really powerful lesson in how subtly redefining the semantics of a problem can make it suddenly much easier to solve.

My personal struggle with functional programming is how difficult I find it to be iterative. I've very frequently backed myself into a corner and ended up having to rewrite everything, whereas in C, even when I miss badly on the architecture, I'm still usually able to reuse some big chunks of what I've already done in the end. Maybe it's just inexperience.

Stop Hiding My Controls: Hidden Interface Controls Are Affecting Usability

https://interactions.acm.org/archive/view/july-august-2025/stop-hiding-my-controls-hidden-interface-controls-are-affecting-usability
152•cxr•3h ago•69 comments

Local-first software (2019)

https://www.inkandswitch.com/essay/local-first/
598•gasull•11h ago•191 comments

Serving 200M requests per day with a CGI-bin

https://simonwillison.net/2025/Jul/5/cgi-bin-performance/
22•mustache_kimono•1h ago•11 comments

Cod Have Been Shrinking for Decades, Scientists Say They've Solved Mystery

https://www.smithsonianmag.com/smart-news/these-cod-have-been-shrinking-dramatically-for-decades-now-scientists-say-theyve-solved-the-mystery-180986920/
118•littlexsparkee•7h ago•41 comments

Techno-Feudalism and the Rise of AGI: A Future Without Economic Rights?

https://arxiv.org/abs/2503.14283
54•lexandstuff•4h ago•28 comments

Optimizing Tool Selection for LLM Workflows with Differentiable Programming

https://viksit.substack.com/p/optimizing-tool-selection-for-llm
53•viksit•5h ago•12 comments

What a Hacker Stole from Me

https://mynoise.net/blog.php
40•wonger_•3h ago•12 comments

How to Network as an Introvert

https://aginfer.bearblog.dev/how-to-network-as-an-introvert/
48•agcat•5h ago•15 comments

Europe's first geostationary sounder satellite is launched

https://www.eumetsat.int/europes-first-geostationary-sounder-satellite-launched
167•diggan•11h ago•37 comments

macOS Icon History

https://basicappleguy.com/basicappleblog/macos-icon-history
141•ksec•10h ago•59 comments

Operators, Not Users and Programmers

https://jyn.dev/operators-not-users-and-programmers/
39•todsacerdoti•3h ago•12 comments

Speeding up PostgreSQL dump/restore snapshots

https://xata.io/blog/behind-the-scenes-speeding-up-pgstream-snapshots-for-postgresql
92•tudorg•9h ago•16 comments

X-Clacks-Overhead

https://xclacksoverhead.org/home/about
206•weinzierl•3d ago•44 comments

ClojureScript from First Principles – David Nolen [video]

https://www.youtube.com/watch?v=An-ImWVppNQ
11•puredanger•3d ago•0 comments

Atomic "Bomb" Ring from KiX (1947)

https://toytales.ca/atomic-bomb-ring-from-kix-1947/
58•gscott•3d ago•12 comments

7-Zip 25.00

https://github.com/ip7z/7zip/releases/tag/25.00
45•pentagrama•3h ago•36 comments

Yet Another Zip Trick

https://hackarcana.com/article/yet-another-zip-trick
19•todsacerdoti•3d ago•8 comments

The Right Way to Embed an LLM in a Group Chat

https://blog.tripjam.app/the-right-way-to-embed-an-llm-in-a-group-chat/
9•kenforthewin•3h ago•9 comments

The Calculator-on-a-Chip (2015)

http://www.vintagecalculators.com/html/the_calculator-on-a-chip.html
24•Bogdanp•9h ago•4 comments

Haskell, Reverse Polish Notation, and Parsing

https://mattwills.bearblog.dev/haskell-postfix/
43•mw_1•3d ago•8 comments

The Hell of Tetra Master

https://xvw.lol/en/articles/tetra-master.html
7•zdw•3d ago•1 comments

WinUAE 6 Amiga Emulator

https://www.winuae.net/
42•doener•4h ago•5 comments

Seine reopens to Paris swimmers after century-long ban

https://www.lemonde.fr/en/france/article/2025/07/05/seine-reopens-to-paris-swimmers-after-century-long-ban_6743058_7.html
114•divbzero•8h ago•64 comments

What 'Project Hail Mary' teaches us about the PlanetScale vs. Neon debate

https://blog.alexoglou.com/posts/database-decisions/
46•konsalexee•14h ago•72 comments

QSBS Limits Raised

https://www.mintz.com/insights-center/viewpoints/2906/2025-06-25-qsbs-benefits-expanded-under-senate-finance-proposal
59•tomasreimers•14h ago•26 comments

Gecode is an open source C++ toolkit for developing constraint-based systems (2019)

https://www.gecode.org/
62•gjvc•17h ago•13 comments

Solve high degree polynomials using Geode numbers

https://www.tandfonline.com/doi/full/10.1080/00029890.2025.2460966
11•somethingsome•3d ago•2 comments

Parametric shape optimization with differentiable FEM simulation

https://docs.pasteurlabs.ai/projects/tesseract-jax/latest/examples/fem-shapeopt/demo.html
12•dionhaefner•2d ago•2 comments

Is It Cake? How Our Brain Deciphers Materials

https://nautil.us/is-it-cake-how-our-brain-deciphers-materials-1222193/
16•dnetesn•2d ago•4 comments

Pet ownership and cognitive functioning in later adulthood across pet types

https://www.nature.com/articles/s41598-025-03727-9
66•bookofjoe•6h ago•23 comments