Hacker News new | ask | show | jobs
by jappgar 54 days ago
It's a double-edged sword. Two million lines is a major feat. It's also represents a significant maintenance burden.

The advantages to Haskell are theoretically obvious. The downsides are harder to intuit.

The temptation is to model _everything_ as types. The codebase itseld becomes a _business specification_, not an application. Every policy change is a major refactor (some of which are shockingly high-touch thanks to Haskell safety).

The lesson is you cannot have your cake and eat it too. Eventually you become trapped by your types.

Haskell is really impressive and powerful, perhaps especially at this scale. However it brings its own unique problems. The temptation to model business logic as types leads to rigid structures. And the safety these structures bring can blind you to other classes of risk.

2 comments

You can do a great job of navigating that as long as you have some experienced engineers with taste building the core pieces. You can't have it all, but you can have a lot.

I interned at Jane Street years ago and they seemed to do a great job of walking that line (in OCaml rather than Haskell, but same difference). They moved remarkably quickly despite working in an area with a lot of inherent complexity and where reliability and correctness are an existential concern to the business. (Which, perhaps surprisingly, is massively more the case for a trading firm than for a Mercury-like neobank...) In hindsight, a key thing Jane Street did was hire some experienced OCaml programmers with great taste (like Stephen Weeks, the author of MLton) and let them build the core libraries and guide the whole codebase from the beginning.

Unfortunately, this is one of the things that Mercury didn't do anywhere near as well.

Any particular stories illustrating that that you can share?
Typescript too: https://www.richard-towers.com/2023/03/11/typescripting-the-...

Tbvh the biggest downside of a Turing complete type system is that you can theoretically implement an application that compiles to dust.