Top all-time · #2493
Things that amuse me
Personal blog · augustss.blogspot.comprogramming
Things that amuse me is a personal blog at augustss.blogspot.com about programming. Since 2009, 31 different Hacker News readers have linked it 38 times, most often “More points for laziness”. The last post was in 2014, but the archive is still widely read.
Too few sampled comments (29) to say how often HN recommends it.?
Why HN links it
HN readers link Lennart Augustsson's blog for its writing on lazy evaluation in Haskell, quicksort in Haskell, and BASIC implemented as Haskell DSLs. Most comments cite it as a source rather than discuss it.
Summarised by Claude from a sample of 29 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
Most-linked posts?
- More points for laziness7 people · 8 mentions · first linked 2011-05-02
- /2009/02/more-basic-not-that-anybody-should-care.html4 people · 4 mentions · first linked 2012-01-26
- /2007/08/quicksort-in-haskell-quicksort-is.html4 people · 4 mentions · first linked 2011-06-04
- More points for lazy evaluation (2011)4 people · 4 mentions · first linked 2017-10-13
- Using LLVM to generate fast machine code from Haskell3 people · 3 mentions · first linked 2009-01-07
- Simpler, Easier (2007)2 people · 2 mentions · first linked 2015-01-31
- Haskell for Basic (circa 1978) fans2 people · 2 mentions · first linked 2009-02-07
What Hacker News says?
The IO monad is just an action. Its a cons pair with a left and a right half. In an imperative language you could model the left half with a closure that takes no arguments, does I/O and produces a value. The right half is usually empty, except when you use the `>>=` operator (or flatMap) on an existing action, e.g. let c = a >>= f That operator chains the function `f` can take the value produced by the first IO act…
Comment linking /2009/02/more-basic-not-that-anybody-should-care.html
on “Microsoft takes .NET open source and cross-platform”Submitted BASIC as a Haskell DSL (2009) as a story · 58 points
HN discussionEh, I'm pretty sure that suffers from the problem noted here: https://news.ycombinator.com/item?id=13375108 See the "genuine sieve of eratosthenes" paper, and also: http://augustss.blogspot.com/2007/08/quicksort-in-haskell-qu...
Comment linking /2007/08/quicksort-in-haskell-quicksort-is.html
on “Esoteric programming paradigms”Submitted Simpler, Easier (2007) as a story · 10 points
HN discussionAha, yes! You are right. But then so does strictness. See https://augustss.blogspot.com/2011/05/more-points-for-lazy-e... for some examples. Laziness is a definitely a double-edged sword, with sharp edges.
Comment linking /2011/05/more-points-for-lazy-evaluation-in.html
on “Learning Haskell is no harder than learning any other programming language”Submitted Haskell for Basic (circa 1978) fans as a story · 10 points
HN discussionSure the entire input list will need to be consumed, but not every element of the output will need to be determined if we are only taking the top 10. Laziness enables many compositions to work efficiently, whereas with a strict language, you'd have to fuse the operations to get the same efficiency. More examples here: http://augustss.blogspot.com/2011/05/more-points-for-lazy-ev...
Comment linking /2011/05/more-points-for-lazy-evaluation-in.html?m=1
on “Haskell Fan Site”Submitted Using LLVM to generate fast machine code from Haskell as a story · 9 points
HN discussionLennart Augustsson once wrote the least-Haskell Haskell program, amazingly without the help of a preprocessor: https://augustss.blogspot.com/2009/02/regression-they-say-th... And to answer the question in the top comment: https://hackage.haskell.org/package/BASIC-0.1.5.0/docs/Langu...
Comment linking /2009/02/regression-they-say-that-as-you-get.html
on “I wrote the least-C C program I could”Submitted More points for laziness as a story · 7 points
HN discussionThis is an interesting question. As much more of a Haskeller than an MLer I don't tend to feel the "need" to structure my programs explicitly modularly, and when I do I sort of instinctively use a combination of typeclasses and polymorphic higher-order functions to do so. More basically, just think "everywhere I would open a module, instead I can take a parameterized record of functions" (and furthermore, if a datat…
Comment linking /2008_12_01_archive.html
on “Show HN: Learn Functional Programming Using Haskell”Submitted Ugly Memoization as a story · 6 points
HN discussionWhen is quicksort not quicksort? When it's not in-place: http://augustss.blogspot.com/2007/08/quicksort-in-haskell-qu... I love me some Haskell, but this particular example is kind of a bait-and-switch.
Comment linking /2007/08/quicksort-in-haskell-quicksort-is.html
on “Java Doesn’t Suck”Submitted It's time for some more Haskell opinions as a story · 4 points
HN discussionThis is a great writeup, and I just want to offer a counterpoint regarding the eager vs. lazy trade-offs. I found this article really helpful for explaining why laziness is important: http://augustss.blogspot.com/2011/05/more-points-for-lazy-ev... In particular, scroll down to the "Reuse" section. Lazy evaluation enables you to compose functions to build new functions with the right performance characteristics (cons…
Comment linking /2011/05/more-points-for-lazy-evaluation-in.html
on “PureScript and Haskell”Submitted More points for lazy evaluation (2011) as a story · 1 points
HN discussionSure :) First, i have to say i feel your pain. Writing a compiler is hard. If there's anything left you don't understand, this project will be punishing. Just know that at the end of the semester, there is absolutely no magic left. Your mental model of computation will be spectacular. Hang in there. There are a couple of things. First, haskell lets you build up the language incrementally. So if your parse tree is li…
Comment linking /2009/01/llvm-llvm-low-level-virtual-machine-is.html
on “A Taste of Haskell”It's easy to forgot the benefits of laziness: http://augustss.blogspot.com/2011/05/more-points-for-lazy-ev... Laziness is a good default for declarative programming. Nix from NixOS is an example of a recent lazy language and benefits greatly from it. Even in strict languages, lazy behaviour is often added, for example iterators and streams. Mixing effects and mutation with such constructs is also problematic.
Comment linking /2011/05/more-points-for-lazy-evaluation-in.html?m=1
on “A whirlwind tour of object-oriented code in F# (2012)”If you know Haskell, or are willing to learn, this is a brilliant explanation with code (you build a dependently typed language as you go). It ramps you up very fast yet each step is accessible. This alone really caused me to get bit by the dependent type bug. https://augustss.blogspot.com/2007/10/simpler-easier-in-rece... Here is the example code from this post https://github.com/scott-fleischman/simpler-easier?fil…
Comment linking /2007/10/simpler-easier-in-recent-paper-simply.html?m=1
on “Learn Coq in Y Minutes”Hold on: does Haskell allow "the" QuickSort on one line, or just a sort? Because from what I've read, if you want to make Haskell do all the efficient stuff in a QS, you have to tell it a lot more, bloating the program. Edit: this is what I had in mind: http://augustss.blogspot.com/2007/08/quicksort-in-haskell-qu... Btw, I took AP Compsci with C++ in Austin around that time, so we might know each other.
Comment linking /2007/08/quicksort-in-haskell-quicksort-is.html
on “Dijkstra on Haskell and Java (2001)”I don't know about Scala, but somebody did embed basic into Haskell: http://hackage.haskell.org/packages/archive/BASIC/0.1.5.0/do... However, it's at least partly taking advantage of the fact that normal Haskell actually looks (in shape, anyhow) vaguely like basic as is. At the very least, Haskell doesn't force you to use parenthesis or braces everywhere. Here's an example: http://augustss.blogspot.com/2009/02/is-ha…
Comment linking /2009/02/is-haskell-fast-lets-do-simple.html
on “Lisp is Too Powerful”Haskell is also very simple--not from an implementation standpoint but from a semantics standpoint. Having polymorphism with no sub-typing (and no casting) is conceptually simple and easy to work with. Parametric polymorphism (like Java's generics but simpler and less horrible) is actually an extremely simple concept. The difficulty comes from a) implementing it in a stupid way after the fact ( cough Java) or b) hav…
Comment linking /2007/08/programming-in-c-ummm-haskell-heres.html
on “Why Haskell Is Worth Learning”Lennart Augustsson implemented a JIT for BASIC as an EDSL in Haskell using LLVM. A blog post he wrote about it: http://augustss.blogspot.com/2009/02/more-basic-not-that-any... The JIT itself: https://hackage.haskell.org/package/BASIC
Comment linking /2009/02/more-basic-not-that-anybody-should-care.html
on “A Basic Just-In-Time Compiler (2015)”I notice that Haskell has LLVM bindings, and Parsec makes writing parsers remarkably non-painful. http://augustss.blogspot.com/2009/01/llvm-llvm-low-level-vir...
Comment linking /2009/01/llvm-llvm-low-level-virtual-machine-is.html
on “Writing Your Own Toy Compiler Using Flex, Bison and LLVM”Laziness (or, properly, non-strictness) enables a radically different style of programming, and combined with functional purity, also enables kinds of code transformation that are not valid in strict, effectful languages [1]. Almost any dynamic programming algorithm is trivial in Haskell, c.f. packrat parsing, which is embarrassingly easy to implement using a table of lazy values, and you can also trivially write co…
Comment linking /2011/05/more-points-for-lazy-evaluation-in.html
on “Dialects of Lisp”Well, I already mentioned the Module system part. Good point on the Formal definition compromise. But I think laziness-by-default has some fundamental advantages that SML pretty much loses: http://augustss.blogspot.com/2011/05/more-points-for-lazy-ev...
Comment linking /2011/05/more-points-for-lazy-evaluation-in.html
on “The Rise of "Worse is Better"”This is not a direct response to the question of how laziness obviates the need for macros, but it mentions some specific relevant cases: https://augustss.blogspot.com/2011/05/more-points-for-lazy-e...
Comment linking /2011/05/more-points-for-lazy-evaluation-in.html
on “Liskell – Haskell Semantics with Lisp Syntax [pdf]”Haskell is the only widely used language that uses lazy evaluation by default. This has historically lead to confusion and difficulties with reasoning about time and space, particularly when a programmer is coming from a strict language. Why do we care about laziness by default? Like purity, it adds power and expressiveness. ---- Finally, what would a strict Haskell be like? Here's a discussion: http://augustss.blog…
Comment linking /2011/05/more-points-for-lazy-evaluation-in.html
on “Hashtables, a new Haskell library for fast mutable hash tables”That reminds me of this blog [1] which is a BASIC! No, it's a Haskell too [2]! [1] https://augustss.blogspot.com/2009/02/more-basic-not-that-an... [2] https://hackage.haskell.org/package/BASIC
Comment linking /2009/02/more-basic-not-that-anybody-should-care.html
on “Dogelang – A Python with Haskell Syntax (2020)”http://augustss.blogspot.com/2011/05/more-points-for-lazy-ev... is a very good discussion of why laziness has some nice semantic properties from the theory point of view. And the post it is responding to, https://existentialtype.wordpress.com/2011/04/24/the-real-po... makes some interesting points against it as well.
Comment linking /2011/05/more-points-for-lazy-evaluation-in.html
on “How is lazy evaluation in Haskell useful?”