
Anyone under 17 knows that Ruby is so extremely dynamic, that Google's complete Map.Reduce framework can be implemented in one line of code:
data.map.reduce(Note the expressive and elegant object-orientedness that lies at the core of Ruby's efficient syntax...)
But now R is giving Ruby a run for it's money: Map/Reduce has been ported to R with just one line of code, too!
So clearly, we need to raise the bar here: I will show you how to implement Unix in a couple of lines of Ruby.
Yes, you heard that right. Ruby is so elegant and dynamic, that Unix takes just a couple of lines of code. Take that, C.
Other languages, like LISP, have lambdas and closures, but Ruby not only has these, but also continuations, blocks, procs, scopes, dos, and bacon! Mmmmh, bacon. (And btw, Ruby can implement Common LISP in a couple of lines.)
(There are a lot of articles that explain the differences between these, but as of Ruby 2.1.003m the schemantics of most of these have changed slightly, so the articles are out of date. As a rule of thumb: a continuation is a block that has been captured inside a scope where a do is in effect, and cannot be passed to a proc, only to a lambda. It's really quite simple. Matz has recently proposed a ten-year moratorium on Ruby development, so that we'll finally be able to understand all these.)
So here it is!
A sample run of this Unix for you're pleasure:
You have no mail.All it takes to implement Unix in Ruby is 14 lines of elegant code.
$ uname
Runix 1.0
$ halt
It doesn't do processes yet, and it has no filesystem, but apart from that, it's a fairly complete Unix.
Ruby is a butterfly.