Nathan Sobo's blog



Nathan SoboNathan Sobo
Treetop 1.0.1
edit Posted by Nathan Sobo on Saturday September 15, 2007 at 12:25AM

I've been working on a parsing framework for Ruby since January called Treetop. I just released version 1.0.1 and recorded this screencast demonstrating its use.

Nathan SoboNathan Sobo
Treetop: Bringing the Elegance of Ruby to Syntactic Analysis
edit Posted by Nathan Sobo on Monday August 20, 2007 at 11:56PM

(This is my proposal for this year's RubyConf. Fingers crossed!)

Treetop is a parsing framework that brings the elegance and simplicity of Ruby to syntactic analysis. Rather than being just another copy of classic LALR/LR based generators like Lex and Yacc, Treetop blends the unique expressive power of Ruby with cutting edge parsing research. Its "packrat" implementation enables recognition of parsing expression grammars, which dispense with the need for lexical scanning and can take advantage Ruby's mixin and inheritance model for composition.

Nathan SoboNathan Sobo
Perplexing constant scope behavior
edit Posted by Nathan Sobo on Friday August 17, 2007 at 10:28PM

Why can't I refer to constants nested inside a class within a module eval?

irb(main):001:0> class A
irb(main):002:1>    class B
irb(main):003:2>    end
irb(main):004:1> end
=> nil
irb(main):005:0> A.module_eval { puts B }
NameError: uninitialized constant B
           from (irb):5
           from (irb):5:in `module_eval'
           from (irb):5
           from :0

This is frustrating. Can anyone explain why it has to be this way? Perhaps there's a good reason I'm not considering.

Nathan SoboNathan Sobo
REST: Theory to practice
edit Posted by Nathan Sobo on Thursday May 24, 2007 at 08:32AM

REST. What is it, and how can it be used to design better web applications?

A presentation at RailsConf did me a great service by first pointing out all the things REST is not. It isn't CRUD. It isn't pretty URLs. It is neither a protocol nor an architecture, but it can play a role in your implementation of all of the above. REST itself though, is less concrete than all of that. It is a theoretical framework, a way of thinking about designing distributed software systems. For me, the first step in absorbing its principles is to forget about the database and focus on the fundamentals. This article will start there, then drill down to show how these ideas can help organize the development of your Rails applications.

Noon: Rest From Work (After Millet) by Van Gogh

(Noon: Rest From Work (After Millet) by Vincent Van Gogh)