Hacker News new | past | comments | ask | show | jobs | submit login

As others have mentioned, it's really a critique of their choice of Scheme rather than Miranda (a proto-Haskell).

As somebody who did most of the first chapter in both Haskell and Scheme, I think it's crazy for Wadler to not mention the downsides of a strict type system; it's listed only as a positive.

The main errors that I faced in writing my programs were type errors, where I knew what I wanted to do and spent upwards of several hours figuring out the magic incantations to convince the compiler to do what I wanted it to do. They were not type errors in the sense that the compiler was preventing me from making bugs, but rather type errors in the sense that I had to figure out a whole bunch of things about the type system in order to try and convince the compiler to accept my program.

There's a heavy cognitive load to programming in Haskell, and I hit many walls where I just had to Figure It Out™ before I could compile my programs.

(All this was as an experienced programmer. Maybe it would be easier for a newbie not used to dynamic languages!)




So you did first chapter of Scheme book in Haskell. Ie, in a language authors weren't prepared you for. And you get errors you're not expected as authors couldn't prepare you for them.

I think that's pretty straightforward thing that happened with you. The same will be with Scheme if you do some chapters from Learn You A Haskell.

Also, Haskell type system is one of most logical out there. Most type systems are either build around some weak logic with many exceptions (dynamic languages, C++, Java, C#), or just build from some limited number of cases (Ada, VHDL, Verilog).

The Haskell type system incorporates a logic system (some kind of constructive logic, I think). You actually learned that logic while "fighting the compiler" and you did some of first session with "proof assistant" which Haskell compiler/interpreter is.

So I think you're complaining for nothing.

Not that I stopping you, just my thoughts. ;)


I'm not trying to complain! I'm just saying that the type system is A Thing that people need to learn, and I think that a rigorous type system can be a hindrance to learners. As such, I think Wadler should have mentioned it as a possible downside of his hypothetical world where Abelson and Sussman used Miranda in SICP, even if only to debunk it.


"SICP in Miranda" would prepare reader for type system. So the reader of that imaginary version of SICP wouldn't encounter those roadblocks. And those who read Learn You A Haskell don't encounter ones.


I challenge both of those assertions. I haven't done LYAH, because I was learning haskell before it existed, but I did nearly every available haskell tutorial when I was learning.

As soon as you step out of bounds, you find strange corners of the type system. It's quite a complex beast, and many of the error messages are cryptic at best.


I had two colleagues who done LYAH and one who attacked a program with type level programming without LYAH (because of LYAH non-existense at the moment).

The first two didn't asked me or my colleague about anything type system related too often. After month or so of on-off work on his project one of them finished a complex translator from CPU description into VHDL.

The one who studied Haskell without LYAH did asked us. I attribute it to complexity of program he worked on.

My experience allows me to remain confirmed that proper exposure to Haskell type system greatly lessen associated burden.

I should note that we didn't encounter many errors in our Haskell code. Much less than in code in Java or C#.


An alternative solution: I'm thick! It's consistent with the evidence.


I'm curious about your thoughts about whether type errors really were a net negative. I spent a fair amount of time with Haskell and it certainly took a bit of time to get used to working with the type system (type inference is awesome, but it can also make for some mind-boggling errors). In particular, I wondered if your Haskell programs Just Worked after you were able to get them to compile?

The payback for grappling with the type system is usually confidence that your program will run without silly errors (though you can still make silly errors (hello, cut-and-paste)). I'm now spending a fair bit of time in Javascript/NodeJS and Python lands and I need lots of testing to make sure that my program won't experience some silly error sometime in the future (<- perhaps this means I'm not a good dev).


I have no idea! I was just solving SICP problems, so part of the issue for me was that, once the program worked, I was done.

I had to do the hard part, but not really gain the benefits of the type system.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: