Work in progress: 82,651 of 181,233 sites checked so far, more every week · updated 2 Nov 2026Missing a blog? Tell us

Top all-time · #2063

V

Vidar Hokstad

Personal blog · hokstad.com · on HN as vidarhprogrammingsystems

Vidar Hokstad is a personal blog at hokstad.com about programming and systems. Since 2008, 36 different Hacker News readers have linked it 73 times, most often “Writing a compiler in Ruby, bottom up”. The last post was in 2016, but the archive is still widely read.

Visit the blog
73mentions?
14recommend?
36HN people?
2008–2025first – last linked?
Links on Hacker News per year · peak 12 in 2014

Often recommended · 14 of 30 sampled comments recommend it?

Why HN links it

HN readers link Vidar Hokstad's Ruby compiler series, valued for building a compiler incrementally, the way one writes an ordinary program, rather than starting with lexers and parsers. Semantic dictionary encoding is also cited.

Recommended for · 14 comments
Explains writing a compiler like any ordinary program, starting simple, so the design choices make sense.

Summarised by Claude from a sample of 30 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.

The author on HN?

vidarh · 46,901 karma · member since 2009

Consulting / part-time/retainer AI, devops work, and cloud cost optimization via my consultancy: https://hokstadconsulting.com Engineering management/leadership; AI; devops; software development, architecture; Ruby, C, JavaScript, C++, PHP, Java, Go, Python (roughly in descending order of commercial experience) E-mail: vidar@hokstad.com (job opportunities, contracts, and questions about my comments or projects are all good, but please be to the point and I can be slow to reply to unsolicited e-…

From their public HN profile, which links to this site.

Most-linked posts?

  1. Writing a compiler in Ruby, bottom up
    9 people · 19 mentions · first linked 2008-09-30
  2. Writing a compiler in Ruby, bottom up (2008)
    5 people · 7 mentions · first linked 2015-07-17
  3. Writing a compiler in Ruby, bottom up
    5 people · 6 mentions · first linked 2013-08-15
  4. A Brief Introduction to Semantic Dictionary Encoding
    5 people · 5 mentions · first linked 2017-11-15
  5. Writing a compiler in Ruby, bottom up
    3 people · 5 mentions · first linked 2019-01-28
  6. /semantic-dictionary-encoding
    2 people · 3 mentions · first linked 2018-04-12
  7. Mini reviews of 19 Ruby template engines
    2 people · 2 mentions · first linked 2008-04-13
  8. /the-problem-with-compiling-ruby
    2 people · 2 mentions · first linked 2014-04-08
  9. Writing a compiler in Ruby from the bottom up
    2 people · 2 mentions · first linked 2008-04-09
  10. The Oberon-07 language report is 17 pages
    2 people · 2 mentions · first linked 2014-04-13

