S

Stephen Diehl

stephendiehl.com · Personal blog · on HN since 2013

Stephen Diehl, a London-based developer, writes about Haskell, compilers, LLVM, cryptocurrency criticism, and security.

What HN saysHN commenters link his essays calling crypto a scam as must-reads, and recommend his LLVM JIT compiler tutorial, though one found it outdated.
209HN people shared it
119linked it in comments
189stories submitted
13Kstory points
3 months agolast shared
2013people per year2026

Most-shared posts

  1. 1
    What I Wish I Knew When Learning Haskell
    42 people · 1.4K points · first shared 2013 · 143 comments on HN
  2. 2
  3. 3
    Implementing a JIT Compiled Language with Haskell and LLVM
    16 people · 458 points · first shared 2014 · 26 comments on HN
  4. 4
    Et Tu, Signal?
    7 people · 880 points · first shared 2021 · 443 comments on HN
  5. 5
    The Haskell Elephant in the Room
    7 people · 420 points · first shared 2020 · 329 comments on HN
  6. 6
    FPTs: Pure Fungibility on the Blockchain
    7 people · 29 points · first shared 2021 · discussion on HN
  7. 7
    Prism: An Impure Functional Language with Typed Effects
    6 people · 11 points · first shared 2026 · discussion on HN
  8. 8
    From Monads to Machine Code
    5 people · 359 points · first shared 2016 · 33 comments on HN
  9. 9
    The Joy and Agony of Haskell in Production
    5 people · 327 points · first shared 2016 · 92 comments on HN
  10. 10
    The Oncoming Ransomware Storm
    5 people · 108 points · first shared 2021 · 142 comments on HN
  11. 11
    The Case Against Crypto
    5 people · 60 points · first shared 2021 · 102 comments on HN
  12. 12
    The Handwavy Technobabble Nothingburger of Crypto
    4 people · 418 points · first shared 2021 · 680 comments on HN
  13. 13
    Near Future of Programming Languages [pdf]
    4 people · 388 points · first shared 2017 · 292 comments on HN
  14. 14
    The political case for a blanket cryptocurrency ban
    4 people · 264 points · first shared 2021 · 611 comments on HN
  15. 15
    Exotic Programming Ideas, Part 2: Term Rewriting
    4 people · 227 points · first shared 2020 · 55 comments on HN

What HN people wrote when they linked it

