Michael Snoyman
snoyman.com · Personal blog · on HN since 2010
Michael Snoyman, a Haskell and Rust developer, writes about Haskell's strengths and weaknesses, practical software engineering, and Rust.
What HN saysHN links it for his Haskell critiques and his Rust crash course, which one commenter highly recommends; others discuss resource cleanup and Haskell's warts.
52HN people shared it
15linked it in comments
45stories submitted
1.0Kstory points
2 years agolast shared
2010people per year2026
Most-shared posts
- 1Boring Haskell Manifesto7 people · 16 points · first shared 2019 · discussion on HN
- 2Haskell: The Bad Parts5 people · 12 points · first shared 2020 · discussion on HN
- 3Introducing the Rust crash course4 people · 6 points · first shared 2018 · 1 comments on HN
- 4What Makes Haskell Unique3 people · 4 points · first shared 2017 · discussion on HN
- 5Haskell: The Bad Parts, part 2 (2020)2 people · 262 points · first shared 2020 · 170 comments on HN
- 6Open Letter to XSLT Fans2 people · 107 points · first shared 2012 · 66 comments on HN
- 7Haskell Success Stories2 people · 6 points · first shared 2017 · 1 comments on HN
- 8Haskell: The Bad Parts, part 32 people · 6 points · first shared 2021 · discussion on HN
- 9My Best and Worst Deadlock in Rust2 people · 5 points · first shared 2024 · 2 comments on HN
- 10Rust RAII is better than the Haskell bracket pattern1 people · 238 points · first shared 2018 · 152 comments on HN
- 11How to get an open source community to be interested in helping you1 people · 140 points · first shared 2017 · 45 comments on HN
- 12Haskell's Missing Concurrency Basics (2016)1 people · 114 points · first shared 2018 · 26 comments on HN
- 13Stack(age): History, philosophy, and future1 people · 30 points · first shared 2018 · 1 comments on HN
- 14Why I lift1 people · 11 points · first shared 2017 · 6 comments on HN
- 15Hello Nostr1 people · 6 points · first shared 2024 · discussion on HN
What HN people wrote when they linked it
hardwaresofton · 2018-10-09
tl;dr - Try rust.
The mechanic point of this article is pretty clear:
- it's possible to be unsafe in both Haskell and Rust when dealing with resource cleanup
- Rust does a bit of a better job in the general case though it has it's own warts (see the other comments, it's hard to deal with issues during `drop`-triggered cleanup)
I want to make a muddier meta point -- Rust is the best systems language to date (does anyone know a better one I can look at?).
- The person who wrote this article Michael Snoyman[0] is mainly a haskell developer, he's the lead developer behind arguably the most popular web framework, yesod[1].
- Haskell developers generally have a higher standard for type systems, and spend a lot of time (whether they should or not) thinking about correctness due to the pro-activity of the compiler.
- These are the kind of people you want trying to use/enjoy your language, if only because they will create/disseminate patterns/insight that make programming safer and easier for everyone down the line -- research languages (Haskell is actually probably tied for the least "researchy" these days in the ML camp) are the Mercedes Benz's of the programming world -- the safety features trickle down from there.
- Rust is not a ML family language -- it's a systems language
- People who write Haskell on a daily basis are finding their way to rust, because it has a pretty great type system
When was the last time you saw a systems language with a type system so good…
xwowsersx · 2020-01-29
I highly, highly recommend this crash course from Michael Snoyman: https://www.snoyman.com/blog/2018/10/introducing-rust-crash-course
antonvs · 2022-04-27
> Makes me wonder how much of a programming language can be hotswappable.
For a research language that can make a lot of sense, not so much for a language to be used in industry.
The downside is that different libraries will have different string representations, so you can end up being forced to do a lot of conversion if you're using different libraries that have made different choices from each other, or from your own code.
There are at least 5 commonly used string types - String (linked list of Char), ByteString lazy & strict, and Text lazy and strict. The latter two have a good rationale for being different - byte strings are not necessarily text - but, for various reasons, they're often used to represent text anyway.
These five also have corresponding `readFile` functions - see https://www.snoyman.com/blog/2016/12/beware-of-readfile/ . As Snoyman recommends in that post, it's probably best to "Stick with Data.ByteString.readFile for known-small data, use a streaming package (e.g, conduit) if your choice for large data, and handle the character encoding yourself. And apply this to writeFile and other file-related functions as well."
The first comment on that post starts out with "This problem extends well beyond readFile." Having the string handling more standardized at the language level can make life quite a bit simpler for developers.
_huayra_ · 2021-03-01
It's a great language to learn as a gateway for language design, but I think what turns people off are unrealistic expectations.
Haskell has warts, as do all languages. Something that's tedious in one language might be a breeze in another. In Haskell, most of the baggage I've seen is around
- Cabal: seems the best advice is to just start with Stack
- Delayed exceptions: due to lazy evaluation (which is a really great feature once you get used to it!), the site where you trigger an exception may not be anywhere near the actual exception-generating site. For example, if you call head on an empty list, then return that as a result only to have it be used far later, it will go "boom" at some later time. This is also true for I/O things: perhaps the file I/O way deep down in some thunk was closed due to an error, so some code that is not equipped to handle errors gets an exception.
Michael Snoyman has a great series of blog posts about this [0], i.e. "Haskell the Bad Parts 1-3". Most of this is managed by not using some of the defaults or with practice. Just be aware that like any language, there will be areas that may not have the greatest behavior.
That said, I think these confusing behaviors are very limited in Haskell, much more so than in C++ for instance.
[0] https://www.snoyman.com/blog/
sshine · 2023-08-05
Haskell has WAI, which is similar to WSGI:
https://www.snoyman.com/reveal/first-app-wai-warp
matijash · 2022-02-08
Wow, this thread really exploded! My 2 cents on Haskell, since we're building https://wasp-lang.dev/ in it and also just hired several founding engineers:
- we're sticking with the "Boring Haskell" manifesto(https://www.snoyman.com/blog/2019/11/boring-haskell-manifesto/) - using only the widely adopted compiler plugins and not going too crazy with the monad transformer stack, which keeps the code easy for others to contribute to.
- we've hired 2 founding engineers so far - none of them knew Haskell beforehand! But they were both senior engs well versed in different languages and I was surprised with how quickly they picked it up - within the first month they are at 90% productivity.
tome · 2021-08-06
headbee · 2021-02-09
Definitely check out the part one of "Haskell: The Bad Parts" which is more relevant to the beginner to average Haskeller: https://www.snoyman.com/blog/2020/10/haskell-bad-parts-1/
nobleach · 2021-01-02
Link for those interested: https://www.snoyman.com/blog/2018/10/introducing-rust-crash-course
ivanbakel · 2020-12-28
Previous discussion on the Foundation: https://news.ycombinator.com/item?id=24988454
Also relevant if you read through those comments, and the discussion they include on FP Complete's involvement, is Michael Snoyman's more recent statement: https://www.snoyman.com/blog/2020/12/haskell-foundation
I think Snoyman makes a few good points - namely, it remains to be seen exactly what the Foundation can and will do, and what input the community is going to have in that process. While the criticism that was once made of Facebook/IOHK/FPC applies here (namely, that a large enough force will trump Haskellers who invest in the community), the Foundation has all the power to be much worse. The academic side of the language still carries the most weight.
sullyj3 · 2020-04-12
It's definitely possible to write "boring Haskell". getting fancy is more of a cultural tendency than a necessity when building things with Haskell.
https://www.snoyman.com/blog/2019/11/boring-haskell-manifesto
VMG · 2014-12-06
Since it is the hot topic of the day, let me add this perspective: http://www.snoyman.com/blog/2012/04/xslt-rant.html
Quote
> I'm not even talking about the hideously verbose syntax, or the completely obtuse data model. The fact that you can't know what any single line of code does without reviewing every other line in the program makes this language an abomination.
lucasdicioccio · 2019-10-06
This comment misses the point of the article, which argues against a urban legend that Haskell is too difficult "unless you are this tall" (a Phd, an E.T., a superhuman). I also had a shot at explaining why people are already tall enough in a past short "comic strip" [0]. I think the article makes a good job re-assuring the urban legends are a myth.
Now. there are many reasons why one would want to use Haskell. For instance, to have fun, to understand better some pattern, to write expanding-brain memes, or, because they are good at solving problems with it. It is fine if your reasons do not intersect with other people's reasons. You can try finding answers whether Haskell matches your reasons in some other essays [1,2,3]. Maybe it is true for many people that their needs and desires are entirely covered with their own toolset. As a curious/optimistic person I find it incredibly pedant to say I'll never ever need to learn/use something (there's different goodness in everything).
Personally, practicing Haskell led me to appreciate the importance and trade-offs that occur when isolating/interleaving side-effects. Similarly, it gave me some vocabulary to articulate my thoughts about properties of systems. Both are super important in the large when you architect softwares and systems. There are other ways to learn that (e.g., a collection of specialized languages), but at least for me, Haskell helped me build an intuition around these topics. That said, the prevalence of…
yakshaving_jgt · 2019-10-03
From the example you gave, it seems like we're talking past each other.
The systems I write also have to deal with JSON with nullable fields, and with fields I ignore while parsing. Aeson for instance gives you complete control over how strict or lenient you wish to be when trying to parse data.
The idea I was trying to convey was that if you care about marshalling data into types a la Haskell, then you can code less defensively when writing code for the data you actually care about. You do that defensive validation in just one place, as opposed to sprinkling nil checks all throughout your system.
If I'm understanding your system correctly, it sounds like you have unreliable input, and you want the same output, only with some of the fields updated if they're there. Haskell readily lets you do this too. The lens-aeson library is perfect for this.
Lots of examples for that here: https://www.snoyman.com/blog/2017/05/playing-with-lens-aeson
Also, I am not sure how you differentiate between a null value and no value, but whatever mechanism you're using you could also use to model those two different types of null as actual types in Haskell.
> Oh, that would be wonderful. I dream to live in that world. But that doesn't seem to be the reality I occupy.
It's hard[er] to discern tone through the medium of text, but it sounds like you're suggesting Haskellers live in some fantasy world where all the data is perfect and everything is pure.
I don't really understand that…