What Hacker News says?

  1. Is this it? https://hokstad.com/semantic-dictionary-encoding

    Comment linking /semantic-dictionary-encoding

    on “Sneak Peek at WebAssembly Studio”
  2. Submitted Docker Development Patterns as a story · 251 points

    HN discussion
  3. lmm · 2014-04-15Recommends
    I highly recommend http://www.hokstad.com/compiler/ ; it talks about writing a compiler in a way that makes sense to me - writing it the way you write any other program, rather than throwing you straight in with lexers and parsers and never justifying why we need to do things this way.

    Comment linking /compiler/

    on “Kernel 101 – Let’s write a Kernel”
  4. Submitted Writing a compiler in Ruby, bottom up (2008) as a story · 89 points

    HN discussion
  5. Also cool to play around with are the various options that let GCC (and presumably LLVM) show you the various compilation stages of your C code. You can even spit out the C and resulting assembly side-by-side. I haven't had the time to play with this, but Part 4 of the excellent "Unix as IDE" series [1] goes into it and I'm sure there's more around the web. Another really fun way to get into the underlying assembler…

    Comment linking /compiler

    on “Learning C with gdb”
  6. Submitted Writing a compiler in Ruby, bottom up as a story · 62 points

    HN discussion
  7. lmm · 2019-01-28Recommends
    I could never understand why you have a parser as a separate thing when this was presented as an up-front decision. Reading this series of posts, where something like a traditional compiler architecture emerges in the same way that normal program architecture emerges via gradual refactoring, made it make a lot more sense to me: https://hokstad.com/compiler .

    Comment linking /compiler

    on “The Day I Fell in Love with Fuzzing”
  8. Submitted Some problems and solutions for compiling Ruby as a story · 9 points

    HN discussion
  9. The shelf thing annoys me greatly, but I don't want paper copies for the most part - I'm on a clearing-out-the-house spree, digitizing everything. But I'm concerned about what that does both for my relation to the media, and how it will change how my son gets introduced to things. So many of the ways I got introduced to books and music etc. was via what my parents had on the shelves or left out, or the radio the pla…

    Comment linking /the-hidden-library

    on “Calibre version 1.0 released”
  10. Submitted Writing a compiler in Ruby bottom up - step 10 as a story · 9 points

    HN discussion
  11. It seems to be gone from the repo, and doesn't seem to be worked on any more? A shame. AOT compiling Ruby is hard. I'm trying [1] [2]. Sorbet would be in a good position because part of the challenge of making it fast is that Ruby has a lot of semantics that are rarely used but that makes making compiled Ruby fast really hard. E.g. the bignum promotion adds overhead to every single operation unless you can prove inv…

    Comment linking /compiler

    on “Compiling Ruby to machine language”
  12. Submitted A Brief Introduction to Semantic Dictionary Encoding as a story · 8 points

    HN discussion
  13. I couldn't disagree more. Syntax changes whether I can look at a page of code and get an idea of structure and which elements to focus attention on, or whether I need to read everything in detail. It doesn't matter that much when I have found a piece of code that I need to read and understand every detail of, but that is a tiny proportion of the amount of code reading I do - most of the time reading code is about gr…

    Comment linking /how-to-implement-closures

    on “The Unison language”
  14. Submitted Writing a compiler in Ruby bottom up - step 12 as a story · 8 points

    HN discussion
  15. That'd be me... Though with the caveat that my parser (part of this project[1] ) still has fairly substantial gaps, so it will grow, but certainly not to the size of MRI's parse.y. It's actually worse these days it turns out parse.y for Ruby is 11348 lines [2], though for fairness it's worth noting that it's written in a quite "linefeed heavy" style, and this includes providing a Ruby API to the parser. [1] http://h…

    Comment linking /compiler

    on “ANTLR Mega Tutorial”
  16. Submitted 5 simple ways to troubleshoot using Strace as a story · 5 points

    HN discussion
  17. I followed this in the early 90s and had a lovely time. It helped that Turbo Pascal was my language of choice though and might not be quite so helpful now although Pascal is a pretty good pseudocode.. It's not the same but Vidar Hokstad has been writing a series for several years now in Ruby: http://www.hokstad.com/compiler/ .. and other resources aplenty: http://stackoverflow.com/a/1672/3951

    Comment linking /compiler/

    on “Let’s Build a Compiler (1995)”
  18. Submitted Eight Docker Development Patterns as a story · 3 points

    HN discussion
  19. lmm · 2015-12-24Recommends
    Post-2008 I'd really push http://www.hokstad.com/compiler . Writing a compiler in the same way you'd write an ordinary program, this was the first explanation where I actually understood the rationale for the choices being made.

    Comment linking /compiler

    on “Want to Write a Compiler? Read These Two Papers (2008)”
  20. Submitted Troubleshooting using Strace (2008) as a story · 3 points

    HN discussion
  21. > http://www.hokstad.com/the-problem-with-compiling-ruby I wrote that one in frustration when working on my Ruby compiler project, actually, and I think there are reasonable solutions to all of them, and in fact you will find that most of them, possibly all are solved to various extents in either Smalltalk implementations or Self implementations. In particular the Self papers is an invaluable resource for anyone who…

    Comment linking /the-problem-with-compiling-ruby

    on “Ruby 2.1 Garbage Collection: ready for production”
  22. Submitted Mini reviews of 19 Ruby template engines as a story · 3 points

    HN discussion
  23. I don't know Smalltalk well enough to say for sure, it's just my rather vague impression that Smalltalk is more compiler-friendly, likely based mostly on what I've read over the years about this, for example looking at: http://lambda-the-ultimate.org/node/2606 Ruby permits adding methods to individual objects; in Smalltalk, all methods reside in classes. In Ruby, it is practical and somewhat useful to add methods dy…

    Comment linking /the-problem-with-compiling-ruby

    on “Ruby 2.1 Garbage Collection: ready for production”
  24. Submitted Writing a compiler in Ruby from the bottom up as a story · 3 points

    HN discussion
  25. > I was speaking metaphorically of Pascal being the LLVM of its day, more that it was a known base, portable, easy to explain and the first tool someone would reach for. Yeah, I got that. My point was that they did actually try to take the next step as well, but it was too early for that part. > I found this awesome post that covers SDE, http://hokstad.com/semantic-dictionary-encoding That's mine, in fact :) SDE doe…

    Comment linking /semantic-dictionary-encoding

    on “50 Years of Pascal”
  26. Submitted Why Rails is total overkill and why I love Rack as a story · 3 points

    HN discussion
  27. I was speaking metaphorically of Pascal being the LLVM of its day, more that it was a known base, portable, easy to explain and the first tool someone would reach for. Templated IR code that has been LZ compressed sounds excellent, Thumb++ or uop buffer engine. It sounds like from the post below, that the instructions could even be pathologically the uop or VLIW instruction form and the SDE will effectively discover…

    Comment linking /semantic-dictionary-encoding

    on “50 Years of Pascal”
  28. Submitted URLs do not belong in the Views as a story · 3 points

    HN discussion
  29. I'm a bit sad to see that it's the only article tagged: http://hokstad.com/semantic-dictionary-encoding Did you ever get around to exploring SDE's in a Ruby context?

    Comment linking /semantic-dictionary-encoding

    on “Oberon – The Overlooked Jewel [pdf]”
  30. Submitted Writing a compiler in Ruby, bottom up as a story · 2 points

    HN discussion

Search all of HN for hokstad.com

Linked by the same people?