Paul Battley

po-ru.com · Personal blog · on HN since 2009

Paul Battley, a Ruby developer, writes about Ruby parsing quirks, Rails, and the Ruby community.

What HN saysHN commenters link his Ruby parsing ambiguities post in grammar discussions, and his post on Matz being nice in a debate over DHH's politics.
16HN people shared it
4linked it in comments
12stories submitted
145story points
2 months agolast shared
2009people per year2026

Most-shared posts

  1. 1
    It doesn't matter whether "Matz is nice"
    2 people · 2 points · first shared 2026 · discussion on HN
  2. 2
    Ruby parsing ambiguities
    2 people · first shared 2012
  3. 3
    Ruby’s magic underscore
    1 people · 113 points · first shared 2012 · 34 comments on HN
  4. 4
    Convert Ruby to JavaScript
    1 people · 15 points · first shared 2009 · 10 comments on HN
  5. 5
    Destructuring assignment in Ruby
    1 people · 3 points · first shared 2012 · discussion on HN
  6. 6
    IE6 D-Day, lets give IE6 a definable lifespan
    1 people · 2 points · first shared 2009 · discussion on HN
  7. 7
    One does not simply … (Turbolinks edition)
    1 people · 2 points · first shared 2013 · discussion on HN
  8. 8
    Writing Rails apps without wanting to kill everybody
    1 people · 2 points · first shared 2013 · discussion on HN
  9. 9
    1 error(s) prevented this form from being saved
    1 people · 2 points · first shared 2014 · discussion on HN
  10. 10
    Get your filthy hands off my Kernel methods
    1 people · 1 points · first shared 2009 · discussion on HN
  11. 11
    Skimmer, deuxième partie
    1 people · 1 points · first shared 2015 · discussion on HN
  12. 12
    Po-ru.com: Ruby propaganda
    1 people · 1 points · first shared 2010 · discussion on HN
  13. 13
    Encrypted application configuration
    1 people · 1 points · first shared 2014 · discussion on HN
  14. 14
    Clock.js
    1 people · first shared 2013
  15. 15
    Getting started with treetop
    1 people · first shared 2012

What HN people wrote when they linked it

stcredzero · 2017-03-20
writing parsers is the least interesting part of an interpreter/compiler, and your grammar should be boring if you want your syntax to be easy to understand by humans. In my (admittedly limited) experience, most grammars for programming languages that are supposed to be easy on humans end up being harder to parse. (See below) One notable exception is, of course, Smalltalk. One criticism I have of this article, is that it is written in a way that obscures the fact a top-down parser is an LL(k) parser. I'd posit that sticking to an LL(1) grammar is a great way to wind up with a simpler syntax that lacks sticky syntactic sugar that will be hard to optimize and build software tool for later on. (AT least for your personal learning hobby project. But in that case, at least use a separate Lexer!) You can't introduce bullshit ambiguous extensions to your grammar Ruby: http://po-ru.com/diary/ruby-parsing-ambiguities/
threedaymonk · 2012-11-29
Both Ruby and Perl have the same challenge, and both solve it by treating the expression differently depending on whether f is a variable or a function/method. As it turns out, you can't actually parse Perl 5 [1], but Ruby can be statically parsed [2], and resolves this ambiguity based on context. I don't actually know anything about CoffeeScript's parser, and I imagine that it complicates the grammar significantly, but would the same approach not be possible there? (Personally, I'm quite happy to type parentheses in exchange for clear syntax, and it's these very aspects of CoffeeScript that put me off it: I really find it tricky to follow what's going on when function definitions, function calls, and named parameters are mingled. At least regular JavaScript is syntactically simple, even if I do have to type function more often and worry about this.) [1] http://www.perlmonks.org/?node_id=663393 [2] http://po-ru.com/diary/ruby-parsing-ambiguities/
xavdid · 2026-08-21
I would not personally sign onto (or put money) behind a DHH-run project because of his frankly abhorrent political views: - https://po-ru.com/2026/07/29/it-doesnt-matter-whether-matz-is-nice - https://blogs.gnome.org/alatiera/2025/11/06/dhh-and-omarchy-midlife-cr…
edlea · 2012-02-14
This is something that the BBC did with iPlayer: http://po-ru.com/diary/device-discrimination-on-the-internet/ I've not quite worked out how to implement it though

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