8 ms·
I've been using Haskell for quite a bit in production. My personal take, as an engineer who is generally skeptical of fancy language features: Plus: - The typ
by gabipurcaru 7y ago
I've been using Haskell for quite a bit in production. My personal take, as an engineer who is generally skeptical of fancy language features:
Plus:
- The type system. It can make your life a huge pain, but in 99% of the cases, if the code compiles, it works. I find writing tests in Haskell somewhat pointless - the only places where it still has value is in gnarly business logic. But the vast majority of production code is just gluing stuff together
- Building DSLs is extremely quick and efficient. This makes it easy to define the business problem as a language and work with that. If you get it right, the code will be WAY more readable than most other languages, and safer as well
- It's pretty efficient
Minus
- The tooling is extremely bad. Compile times are horrendous. Don't even get me started on Stack/Cabal or whatever the new hotness might be
- Sometimes people get overly excited about avoiding do notation and the code looks very messy as a result
- There are so many ways of doing something that a lot of the time it becomes unclear how the code should look. But this true in a lot of languages
- verttii 7y agoWhat about runtime stuff? I've found Haskell is very good at abstracting away your concerns about the runtime considerations and sometimes it will come back to bite you. I mean all that stuff you want to see into when you're running your app in production, like caching, function invocation times, threads etc.
- gabipurcaru 7y agoCan't really comment on that - most of the code I use is built on the awesome Haxl[0] so we never have to worry about those things. I'm curious what other people think though [0] https://github.com/facebook/Haxl https://github.com/facebook/Haxl
- roar-of-time 7y agoYep, GHC is an incredible compiler and Haskell is an incredible language. If only Haskell had a package manager as slick as Cargo, I'd use it for just about everything.
- atoav 7y agoI never really understand why I would want a type system until I learned Rust and was forced to learn it. Now I don't understand what I was thinking before..
- mehrdadn 7y agoWhat were you using before?
- atroche 7y agoNot parent, but I’d be surprised if the answer didn’t include JavaScript, Ruby or Python.
- atoav 7y agoMostly python and C. With python I didn't really have a type system and with C I never truly realized what the typesystem could give me.
- fulafel 7y agoI suspect one would learn appreciation of limited type systems from the other direction by using a typeless language.
- fulafel 7y agoI would be interested in hearing counterarguments to this!
- leshow 7y agoI wouldn't. Why would you want to take errors that happen at compile time and create runtime errors? In dynamic languages you still have type invariants, it's just now they are invisible and can break your code at runtime.
- fulafel 7y ago
- the_af 7y ago> Don't even get me started on Stack/Cabal Is Stack not adequate? I thought the consensus was that it was ok. Is it really more horrible than say Maven or SBT or whatever in other languages?
- hope-striker 7y agoI guess it's comparable to Maven, but people usually use Maven with an IDE, and Stack on the command line, so that's not very encouraging. Anyway, compared to something like NPM (Node.js) or Cargo (Rust), its user experience is extremely lacking.
- the_af 7y agoI use Maven and SBT from the command line. In general I don't think the difference between a bad or good UI lies in whether it's command line based. I'm not familiar with Cargo, but NPM gives me nightmares!
- hope-striker 7y agoIt's not about whether or not it's command-line based, it's that a lot of pain can be patched over by a good IDE.
- pwm 7y agoThe great news is that tooling is rapidly improving these days. VSCode with the new ghcide is simply amazing. Ghcide is still new and thus has a few rough edges (eg. TH) but overall it lifts the Haskell IDE experience into the 21st century. Give it a try.