More articles tagged 'programming'

Writing a compiler in Ruby bottom up - step 5

Last time I promised to post these more frequently, and blatantly failed to find the time... In return, I've taken the time to combine what would have been parts 5, 6 and 7, that by themselves would've been annoyingly short. Here goes:

Handle number literals

So far our program have only ...

Writing a compiler in Ruby bottom up - step 4

Sorry for the long delay since the last part, I've simply been too caught up in other stuff. As the list from last time indicated, this part will cover defining functions and adding support for building a simple "runtime library".

Defining functions

A programming language without either functions or methods isn't ...

Mini reviews of 19 Ruby template engines

I've seen lots of template systems in Ruby, but haven't been really been happy with any of them. Over the last few months or so I've kept notes of the ones I looked at. This is the list I came up with, and some comments on each. But first a disclaimer:


- Why am I forced to optimize when choosing my language?

Martin C. Martin wrote a great post on performance and dynamic languages. I particularly loved this quote:

Premature optimization is the root of all evil. Why am I forced to optimize when I am choosing my language, before writing a single line of code?

The post and comments ...

Strawman for a new parser generator

I have very strong opinions when it comes to parser generators. Most parsers I've written have ended up being hand written or have used some half-assed parser generators I've written myself, because I've yet to find a parser generator I like. I've found many I like aspects of, but they invariably ...

Writing a compiler in Ruby bottom up - step 3

Chaining expressions with "do"

So far, the second version from last time can execute one single expression, and that's it. Not very useful. So I need to add a way to chain expressions like in the body of a function.

Writing a compiler in Ruby bottom up - step 2/??

My choice of Ruby as my implementation language was pretty arbitrary. The choice doesn't matter all that much at this stage, but I really like Ruby.

At some point, however, there will be a series of steps to bring the language and the compiler closer together. What I mean by that ...

Latest referrers using Rack and Ruby

As most bloggers I like to keep an eye on where my traffic is coming from, and especially when there are surges in traffic. I'm using both Google Analytics and Feedburner for stats, and it works great for trends, but not see what's happening right now.

This morning I needed a ...

Why coupling is always bad / Cohesion vs. coupling

In the discussion following my entry "Why Rails is total overkill and why I love Rack" several comments raised the issue of whether high coupling is always bad. My answer was that I believe it is, but at the same time it can be worth it sometimes.

It seems like ...