16 ms·
Question to the Haskell experts here. Is Haskell more academic in nature or used heavily in Production environments? Is there an application sweet spot/domain
by gjkood 9y ago
Question to the Haskell experts here.
Is Haskell more academic in nature or used heavily in Production environments?
Is there an application sweet spot/domain (say Artificial Intelligence/Machine Learning, etc) where it shines over using other languages (I am not talking about software/language architectural issues like type systems or such)?
I have no experience with Haskell but do use functional languages such as Erlang/Elixir on and off.
- moomin 9y agoApplication sweet spot is a funny thing, because it's mostly determined by the presence of specific libraries. What Haskell has more than anything is ridiculously general libraries. It's got perfectly good libraries for web development, Postgres access &access, but the only place I'd say it's got a real application-specific strength in libraries is parsing. Weirdly, what Haskell is good at is generality. Which is much the same as for LISP. I'd say the Haskell community remains academic/hobbyist, but that's not to say there aren't plenty of people doing Real Work in it.
- gjkood 9y agoOk, so the generality like LISP/Scheme with a few basic productions/rules and some basic operations could be used to create/represent any levels of complexity. Something like Northhead & Russell's Principia Mathematica.
- platz 9y agoI think painting Haskell as a LISP but in a blank-slate world without packages is not quite accurate. There is a large library of existing packages that take you beyond the language's primitive constructions.
- moomin 9y agoYes, and that's why you're often scratching your head at the function definitions: they're extremely general solutions to general problems. This, in conjunction with the documentation issue means that often you end up getting referred to papers, which does nothing to help the "only for academics" impression.
- platz 9y agoIt is a fair point that some libraries could benefit from some better soft documentation.
- alexbecker 9y agoI agree that parsing libraries are probably the strongest part of the Haskell ecosystem for applications. The only time I've chosen Haskell for a serious application was because of its parsing libraries (specifically parsec): https://blogdown.io/ https://blogdown.io/.
- posterboy 9y ago"academic/hobbyist" probably doesn't give justice to the benefit those works provide for languages that implement experiments pioneered in i.e. haskell. I say "probably" because I can't give any exact examples.
- beojan 9y agoThis is really a specific example of the benefit academia generally provides to society being highly underappreciated.
- hvidgaard 9y agoOne of the main reasons Haskell isn't used more in production systems is the small pool of developers that can actually program in it. It is a very good language once the type system makes sense and you can reliably reason about the lazy nature of it.
- Veratyr 9y agoI think I can safely say it isn't used heavily in many production environments but it is used heavily in some. For example, one of Facebook's abuse systems, dealing with 1M requests per second is written in Haskell: https://code.facebook.com/posts/745068642270222/fighting-spam-with-haskell/ https://code.facebook.com/posts/745068642270222/fighting-spa... As for particular places where it shines, I don't know of any in particular. I remember when taking my Declarative Programming course in university my lecturer loved to talk about an experiment the military did where they challenged a few teams to implement some kind of radar system in their chosen language and evaluated them based on time taken, correctness and code complexity (LOC) at the end. The Haskell team performed very very well. I can't find any details on this experiment though...
- gjkood 9y agoOk, so the Facebook example definitely falls under a contemporary heavy production usage system. Thanks.
- crogre 9y agoThe article you're looking for is http://www.cs.yale.edu/publications/techreports/tr1049.pdf http://www.cs.yale.edu/publications/techreports/tr1049.pdf - Two of the top three (out of ten) solutions were made in Haskell, one by a beginner.
- coldtea 9y ago>I can't find any details on this experiment though... Probably this one: http://www.cs.yale.edu/publications/techreports/tr1049.pdf http://www.cs.yale.edu/publications/techreports/tr1049.pdf But take it with some sacks of salt -- it's a single research paper. It should be replicated, peer reviewed, etc to have any merit. It's methodology could be totally crap for example...
- deleted 9y ago[deleted]
- agumonkey 9y agoI just saw a haskell meetup where they're using haskell for devops. Basically static typing the underlying machine configurations. As usual, being an Haskell code, the abstraction is generalized and you can apply the logic on other domains.
- tonyedgecombe 9y agohttps://propellor.branchable.com/ https://propellor.branchable.com/ I would guess.
- agumonkey 9y agoGood point, this was the first of the two libraries mentioned, the other has just been open sourced; it's called deptrack https://github.com/lucasdicioccio/deptrack https://github.com/lucasdicioccio/deptrack
- filterfish 9y agoI've been using propellor for a few months now and it'fantastic. It takes a little while to get your round it but compared to puppet, chef and ansible, of which I've used all, it's a breath of fresh air.
- gjkood 9y agoThats really interesting. So config files themselves could be considered as some complex type and the inherent language type checking may be used to validate them? Somehow reminds me of Structs/Records in Erlang/Elixir and using pattern matching, conditions and guard clauses to enforce validity or logic.
- _ar7 9y agoWas it https://fugue.co https://fugue.co ? I think they use Haskell for their DSL
- agumonkey 9y agohere's the list of libs mentioned https://news.ycombinator.com/item?id=14267364 https://news.ycombinator.com/item?id=14267364
- scardine 9y agoHaskell primary concern is correctness - there is an autistic-level obsession with it. If your algorithm is right the Haskell implementation is probably right. This is why it is not very practical for me, most of the time my problem is getting to the right formula in a timely fashion - implementation is the easy part. Like the OP I use Python when I'm concerned about pragmatism.
- embwbam 9y agoI've been playing with it for about 5 years, started the local Haskell meetup, etc. I used it on a side project that reached beta in 2015, and on a startup at the beginning of 2016. Starting at the end of 2016 I started using it on a big contract. I had to convince the client it was a good idea, but they've been convinced by my team's productivity. All of the above were back end web services. The current project is a bunch of systems to underwrite and issue loans and involves an ML calculation (hosted on data robot). I love it for general back end web development. I can actually solve problems so they stay solved.
- robertlagrant 9y agoI'm VERY curious about this! Backend web services not being the sexiest / most theory-requiring subject. How did you convince the client, and why did you choose Haskell for this over, say, .NET, which throws a web service up quicker than it took me to type this? What sort of productivity are you achieving?
- haskellandchill 9y agoProduction use cases pushed me towards Haskell. What elegance there is serves towards reasoning about the correctness of complex code, however the tradeoff is difficulty in reasoning about performance. You can still get great performance! And I use it for prototyping in the Type-Driven Development style. Strongly disagree with "if it compiles it is correct" but we have great tools like Doctest and QuickCheck for that. I usually write types with DocTest examples first, then implement. undefined with lazy evaluation is really cool for figuring out function signatures first.
- vog 9y ago> reasoning about the correctness of complex code, however the tradeoff is difficulty in reasoning about performance That's what drove me to languages like OCaml and Rust, which try to solve this tradeoff in a different way: Same thing about strictness and correctnes (despite slight differences in the type system), but lazy evaluation is only provided when explicitly asked for. The cool thing about OCaml is that you can actually reason about performance, as long as you ignore memory issues (memory usage, garbage collector runs, etc.). Rust is heavily inspired by OCaml and allows you to also reason about correctness and performance of memory usage.
- cies 9y ago> The cool thing about OCaml is that you can actually reason about performance, as long as you ignore memory issues (memory usage, garbage collector runs, etc.). If you ignore mem issues you can also reason about the performance of Haskell :) If we want to reason about perf, I think Rust is currently leading in terms of a modern language that allows perf reasoning.
- AnimalMuppet 9y ago> If you ignore mem issues you can also reason about the performance of Haskell :) Really? My guess (based on close to complete ignorance) would be that laziness would make reasoning about performance hard. Can you ELI5 why my guess is wrong?
- kepano 9y agoWe use Haskell in production at lumi.com for our backend/API. We've found it very productive and easy to maintain.
- GoodbyeEarl 9y agoReact, HapiJS, RethinkDB, Node and Haskell. That might be the coolest stack ever. Do you have any FOSS project on Github?
- kepano 9y agoNo projects under the Lumi name yet, but our team contributes to many FOSS projects and also have their own interesting projects such as Purescript by Phil Freeman who recently joined the team: https://github.com/purescript/purescript https://github.com/purescript/purescript
- GoodbyeEarl 9y agoThat's really nice. Sounds like a very experienced team too.
- cultofmetatron 9y agobeen a nodejs dev for years but I've recently found react, typescript, elixir and rust more to my liking with python for ML stuff. Good Type safety seems to be an acquired taste.
- platz 9y ago> Is there an application sweet spot/domain State of the Haskell ecosystem: https://github.com/Gabriel439/post-rfc/blob/master/sotu.md https://github.com/Gabriel439/post-rfc/blob/master/sotu.md The topics are roughly sorted from greatest strengths to greatest weaknesses. Each programming area will also be summarized by a single rating of either: Best in class: the best experience in any language Mature: suitable for most programmers Immature: only acceptable for early-adopters Bad: pretty unusable
- gjkood 9y agoThanks for the link. Great reference. This could keep me occupied for a while.
- dxbydt 9y agoThis is a fantastic link & I love the discretely sorted topics with ratings (could be more granular but its a start). Is there a similar link for other PLs notably more pedestrian langs like Java/Python/C ?
- untangle 9y agoThis is an excellent Haskell resource. Grades are given by both application domain (e.g., "web development") and development task (e.g., "testing" or "IDE Support"). Each of the categories has not only a grade but also list of relevant libraries and example projects.
- cowardlydragon 9y ago"Note that there is one big catch: the default String type in Haskell is inefficient. You should always use Text whenever possible." I'm sorry to cherrypick, but how did this happen??? Unicode shouldn't be a library or extension. It should be in the language.
- harry8 9y agoThe state of the Haskell ecosystem is that it is amazing at encouraging people to write libraries, especially libraries to assist in writing haskell code but amazingly bad at encouraging people to write actual programs, especially actual programs useful for something that isn't writing code. Take out the programs that are for writing code, ghc, shellcheck, darcs etc. And what are you actually left with? git-annexe, pandoc, xmonad is hledger worth knowing about if you don't care what language it was written in? (Maybe it's amazing, first I've heard of it). Whenever I bring this up, people find it upsetting. The Haskell community might need to get past both of those things. 1.0 was 27 years ago. So many fabulous programmers have gone down the road for entertainment or enlightenment so where are your damn apps if you're a language that doesn't suck for writing them, no really, where are they?
- marcosdumay 9y agoHaskell has a preference for looking academic, and is one of the favorites on academic circles. But that does not mean it's not used within industry. I'd say that people mostly do not know what is running in industry. It could be any share of anything. We get a hint looking at job offers; Haskell is small there, but not unheard of. On the sweet spot, Haskell is great for modeling complex domains; it's great for long-lived mostly maintenance stuff, since refactoring is so easy; it tends to generate very reliable and reasonably fast (faster than Java/.Net) executables, but hinders complete correctness proofs and has some grave speed issues that can ruin your day if you hit them. I would like to know how is it to manage a team of Haskell developers. I do expect it to be better than Java/.Net in forcing safe interfaces between developers (thus making it reasonably easy to survive a bad developer in a team), but I never saw it in practice.
- ChemicalWarfare 9y ago>> I'd say that people mostly do not know what is running in industry well if anyone does know what's out there then HN crowd would be a pretty good suspect in that regard. I personally have done my fair share of consulting and prof services engagements - dozens of them across all kinds of industries - I've never seen a Haskell shop. Java, Python, JS, Golang, Scala, Clojure, .Net, C, PHP - definitely out there in the field. Haskell - not so much.
- pyre 9y agoAn ex-co-worker went to work at JanRain with Haskell: http://www.janrain.com/blog/haskell-janrain/ http://www.janrain.com/blog/haskell-janrain/
- forgottenpass 9y agowell if anyone does know what's out there then HN crowd would be a pretty good suspect in that regard. HN is a comically bad barometer for anything other than what's trendy in norcal.
- cwyers 9y ago
- aseipp 9y agoI've been writing Haskell for nearly 10 years and am coming up on 4 years writing it full time. (You could say I know the language pretty well...) I think it's just a pretty good general purpose language, for the most part? I know that's not very exciting of an answer, but I do consulting for people and I've seen Haskell for everything our clients do, from web development (a lot of web development), compiler development, distributed OLAP style analytic processing on large data volumes, custom languages/DSLs, machine learning, hardware/FPGA design work, desktop software (flight tracking/schedule software, used by on-ground airport personnel, with some incredibly beautiful code), cryptocurrency and cryptography etc etc. There are the occasional research-y things, and we've also just done things like that for random institutions or companies (e.g. prototyping RINA-style non-TCP network designs.) I wouldn't say any of these were a particular "sweet spot". Though some things like compiler development or web development are pretty pleasurable. The language and libraries make those pretty good. Web development is one of the more popular things now especially. Everyone has to have their thing in a browser now, and there's a fair amount of library code for this stuff now. Definitely one of the stronger things. You do get the occasional problem that just has this perfectly elegant solution at the core and that's always an awesome bonus. One of my favorites was the aforementioned flight software. It had this very strict set of bureaucratic guidelines but all the core logic ended up having a very nice, pure formulation that ended up being about 8 functions used in a single function-composition pipeline. (We use this sometimes as an example in our training of real solutions for real problems.) A lot of software is much more boring and traditional. Mostly, it works well and stays out of my way, and lets me solve problems for good. And I really like the language in general compared to most other languages; it hits a very unique sweet spot that most others don't try to touch. I do admit the sort of high level, abstract shenanigans are fun and interesting too, but I think of it more as a fun side thing. Just this week I literally wrote the documentation for a data type, describing it as an "Arbitrary-rank Hypercuboid, parameterized over its dimension." Luckily I do not think you will ever have to use that code in reality, so you can breath easy. :) --- EDIT: and to be fair, there are definitely some problems. Vis-a-vis my joke, we could all collectively use better "soft" documentation. I think some problems like "operator overload extravaganza" are overblown due to unfamiliarity. Most real codebases aren't operator soup; but bigger problems are things like "When to use the right abstraction" are real problems we have hard times explaining. I don't think performance is much harder than most other languages, but we definitely don't have tools that are as nice in some ways, nor tools that are as diverse. The compiler is also slow compared to e.g. OCaml. Some parts of the ecosystem are a lot worse than others; e.g. easy-to-use native GUI bindings are still a bit open. Windows is a bit less nice to use than Unixen. There's a big gap between training in-person vs online/self taught content too, IME.
- arnon 9y agoHaskell works really well for things revolving around languages. At SQream (www.sqream.com), Haskell is used for CLI, SQL parser, SQL language compiler, SQL optimizations and a variety of tools. We also use Haskell to generate Python code for testing (think: describing a testing scenario and sets of queries, translating into a runnable, predictable Python script that's easy to debug)
- charlieflowers 9y agoTo me, this is Haskell's most appealing strength. The idea is, you can express your domain and logic in Haskell in pure functions which are highly testable, and then you can use that to generate code in any language you want. And the code you generate can have whatever zero-cost abstractions you choose to invent, all implemented in the nice, functional Haskell layer. Haskell's strength at expressing and transforming AST's, in pure functional, understandable, testable code seems to be the key here.
- arnon 9y agoYou hit the nail on the head. We also employ QuickCheck rather extensively, which makes testing millions of scenarios really straightforward.
- mands 9y agoWe're using Haskell to produce an entire compute platform for building, composing, and running type-safe containerised micro-services for data science. This certainly touches on a lot of the areas that Haskell is traditionally known for being good at, e.g. building DSLs, type systems, interpreters, etc. However, the work also includes a runtime platform that is more low-level, including building our own container system, talking to the Linux kernel, using cgroups/resource management, and distributed message passing - areas where languages such as Go have found a niche, and may be classified as Real World. However for us, Haskell's type-safety, runtime performance, and extensive ecosystem has been a boon even in this domain. We effectively use it as an (incredibly powerful) general-purpose language here, and it's worked more than fine. We're currently at around 15,000 lines of code with a team of 5 Haskellers, and it hasn't really been a problem regarding performance, understanding the codebase, or with newcomers to the team. (plug - we're at https://www.github.com/nstack/nstack https://www.github.com/nstack/nstack and are hiring more Haskellers)
- nickpsecurity 9y agoThis work might give you some ideas even though it's a bit dated: http://programatica.cs.pdx.edu/House/ http://programatica.cs.pdx.edu/House/ Also, COGENT for lowest-level stuff being wrapped for use in Haskell somehow might be interesting. Used on ext2 filesystem already. https://ts.data61.csiro.au/projects/TS/cogent.pml https://ts.data61.csiro.au/projects/TS/cogent.pml
- mands 9y agoThanks for the pointers - house is great, I remember reading some of the papers a long time ago. I haven't seen COGENT before - will take a look over the weekend - thanks!
- seabrookmx 9y agoAny particular reason you're building your own container system instead of leveraging LXC or Docker? For the massively parallel workloads you find in data science, it seems like you'd benefit a lot from the wealth of container orchestration tools around Docker (swarm, Rancher/Cattle, Kubernetes) in order to easily scale out your functions. Especially when many companies already have these set up for their more vanilla applications. This is an example I've seen that can leverage a docker swarm for invoking functions, loosely modeled after AWS Lambda: https://github.com/alexellis/faas https://github.com/alexellis/faas
- elihu 9y agoHaskell is good for problems where you want to spend most of your time thinking in terms of the problem domain and not so much about all the little implementation details. For instance, if you were to write a CAD program, you probable want to be spending your time thinking about algebra and geometry, and not about little details like how an array is laid out in memory or when memory needs to be freed. The latter might be important for optimizing the last bit of performance out of a tight loop, but a lot of problems are hard enough on their own that just coming up with any solution that works is enough trouble on its own. It's also good for problems where you want pretty good performance but don't have to be as fast as C, or where you want to take advantage of multi-core parallelism but don't want to deal with the usual complexities of threaded code. Persistent data structures are really nice for certain kinds of applications, such as web services, where you have some complex internal state that needs to be updated periodically. Error handling is really easy when you can just bail out when something fails, since none of the state was ever modified-in-place and your old pointer to the old state is still valid. The powerful static type checker makes Haskell a good fit for applications where it's really important that you calculate the right answer, or where you don't want to spend much time tracking down weird bugs. Haskell isn't so good at applications where you need hard real-time guarantees or you want to have very fine control over the memory layout of your data structures or you want to be able to easily predict CPU or memory usage.
- collyw 9y agoI am not an expert in any way, but parsers seem suited to Haskell. Perl 6's original parser was build using Haskell I believe and went on to influence the language a lot (again this is all stuff i have read, I have no real practical experience with either Perl 6 or Haskell).
- sjg007 9y agoI think Haskell has a future in machine learning.
- deleted 9y ago[deleted]
- blackRust 9y agoHaskell in production (mostly) at: https://scrive.com/ https://scrive.com/