News for hackers. Stuff that matters.
Re:Reflecting on Haskell in 2015 by armitron on Friday December 18, 2015 @12:21PM (#10759558)
I like Haskell but I see no future in terms of widespread adoption for it. It's simply too alien for your typical CS grad and for some projects one would like to use it for (let's say security critical), laziness (and non-predictable behavior in terms of memory use and performance) is a big problem.

We do however see some of its features being slowly introduced to other languages which is nice, I guess.

Re:Reflecting on Haskell in 2015 by LukeHoersten on Friday December 18, 2015 @12:39PM (#10759674)
Haskell's learning curve is certainly steeper than other popular general programming languages. But my view on that is best explained with an analogy: calculus is certainly harder to learn than arithmetic approximations but once learned, the complexity of calculus is factored out of all the problems suited for solving with it. Haskell is excellently suited for solving extremely complex problems and why it's so desirable for concurrency and parallelism tasks.

On your second point, while it seems nice to have Haskell features slowly percolate into other languages, I urge caution in thinking that's a panacea for not learning more complex languages. Haskell is greater than the sum of all it's features. It's power comes from the combination of everything working together in a very well thought-out way.

So I don't necessarily disagree with your tone, just some additional commentary from someone who knows C++, Python, Java, and Haskell equally well (and perhaps equally bad ;) ).

Re:Reflecting on Haskell in 2015 by progman on Saturday December 19, 2015 @11:27AM (#10763965)
> Haskell is excellently suited for solving extremely complex problems

I doubt that seriously. Could you write a complete Mars landing project in Haskell for instance? That would impress me. That's the area where Ada excels, or (less impressive) C and FramaC. But Haskell? No way.

AFAIK there is not one serious large project written in Haskell There is not even one sophisticated Haskell IDE for daily use written in Haskell (excuse me Leksah). Tell me if I am wrong, and if there actually are really big Haskell projects. Please don't listen compilers, they are not really complex.

The only advantage which Haskell actually has in comparison to other modern languages is its greatest disadvantage. The overall rock solid type safety of the whole application makes it very difficult to add additional unpredicted functionality which requires a significant change in many modules (where on the other hand the type system helps a lot). I am very impressed by the efforts and the implementations of Haskell but the simple fact that the Cabal hell -- for the simple job of a basic package manager -- lasted for years reveals that Haskell is not that practical after all.

I invested a lot of time to learn Haskell to use it seriously but after I switched to Nim (nim-lang.org) I realized how easy I can get real productivity.

Re:Reflecting on Haskell in 2015 by dllthomas on Tuesday December 29, 2015 @12:20PM (#10807704)
"Could you write a complete Mars landing project in Haskell for instance? That would impress me. That's the area where Ada excels, or (less impressive) C and FramaC. But Haskell? No way."

Depending on what you mean by "in Haskell", probably. You can write hard-realtime software in an embedded DSL in Haskell that gives you explicit control over timings, scheduling, etc, while still giving you Haskell's higher order features for composing your programs.

https://hackage.haskell.org/package/atom

As I understand, the company that wrote it uses it in production in automotive systems.

Re:Reflecting on Haskell in 2015 by imakesnowflakes on Saturday December 19, 2015 @01:01AM (#10762805)
> Haskell is excellently suited for solving extremely complex problems and why it's so desirable for concurrency and parallelism tasks.

What is an example of an extremely complex problem that you have solved that would be vastly more harder to implement in another language.

The most powerful thing that I have noticed is the type system. When you have a complex problem, you end up breaking it up by writing a lot of functions. In case of a language with a less powerful type system, it is hard for you to string them all together to build the complete program.

But with Haskell, if you have cared to actually annotate the types, this becomes a really trivial task. It also detects flaws in your reasoning (because the result of the previous step is incompatible with the input of the current step).

So, doing this would be vastly more difficult in a language like Python or even a language with less powerful type system like C.

Re:Reflecting on Haskell in 2015 by incepted on Saturday December 19, 2015 @11:18AM (#10763929)
> Haskell is excellently suited for solving extremely complex problems and why it's so desirable for concurrency and parallelism tasks.

As is the JVM (and most languages running on it). Not only that, but the JVM has actually a proven track record of being good and performant at it. And you can solve these problems with pretty much the language of your choice.

What makes you think Haskell is well suited for it? Immutability? This is available in a lot of languages (and for languages where it's not enforced, simple programmer discipline and code reviews address it).

Re:Reflecting on Haskell in 2015 by imh on Friday December 18, 2015 @10:19PM (#10762463)
Maybe the difference is that we all learned calculus in classes from experts, while the only way for most people to learn haskell is to pick it up themselves.
Re:Reflecting on Haskell in 2015 by thetmkay on Friday December 18, 2015 @12:49PM (#10759729)
> It's simply too alien for your typical CS grad

In my university, Programming 101 (mandatory) was (and is) Haskell. For context, there is typically a mix of experience among the class - some will have programmed seriously before, but others will have only studied math.

I had already studied Java, but I found Haskell a delightful re-introduction (it was my first exposure to functional programming) and I see its value as an educational tool.

Re:Reflecting on Haskell in 2015 by treebog on Friday December 18, 2015 @01:06PM (#10759838)
Dijkstra wrote an amusing little note about why it's a good idea to teach Haskell in CS 101. http://www.cs.utexas.edu/users/EWD/OtherDocs/To%20the%20Budg...
Re:Reflecting on Haskell in 2015 by cousin_it on Saturday December 19, 2015 @06:39AM (#10763319)
As a first language, I think Haskell is too safe. It forbids you from doing too many things that the computer can do. I recently talked to someone who was learning Haskell as a first language, and it was a surreal experience. It was obvious that he wasn't having fun in the sandbox, but he couldn't articulate it because he'd never been outside the sandbox.

My own first language was QBasic and I'm very happy about it. If I'd been made to suffer through parsers instead of putting colorful circles on the screen, I would think of programming as hard work, and that probably wouldn't lead to a very good career.

Re:Reflecting on Haskell in 2015 by kqr on Saturday December 19, 2015 @07:18AM (#10763381)
> Haskell is too safe. It forbids you from doing too many things that the computer can do.

Computers are to computing science what telescopes are to astronomy, or something. Haskell is a great language for expressing computations, the thing CS is about. It's not meant to flip bits and observe processor states and page faults, if that is your idea of fun. That's more computer engineering stuff.

But Haskell is absolutely capable of drawing pretty circles on the screen in just a couple of lines of code![1]

[1]: https://hackage.haskell.org/package/gloss-1.9.4.1/docs/Graph...

Re:Reflecting on Haskell in 2015 by cousin_it on Saturday December 19, 2015 @08:35AM (#10763509)
> Haskell is a great language for expressing computations, the thing CS is about.

I think Haskell is good at expressing a narrow range of ideas that, honestly, aren't all that fruitful outside the FP field. There are three main reasons why it's not a great language for expressing arbitrary algorithms:

1) It uses the pointer model instead of the integer RAM model. That leads to extra logarithmic factors.

2) Immutability. That's hypothesized to also cause extra logarithmic factors, but AFAIK that's still an open problem.

3) Non-strict evaluation. That wreaks havoc with space complexity, and compositional analysis of performance in general.

Yes, you can add epicycles to remedy these drawbacks (arrays, ST, strictness annotations). But I'd rather use a C-like language in the first place. That's closer to the "core" of CS as I understand it, and that's how most algorithm research is done.

Re:Reflecting on Haskell in 2015 by kqr on Saturday December 19, 2015 @11:09AM (#10763904)
All three are problems with performance on a von Neumann machine. So there are three main reasons why Haskell is not a great language for expressing high-performance computation algorithms. Since CS is a branch of maths, performance isn't that big a deal; the important thing is that the result is computable. The performance may be an interesting property, but so is line count and purity and ease of writing proofs and doing analysis on the code!

Speaking more pragmatically, outside of CS study, most of the programs I write do not require me to write high-performance algorithms – they tend to be very I/O bound, and call out to external libraries/services for the data crunching. When I need performance (because of course I do at times), there is an amazing library that lets me write C code in Haskell[1]. The fact that some sections of my program is performance critical doesn't mean I have to write the entire program in C. I can write just the performance critical parts in C.

[1]: https://github.com/fpco/inline-c/blob/master/README.md

Re:Reflecting on Haskell in 2015 by cousin_it on Saturday December 19, 2015 @02:25PM (#10764535)
Um, CS is totally about performance. Frigging P vs NP is about performance. Sure, there's a part that deals with computability and the halting problem, but I'm not sure Haskell is especially useful for studying that either! It can't even express the notion of "dovetailing over all possible programs" very easily :-)

Out of curiosity, what kind of CS do you mostly work with? If it falls under the umbrella of Curry-Howard, then sure, I agree with you. But CS has tons of other areas like graphics, crypto, AI... The impact of Curry-Howard related ideas on these areas has been disappointingly small, IMO.

Re:Reflecting on Haskell in 2015 by incepted on Saturday December 19, 2015 @11:20AM (#10763935)
> In my university, Programming 101 (mandatory) was (and is) Haskell.

I don't think it's a good idea because it might discourage a lot of students from the get go and they might simply drop out.

It's well established today that the language you start with has little impact on your mastery of the field years later (most of us started with BASIC I bet), so you might as well start with an easy language that will get people hooked.

If the students are curious and talented, they will move on to more complex things with time.

Re:Reflecting on Haskell in 2015 by chrisseaton on Friday December 18, 2015 @01:02PM (#10759812)
> In my university, Programming 101 (mandatory) was (and is) Haskell

I think this is true at a lot of universities. I would have thought if you get a random CS grad they're much more likely to have Haskell experience than Go, Ruby, Clojure, etc.

Re:Reflecting on Haskell in 2015 by flying_kangaroo on Friday December 18, 2015 @01:01PM (#10759810)
From what I've heard, MIT does the same thing with CS101, except in Scheme. Starting the curriculum that way seems like a good idea (in the long run, since internships and whatnot all want Java or C++/C#), between leveling the playing field and providing a foundation on a lot of the "math" that CS is based on.
Re:Reflecting on Haskell in 2015 by jandrese on Friday December 18, 2015 @02:30PM (#10760415)
I had a course in College that was taught in Scheme. It wasn't the "intro to computer science" class, but it was mandatory and at the Sophomore level.

That said, scheme never managed to feel like anything other than a toy language to me, and that we were being fed problems that happened to map neatly into the structure of the language. Write a RPN calculator! Write a Tree Parser! Stuff that really isn't that much harder (but admittedly more verbose) in imperative languages.

I couldn't help but to think "Sure, these problems are easy enough, but how would I blit pixels with this language? How would I process TCP/IP packets? What would a database interface look like? How am I supposed to do error handling?"

In the end I had no desire to integrate Scheme into my day to day programming.

Re:Reflecting on Haskell in 2015 by gugagore on Friday December 18, 2015 @01:13PM (#10759889)
Since 2007, the intro curriculum uses Python, not Scheme.
Re:Reflecting on Haskell in 2015 by dragonwriter on Friday December 18, 2015 @01:05PM (#10759830)
> It's simply too alien for your typical CS grad

I think its more too alien for your typical mid- to late-career developer that hasn't seen a CS classroom for a decade or more, or your typical successful non-CS-degree-holding autodidact developer that's done well with a narrow range of industrially-popular languages, than it is too alien for your typical CS grad.

Re:Reflecting on Haskell in 2015 by yummyfajitas on Friday December 18, 2015 @01:06PM (#10759839)
Haskell is already gaining widespread adoption in a variety of fields that require the levels of correctness it provides (hint: compilers, DSLs to correctly specify and process complicated contracts worth millions) or where haskell-style code more directly maps onto low level machine concepts (hint: not x86).

Haskell will probably not take over the world of web programming. It currently is gaining widespread adoption in a variety of interesting places, however.

Re:Reflecting on Haskell in 2015 by jeffdavis on Friday December 18, 2015 @01:06PM (#10759840)
I don't think laziness is as much of an issue as the GC. You can't write a Haskell library and the link it into arbitrary programs safely.

If you want to write a new libssl or libjpeg, you need to use c, c++, or rust (or a few others, of course).

Re:Reflecting on Haskell in 2015 by xixixao on Friday December 18, 2015 @01:10PM (#10759872)
Re:Reflecting on Haskell in 2015 by AnimalMuppet on Friday December 18, 2015 @02:49PM (#10760533)
I don't think "fighting spam" is really what the GP was talking about.

A common "best practice" with cryptographic material is to hold it as short a time as possible (um, but garbage collection makes that hard), and zero it before releasing it (but immutability gets in the way). That means that, in a language like Haskell, you're going to leak crypto material into the free memory pool unless you break the language paradigm to prevent it. Worse, you have to remember to break the language paradigm everywhere you need to.

In C++, you'd just wipe it with zeroes in the destructor, and use RAII to make sure it's freed when you don't need it any more. In Java, you have to explicitly overwrite it on your way out of the block (maybe with a "finally" clause). But in Haskell, you can't overwrite it (yeah, you actually can, but still...)

Re:Reflecting on Haskell in 2015 by jerven on Friday December 18, 2015 @04:48PM (#10761211)
In non RT java this is nearly impossible. The best way is to use a specific allocated off memory byte buffer and zero it once done. But GC/deallocation and JIT compilation will fight your zeroing attempts, and it can easily break existing code :(
Re:Reflecting on Haskell in 2015 by startling on Saturday December 19, 2015 @02:01AM (#10762899)
This is just wrong. You can totally use managed mutable buffers that you overwrite once you're done. It's probably easier than in Java.
Re:Reflecting on Haskell in 2015 by jberryman on Friday December 18, 2015 @02:19PM (#10760349)
When you say "security critical" are you thinking specifically of stuff like crypto timing attacks? I think aside from those sorts of concerns haskell is an excellent choice for security-critical code.
Re:Reflecting on Haskell in 2015 by thinkpad20 on Friday December 18, 2015 @03:52PM (#10760842)
"It's simply too alien for your typical CS grad"

That's just a question of teaching it to more CS students then. I don't think it's outside of the reach of the average programmer.

And yes you probably wouldn't use it to build real-time applications. But you probably wouldn't use Python to write an operating system. No language fits all use-cases.

Re:Reflecting on Haskell in 2015 by onesixtythree on Friday December 18, 2015 @12:48PM (#10759719)
I like Haskell but I see no future in terms of widespread adoption for it.

The aim isn't necessarily widespread adoption, so much as the ability for people who know it to use professionally. It's way past merely "production ready", but reputation is a lagging indicator and so most programmers are stuck doing Java...

Since the goal is to avoid {success at all costs}, getting 25% market share is probably not possible. 1 percent would be a start.

The problem, economically speaking, is that Haskell and Clojure engineers are massively underpaid, when you consider that an average Haskeller would be Principal+ at any Java shop. That's because the Java and C++ people can create bidding wars every year and spike their salaries, whereas using a better but more niche language makes that career strategy untenable.

Haskell's laziness isn't as much of an issue as people make it out to be. You can have strictness any time you need it, so it's more akin to an opt-out model than laziness being forced upon the programmer. It is correct to observe that high-performance applications frequently have a lot of strictness annotations, and the argument can be made that high-performance Haskell (while it can be close to C in performance) isn't "idiomatic"... although that claim is true of all high-level languages (even Java). High-performance Clojure ends up being full of '^' characters for type annotations, and high-performance Haskell ends up being full of '!' characters for strictness.

Re:Reflecting on Haskell in 2015 by saosebastiao on Friday December 18, 2015 @01:43PM (#10760093)
> The problem, economically speaking, is that Haskell and Clojure engineers are massively underpaid, when you consider that an average Haskeller would be Principal+ at any Java shop. That's because the Java and C++ people can create bidding wars every year and spike their salaries, whereas using a better but more niche language makes that career strategy untenable.

I haven't found the same to be true for other languages, but in my experience the Average Haskeller is so caught up in academic exercises, technical one-upmanship, and code golf shenanigans that I'm surprised they find any time to contribute any business value at all. Having a discussion about acceptable levels of technical debt with a Haskeller is like having a discussion about acceptable levels of meat products in your diet with a vegan in a world where there are no plant foods..."everything is technical debt, and none of it is acceptable, and we absolutely can't move on until we change all relevant functors to applicatives and all nested record accesses to lenses!"

And it is squarely a cultural issue, not a technical one...it is quite obvious that Haskell is a fantastically powerful language and capable of mowing over most enterprise-y languages with ease for a very wide variety of domains. Its just that Haskellers are so nitpicky about elegance and style that they don't know how to let shit be shit and get something done when it is needed.

This obviously isn't the only case for Haskellers. Looking at JGM's github feels like looking at Dumbledore's magic through the eyes of a Muggle. It just feels that way with the average Haskeller that I work with.

Re:Reflecting on Haskell in 2015 by mbrock on Saturday December 19, 2015 @07:18AM (#10763382)
I don't know who the average Haskeller is, but your description doesn't fit any of the engineers I worked with at Silk, who were all very pragmatic and got stuff done quickly.
Re:Reflecting on Haskell in 2015 by LukeHoersten on Friday December 18, 2015 @12:58PM (#10759782)
Great points. I can attest to the fact that low-latency Java code looks nothing like idiomatic Java. Ironically, the techniques for writing low latency Java are the same in Haskell (avoiding object creation, boxing, garbage collection, etc). High performance C and C++ are a league of their own with direct control over memory layout and alignment etc. Haskell has some amazing work on that front as well though: http://www.doc.ic.ac.uk/~dorchard/publ/icfp-2013-simd-vector...
Re:Reflecting on Haskell in 2015 by mmarx on Friday December 18, 2015 @01:01PM (#10759811)
> high-performance Haskell ends up being full of '!' characters for strictness.

The upcoming GHC 8 provides the Strict extensions which makes everything strict by default on a per-module level. That should greatly reduce the number of »!« characters.