More articles tagged 'programming'

Writing a compiler in Ruby bottom up - step 11

It's been a long time, and but I finally have a little bit of time again, and it's time to continue.

At this point the next step is some re-factoring. As it stands the compiler is very tightly tied to x86, and before it gets bigger it's worth starting to redress ...

Writing a compiler in Ruby bottom up - step 10

Uh, yeah. So much for posting the next part in a few days. I think I'll stop trying to second guess when I'll next have time (but sine I'm going off to Norway for vacation for a week, it's a safe bet the next part won't show up until later than ...

Writing a compiler in Ruby bottom up - step 9

As we've seen, 'while' can be implemented fairly easily in terms of a quite basic language. We could streamline it even more by reducing the verbiage needed to pass anonymous functions or by adding a Lisp style macro facility, but there are complications, so I'm biting the bullet and adding a built in "while" construct for now.

Writing a compiler in Ruby bottom up - step 8

Last time we looked at an improved way of handling loops etc. using anonymous functions. But most of that is relatively limited if there's no way of modifying variables. Sure, you can get away with recursion and not allow mutation or even other side effects at all. It might satisfy some ...

Writing a compiler in Ruby bottom up - step 7

I've combined two of the planned parts this time, what was in the list from last time as parts 7 and 8.

Making use of lambda / call

We can implement loops using recursion "manually", but adding lambda's now should make it possible to create a slightly cleaner version by actually ...

Writing a compiler in Ruby bottom up - step 6

Since we established last time that I'm going to blatantly steal stuff from Lisp, Scheme and friends (as well as from all over the place - I feel no need to be original with this project... Not until we're much further along, anyway), now is the right time to start introducing ...

Software ICs: Reuse should not always mean inheritance or configuration

Inheritance or configuration options has a cost in terms of increased complexity that can in some cases with advantage be avoided by maintaining multiple versions of the component and adding new features to new branches instead of continuing to work on a single code base, in the same way integrated circuits ...

How to sell and not sell a new programming language

"Everyone" that's geeky enough sooner or later at least toy with the idea of their own language (or like me write several half-assed toy compilers to test concepts - hopefully I'll actually see my latest one all the way through).

But what keeps amazing me is how new languages tends ...

Customizing the Ruby syntax highlighter for x86 assembler

I wrote about syntax hightlighting in Ruby earlier. The Ruby Syntax library supports Ruby, YAML and XML out of the box. But it's also pretty easy to extend to handle other languages.

Since I've been writing my compiler in Ruby series and including a lot of x86 assembler, I ...