platz · 2014-06-17
I wish I knew what changed from the last time this was posted 2 months ago: https://news.ycombinator.com/item?id=7637278 Also I believe last time Stephen was surprised folks had gotten a hold of content on his "pre-prod" domain (e.g. http://dev.stephendiehl.com/), because he was still working on that post, before it was ready. I like points as much as the next person, but maybe "pre-release" content should not be posted to aggregreators like HN before they are "realeased" That said I'm excited he's continuing to update this series, it's helped a lot of people and there is a ton for me to learn still!
efnx · 2024-06-25
It will never be finished but Stephen Diehl’s “Write you a Haskell” is great. http://dev.stephendiehl.com/fun/
colesantiago · 2024-06-24
It is a scam. You should stay away from the 'crypto space' and blockchains, which do not offer anything of value to anyone. Some recommended reading: https://www.stephendiehl.com/blog/crypto-is-a-scam.html
mightyRodri · 2022-04-28
There is no baby. The technology does not solve technical problems that havent been solved better. The only thing bchains does is give ppl with a lot of money to become stakeholders, the possibility to comodify even more parts of the internet. Thats the only upside of the technology, scam ppl for their money. https://www.stephendiehl.com/blog/against-crypto.html https://web3isgoinggreat.com/
pyrale · 2021-06-26
There is no real focus on theory in the language itself, but a significant part of the community, indeed, enjoys it. For balance, here's another common opinion about tutorials: http://dev.stephendiehl.com/hask/#eightfold-path-to-monad-satori > [...] > Read the monad definitions. > Use monads in real code. > Don’t write monad-analogy tutorials. In the end, the two opinions about learning monads coexist, and people have done fine following either way.
siraben · 2021-06-05
This is amazing. I tried following Stephen Diehl's JIT compiler in LLVM tutorial[0] a few years ago but it was already outdated (the llvm-hs library changed quite a bit), and subsequent web searches didn't turn up much. For those interested in tutorials like this, I'd also recommend a very literate Haskell compiler for the PCF language to C[1], which is essentially lambda calculus with some primitives and pattern matching. It details a number of transformations such as closure conversion and lambda lifting. [0] https://www.stephendiehl.com/llvm/ [1] https://github.com/jozefg/pcf/
edouard-harris · 2021-03-31
> This is America Note that the author of the post is based in London, UK: https://www.stephendiehl.com/
dgellow · 2021-02-09
In case you're looking for a resource to learn more about Haskell, I would highly recommend http://dev.stephendiehl.com/hask/. I started recently to learn the language and tooling and found this guide randomly on Twitter, and it's by far the best codex of knowledge on the language I've seen so far. No bullshit, straight to the point, everything in one page (so easy to Ctrl-F around).
david927 · 2021-01-25
This is the follow-up reading: http://dev.stephendiehl.com/nearfuture.pdf
lambda_obrien · 2020-12-05
I'm really enjoying this series, mostly because it's by the same person responsible for the best Haskell reference ever, in my opinion: http://dev.stephendiehl.com/hask/index.html
baron_harkonnen · 2020-12-03
I recommend you read some of Stephen Deihl's thoughts on the subject[0]. You're not alone if you feel that cryptocurrency doesn't make sense as an investment vehicle, but the HN community will make you feel crazy for not seeing what a great thinking this is an incredible new opportunity and "things are different this time!" There is no better indication of a bubble then people telling you that you're the crazy one for questioning it. I remember people telling me I was crazy for not buying a house in 2007, and crazy for not trading tech stocks in 1999. [0] https://www.stephendiehl.com/posts/crypto.html
DylanSp · 2020-10-05
Always cool to see people experimenting with languages! I'm doing a similar thing with wheel-lang [0], which started as pretty purely imperative, but is starting to grow some object-oriented features. Nystrom's Crafting Interpreters is a great resource; I've also liked Compiling to Assembly From Scratch [1] and Write You a Haskell [2]. [0] https://github.com/DylanSp/wheel-lang/ [1] https://keleshev.com/compiling-to-assembly-from-scratch/ [2] http://dev.stephendiehl.com/fun/
the_af · 2020-07-30
I knew Stephen Diehl rang a bell! He is the author of this very useful primer on tools & basics of the Haskell dev environment: "What I Wish I Knew When Learning Haskell"(http://dev.stephendiehl.com/hask/). I recommend it as a practical overview, though of course it doesn't replace actually learning Haskell.
wespiser_2018 · 2020-03-17
One of the things I love Haskell for, and there are many reasons, is that it's great at building compilers and interpreters. Monadic transformers for effects, pattern matching in functions, strong types, polymorphic typeclasses, the list goes on and on. Finally, if anyone is interested in building something like this, there is a great tutorial that, which I believe the author used but am not sure: http://www.stephendiehl.com/llvm/
chungus · 2019-10-03
tldr: I am NEVER nervous about refactoring some Haskell code. Good: After working in a variety of organizations using, typed but also dynamic languages I'm now writing all my back-end code in Haskell. I'm becoming more and more convinced that for multi-year, multi-programmer applications (a language like) Haskell is the only way to make it sustainable, while still being able to add features. Stephen Diehl has a great writeup on "what he wish he knew when he was learning haskell" http://dev.stephendiehl.com/hask/ It's difficult to say to someone "Just go read books for a couple of months because you need to understand purity, laziness, cross compilation, monad transformers (go read The Book of Monads), 20+ language pragmas. etc etc" It does however feel like I'm learning useful stuff, and it's a lot of fun to get an executable that runs FAST.
almostdeadguy · 2018-08-22
Easily the best one IMO: http://haskellbook.com/ . Unlike LYAH it covers stuff that is actually important to writing real haskell programs like testing code, managing effects via monad transformers, etc. Also this is one of the best references while you're learning (not good as a tutorial, but chock full of invaluable resources): http://dev.stephendiehl.com/hask/ . TBH I wish every language had an equivalent of this guide.
seagreen · 2017-03-26
> My early OOP/C++ books are finally more intuitive than something. Ouch! But seriously, this page is just a someone's jotted out notes. Haskell Programming from First Principles and What I Wish I Knew When Learning Haskell (http://dev.stephendiehl.com/hask/) are the actual pinnacle of Haskell explanations. They have plenty of great examples.
evincarofautumn · 2017-01-08
Yeah, I’ve found Haskell a pleasure to work with for writing compilers. There’s no single thing, just a combination of language features and libraries. The bulk of a compiler is transforming trees of stuff, which Haskell makes very easy, and it nudges you pretty strongly in the direction of making code testable and refactorable. I don’t have any particular recommendations. Mostly I’ve just been figuring things out as I go along, reading papers and asking for help. I’d written compilers & interpreters before, but got into using Haskell for it with Write Yourself a Scheme[1]. I’ve also heard good things about Implementing a JIT Compiled Language with Haskell and LLVM[2]. [1]: https://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours [2]: http://www.stephendiehl.com/llvm/
bootload · 2016-02-22
A great comparison to the above article is this post by Stephen Diehl, "Reflecting on Haskell in 2015". [0] A great read and an interesting pointer on the state of Haskell / Javascript (Elm, Purescript). Also, work your way through "Write you a Haskell", [1] well worth the effort. Going through the post, this looks like a comprehensive book. Read the rationale behind, 'how to learn Haskell' from author. [2] [0] "Reflecting on Haskell in 2015" http://www.stephendiehl.com/posts/haskell_2016.html [1] "Building a modern functional compiler from first principles." http://dev.stephendiehl.com/fun/index.html [2] "Why we don't chuck our readers into web apps" http://bitemyapp.com/posts/2015-08-23-why-we-dont-chuck-readers-into-w…
ch0wn · 2015-01-22
Stephen Diehl continues to blow my mind on a regular basis. His latest work in progress "Wrote You a Haskell"[0] is also worth keeping an eye on. I've worked through the first couple of chapters and it's fantastic. [0] http://dev.stephendiehl.com/fun/
kachnuv_ocasek · 2015-01-05
As a sidenote, Stephen is also the author/maintainer of "What I Wish I Knew When I Was Learning Haskell"[0] which is a great resource both for those who are learning and for slightly advanced programmers. [0] http://dev.stephendiehl.com/hask/
So I don't really consider myself a Haskell programmer, but the standard advice is to think about operation you are going to perform on those strings and numbers later, then think if there is a datatype you could create instead. As an example, suppose I am trying to load a csv file with two fields being strings and one being Double. A list of lists representation isn't going to cut it. Instead I should make a Row datatype data Row = Row {field1 :: String, field2 :: String, field3 :: Double} Then you can parse the csv file into a [Row] representation. As an aside, if the task did involve parsing csv I suggest the cassava library which I found out about through the amazing What I Wish I Knew When Learning Haskell (http://dev.stephendiehl.com/hask/)
rwosync · 2014-03-25
Lots of great Haskell material on his site. In particular this derivation of the State monad from first principles was the "Aha!" moment for me understanding monads. http://dev.stephendiehl.com/begin/index.html#monads
mutagen · 2014-03-17
I'm curious about this as well so I did some searching. Fay[1], a subset of Haskell that compiles to JavaScript, seems to be the primary choice. There are DOM and jquery bindings for it and this blog post[2] looks like a great introduction. There are other options, this [3] article outlines a number of them as a greater overview of both server and client side programming with Haskell. I also found an intriguing article [4] on the Haskell site but it appears to be out of date, referencing libraries that are no longer in development. [1]https://github.com/faylang/fay/wiki [2]http://ocharles.org.uk/blog/posts/2013-12-23-24-days-of-hackage-fay.ht… [3]http://www.stephendiehl.com/posts/haskell_web.html [4]http://www.haskell.org/haskellwiki/Haskell_in_web_browser
jefftchan · 2013-07-11
(off-topic) Love the contact page [1] of this website. What are some other effective filters? [1] http://www.stephendiehl.com/pages/hire.html
rvz · 2022-07-15
Precisely said. > It seems like some people, just because they are smart in one area, think they know everything. We see this with many VCs, Elon Musk, Vitalik etc. Totally correct. Elon's wild claims on solving FSD (Fools Self Driving) seemed to be a total disaster, and Vitalik's claims on his decentralized slot machine utopia 'Ethereum' on how using a generalized blockchain to solve 'anything' from voting, social networks, DAOs, NFTs, etc has manifested into a tinkerbell griftopia [0] as feared by even the most fierce critics of blockchains. Finally, VCs really don't care on being wrong on thousands of failed investments. They just need one massive return to make up for all of it hundreds of times over and somehow they are viewed as 'experts' which is a great example of the Texas sharpshooter fallacy. We don't hear them screaming about Clubhouse which was hyped to the extreme since it is isn't doing great as expected after being copied to death. Also reading this article in particular, it is gearing close to sophistry. [0] https://www.stephendiehl.com/blog/tinkerbell.html
igammarays · 2021-12-22
What blockchains solve is the whole pesky problem of following the law and paying taxes, and being a normal member of society. No wonder that much of the early crypto literature was all about anarchy. To this day, the only useful thing that crypto has enabled (on a very small scale) international asset transfer that bypasses mainstream financial systems. As Diehl[1] wrote, decentralized trustless systems are only useful to criminals -- every other social system on the planet has "trust" embedded in it, because that is more efficient, socially constructive, and powerful. Oh, and crypto isn't actually decentralized or trustless either, as you still need to trust the developers that wrote the code, and the people that run your exchanges, because otherwise you will get robbed by them, as it happens on a regular basis in the crypto world. [1] https://www.stephendiehl.com/blog/nothing-burger.html
Zababa · 2021-11-16
I liked the Haskell content on his blog, I'm not sure about his new political line against crypto. This started a bit more than a year ago with this post https://www.stephendiehl.com/posts/crypto.html, which ends on a bizarre claim about a link between crypto and right-wing extremism: > David Golumbia’s excellent book The Politics of Bitcoin: Software as Right-Wing Extremism outlines the rabbit-hole effect that this ecosystem is having on software engineers onboarding them into deeper forms of right-wing extremism. This is not crypto-specific, I'd rather read software blogs than political blogs in general. In the spirit of Drew DeVault (https://drewdevault.com/2021/04/26/Cryptocurrency-is-a-disaster.html), I'll disclose my stake in cryptocurrency: I currently own ~1000€ in Bitcoin, that I bought for something like 800€ earlier in the year. Those ~200€ are the only profit I made on crypto. I use Monero from time to time for stuff where Monero is useful.
meowface · 2021-05-11
I'm not an unequivocal fan of cryptocurrencies or any particular cryptocurrency by any means, but it appears this author really hates cryptocurrency and this is just an opportunity for them to argue that governments should ban cryptocurrency. Which is completely understandable and obviously in good faith given ransomware is bad and they think cryptocurrencies are bad, but I just wanted to point out their stance and that this is an anti-cryptocurrency blog rather than a security/tech blog. Every blog post they've ever published is about why they think cryptocurrency is awful: https://www.stephendiehl.com/blog.html >The Oncoming Ransomware Storm - May 11, 2021 >Et tu, Signal? - April 7, 2021 >The Political Case for a Blanket Cryptocurrency Ban - March 30, 2021 >Bitcoin: The Postmodern Ponzi - February 27, 2021 >The Crypto Chernobyl - February 10, 2021 >Gamestop, Bitcoin and the Commoditization of Populist Rage - February 3, 2021 >Facebook Libra is Architecturally Unsound - November 2, 2019 I think they make many valid criticisms, but they remind me of the inverse of the standard Bitcoin maximalist. It seems there are a lot of people who think Bitcoin or Ethereum or something else should become the universal currency of the world and is the best and most innovative thing ever, and a lot of other people who think they should all be made illegal and are the worst thing ever. Also somewhat reminiscent of pg's fanboy/hater dichotomy: http://www.paulgraham.com/fh.html

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close