Showing posts with label satire. Show all posts
Showing posts with label satire. Show all posts

2009-11-17

Unix in 14 lines of Ruby (it's trivial)



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.
$ uname
Runix 1.0
$ halt
All it takes to implement Unix in Ruby is 14 lines of elegant code.

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.

2009-09-14

Python Community in Anguish, Pain, Despair Over Web Server

First they had the guts to punk TechCrunch, now Facebook picks a fight with the Python community by releasing a web server, called Tornado, developed by recently acquired Friendfeed.

Terry Jones, CEO of Fluidinfo, probably best expressed the pain felt by Pythonistas: "Words fail me on this one. I’ve spent some hours today trying to put my thoughts into order so I could put together a reasonably coherent blog post on the subject. But I’ve failed."

Facebook's Bret Taylor explains the reasons for such a highly unpopular move: "We ended up writing our own web server and framework after looking at existing servers and tools like Twisted because none matched both our performance requirements and our ease-of-use requirements."

The performance myth was quickly dismissed by an article which shows that Twisted performs almost as well as Tornado.



Pwpwp looked at the Twisted documentation, to dispel the ease-of-use myth. The wiki page Twisted Web Plan (aka What's Going On With Twisted Web) explains:

Currently there is a lot of confusion as to what to do and where to go to get a good, supported twisted.web server. Users are confronted with 3 options and an infinite number of permutations of those options: twisted.web, nevow, and twisted.web2. This confusion is made manifest in the lengthy explanation of web development with twisted hosted here on this wiki.

This is mostly a problem of perception, but there are some real issues. For example, there is a lot of redundant maintenance going on in, for example: twisted.web.static, twisted.web2.static, and nevow.static; twisted.python.urlpath and nevow.url; nevow.appserver and twisted.web.server.

As you can see clearly, it's mostly a problem of perception. The page continues with inspiring optimism:
However, at some point in the future, there will be one supported, good web server in the Twisted community, and that will be twisted.web.
A second page, titled Web Development With Twisted functions as a "roadmap to the wilderness that the landscape of web development with Twisted has become."

In conclusion, Twisted performs almost as well as Facebook's "cobbled together" newfangled Tornado, and Twisted developers have provided a clear roadmap to the "wilderness that the landscape of web development with Twisted has become".

Why Facebook/Friendfeed decided to create a new web server is completely beyond us.