4 ms·
Can someone address the actual usefulness/fit of Haskell as a general purpose programming language for development of complex systems? Most of my career (rough
by alarge 13y ago
Can someone address the actual usefulness/fit of Haskell as a general purpose programming language for development of complex systems?
Most of my career (roughly 30 years), I've been a Unix server-side engineer, writing code in C and C++ with a smattering of Java every now and then. With my latest job, I've picked up Ruby, Javascript (including Node.js) and Go. Of the three, I tend to prefer Ruby for small utility code and Go for serious server code.
In addition to the relatively clean syntax of these languages (and Go's awesome concurrency paradigm), one of the things I really like about the modern crop of languages is the library and 3rd-party support. Need to talk to mysql? There's a gem/package/module for that. Redis? Same. Pubnub? Same. Stuff like http is baked into the standard libraries. Need to implement a high-performance logging subsystem with file rotation based on age or size? These languages all provide library access to the necessary OS fundamentals to do that. In short, I haven't found very many problems that I could solve in C++ that I can't in Ruby or Go (or probably in Node). And with a lot less effort and (at least in Go or Node) at close to the same performance.
I hear the whole "functional programming is better" pitch, and I have very limited knowledge/experience in that area. What negatives does a paradigm shift from "imperative" to "functional" programming introduce? Are there some classes of problems that aren't appropriate for a language like Haskell? Are there real-world examples of high-traffic services where the entire backend is built in Haskell?
- asdasf 13y agoMost of what you describe applies to haskell just as it does to everything else. It is a general purpose programming language. If you want to see what packages are available look here: http://hackage.haskell.org/ http://hackage.haskell.org/ Yes, simple http support is in the standard library, more full featured http libs are on hackage. As for the functional programming question: I haven't found any negatives. I went from imperative programming to ocaml specifically because I thought the whole functional programming thing was just hype and wouldn't really be suitable for everything, so I wanted to be able to fall back on imperative and OO styles as needed. After a few years of never needing to fall back, I decided to take a closer look at haskell. The places haskell isn't ideal are basically the same as other high level languages. If you are doing bit twiddling or need precise control over how data is laid out in memory, you pretty much want C. I also still use shell scripts for little sysadmin stuff. Other than that I pretty much do everything in haskell now: web development, random utilities that are bigger than I want a shell script to be, network services, etc.