Top all-time · #3514
Gergo Erdi
Personal blog · gergo.erdi.hu/blog · on HN as gergoerdihardwareprogramming
Gergo Erdi writes Gergő.Érdi.hu, a personal blog at gergo.erdi.hu about hardware and programming. Since 2011, 22 different Hacker News readers have linked it 38 times, most often “MetaFun: Compile Haskell-like code to C++ template metaprograms”. The last post was in 2024, but the archive is still widely read.
Too few sampled comments (13) to say how often HN recommends it.?
Why HN links it
HN readers mostly cite Gergo Erdi's posts on Haskell and functional programming, such as the applicative functors static analysis post, and his metafun and Clash retrocomputing projects.
Summarised by Claude from a sample of 13 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
Most-linked posts?
- MetaFun: Compile Haskell-like code to C++ template metaprograms4 people · 6 mentions · first linked 2014-03-20
- MetaFun: Compile Haskell-like code to C++ template metaprograms4 people · 4 mentions · first linked 2016-02-05
- /blog/2012-12-01-static_analysis_with_applicatives/3 people · 5 mentions · first linked 2013-01-30
- Rust on the MOS 6502: Beyond Fibonacci2 people · 2 mentions · first linked 2021-09-19
- Developing iPhone applications in Haskell2 people · 2 mentions · first linked 2011-02-14
- Compiling Brainfuck to the MMU Turing tarpit via a MOVDBZ machine2 people · 2 mentions · first linked 2013-10-05
What Hacker News says?
Pong is one of the sample chapters for the "Retrocomputing with Clash" book ( https://gergo.erdi.hu/retroclash/ ). Clash is a hardware description DSL using Haskell, and the book is all about using it to implement progressively more complex 1970s chips.
Comment linking /retroclash/
on “Original Pong did not have any code or even a microprocessor”Submitted Rust on the MOS 6502: Beyond Fibonacci as a story · 165 points
HN discussionIn my experience [building my own Commodore PET on an FPGA]( https://gergo.erdi.hu/blog/2015-03-02-initial_version_of_my_... ), the PET would be a very promising candidate for using this as a plug-in replacement, since the (text-only) video subsystem can be fully isolated from the CPU with just dual-port video RAM between the two sides (and a 60Hz spike from the video side to the CPU IRQ leg).
Comment linking /blog/2015-03-02-initial_version_of_my_commodore_pet/
on “The MOnSter 6502”Submitted Write Yourself a Haskell in Lisp as a story · 129 points
HN discussionYou can determine a lot more about a computation described only in terms of an applicative functor as you can from a monadic one, without running any of its effects (i.e. "statically"). It's easy to see why when you consider the opaqueness of the function in the right-hand side of a bind. Check out http://gergo.erdi.hu/blog/2012-12-01-static_analysis_with_ap... for an example.
Comment linking /blog/2012-12-01-static_analysis_with_applicatives/
on “Haskell in the Large [pdf]”Submitted A Brainfuck CPU in FPGA as a story · 61 points
HN discussion> Of course, the solution is is some combination of: And as always in Haskell: more type trickery. Like lenses, which help with the splitting. Applicative functors might help with "Have functions return a description of updates to the world-state [...]" for free in a sense similar to http://gergo.erdi.hu/blog/2012-12-01-static_analysis_with_ap...
Comment linking /blog/2012-12-01-static_analysis_with_applicatives/
on “Functional thinking: Why functional programming is on the rise”Submitted Compiling Brainfuck to the MMU Turing tarpit via a MOVDBZ machine as a story · 6 points
HN discussionOne drawback of the Hindley-Milner type system is that its typecheckers are necessarily non-compositional. The basic idea here is that this can result in "non-symmetrical" error messages[1]: given something like MkPair :: a -> b -> Pair a b not :: Bool -> Bool succ :: Int -> Int foo x = MkPair (succ x) (not x) the error message will either complain that `x` has type `Bool` but it should be `Int`, or it will complain…
Comment linking /talks/2016-06-compty/CompTy.pdf
on “What is Hindley-Milner and why is it cool? (2008)”Submitted Developing iPhone applications in Haskell as a story · 6 points
HN discussionThere's the so-called 'B Method', which seems very similar to this on the programming language side. I haven't checked the proof language so that may be very different. I've got a two-parter on my blog giving a glimpse of B's programming language[1] and proof language[2]. [1] https://gergo.erdi.hu/blog/2010-02-16-the_b_method_for_progr... [2] https://gergo.erdi.hu/blog/2010-02-22-the_b_method_for_progr...
Comment linking /blog/2010-02-22-the_b_method_for_programmers_(part_2)/
on “Dafny – A programming language with a program verifier”Submitted MetaFun: Compile Haskell-like code to C++ template metaprograms as a story · 5 points
HN discussionSee also free applicatives. We use these extensively at work. E.g. http://gergo.erdi.hu/blog/2012-12-01-static_analysis_with_ap... Amazing when entire DSL programs turn into 1 line calls.
Comment linking /blog/2012-12-01-static_analysis_with_applicatives/
on “From zero to cooperative threads in 33 lines of Haskell”Submitted Developing iOS applications in Haskell as a story · 4 points
HN discussionThere's also this https://gergo.erdi.hu/blog/2021-09-18-rust_on_the_mos_6502__... for rust on the 6502. I wonder how's the performance vs. C (for both, C# and Rust). Edit: It's my understanding that the 6502 is extremely stack-limited, so a well-versed assembler would use the stack very little and allocate mostly on the heap. In C, you can replicate this with global variables, and I believe (and I would be very happ…
Comment linking /blog/2021-09-18-rust_on_the_mos_6502__beyond_fibonacci/
on “.NET for NES Game Console on 6502 Microprocessors”Submitted MetaFun: Compile Haskell-like code to C++ template metaprograms as a story · 3 points
HN discussionApplicatives were the example that I had in mind. See also http://gergo.erdi.hu/blog/2012-12-01-static_analysis_with_ap... , or think about how regular expressions' limited power makes parsing with them a linear affair. (Incidentally, regular language parsers are Applicatives, too.)
Comment linking /blog/2012-12-01-static_analysis_with_applicatives/
on “Accidentally Turing-Complete”Submitted A small benchmark for functional languages targeting web browsers as a story · 3 points
HN discussionread this, in Hungarian http://gergo.erdi.hu/blog/2011-05-16-i%27m_leaving_on_a_jet_... google translate: rapid help deszantosokként trapped in the trade analysts,
Comment linking /blog/2011-05-16-i%27m_leaving_on_a_jet_plane.../
on “Why I prefer scheme to Haskell”Submitted Cheap and Cheerful Microcode Compression as a story · 3 points
HN discussionyou should find metafun interesting: http://gergo.erdi.hu/projects/metafun/
Comment linking /projects/metafun/
on “How to abuse a C++ compiler?”Submitted Rust on AVR: Beyond Blinking as a story · 3 points
HN discussionbeen done: http://gergo.erdi.hu/projects/metafun/
Comment linking /projects/metafun/
on “Tetris as a C++ Template Metaprogram”Submitted Building an FPGA computer with Haskell using Lava as a story · 3 points
HN discussionThis kind of compiler has already be done: http://gergo.erdi.hu/projects/metafun/
Comment linking /projects/metafun/
on “Tetris as a C++ Template Metaprogram”Submitted MetaFun: Compile Haskell-like code to C++ template metaprograms as a story · 2 points
HN discussionYup, it's definitely its own language! It made me so happy when I saw a Haskell-to-C++-template compiler [1] because of all the similarities in pure-FP style (pattern matching, iteration via recursion, etc). [1] https://gergo.erdi.hu/projects/metafun/
Comment linking /projects/metafun/
on “An introduction to C++'s variadic templates: a thread-safe multi-type map”Submitted Initial version of my Commodore PET as a story · 2 points
HN discussionI have seen more than one such compiler, usually from Haskell-like dialects to C++ metafunctions (e.g., http://gergo.erdi.hu/projects/metafun/ ). In this case the metaprogramming seems unnecessary---even assuming that it makes any sense to run a snake game at compile time---since C++14's relaxed `constexpr` functions are a much more readable way to achieve the same thing. Metaprogramming is only required now when ty…
Comment linking /projects/metafun/
on “Stupid C++ Template Tricks: Snake”Submitted MetaFun: Compile Haskell-like code to C++ template metaprograms as a story · 1 points
HN discussion