Rubinius Runs Mongrel
Posted by kev Mon, 10 Dec 2007 09:40:00 GMT
Reposted from my message to rubinius-dev. Congrats to the whole Rubinius team. This was entirely a group effort, and one hell of an achievement.
Here's the first Mongrel handler running on Rubinius:
http://pastie.caboo.se/paste/asset/126441/Picture_4.png
From this code:
$:.unshift "/Users/kev/code/mongrel/mongrel-1.1.1/lib"
puts "Requiring mongrel"
require 'mongrel'
class HelloHandler < Mongrel::HttpHandler
def process(request, response)
response.start(200) do |head, out|
head["Content-Type"] = "text/html"
out.write "Hello World! I'm running on Rubinius!"
end
end
end
server = Mongrel::HttpServer.new("0.0.0.0", 3000)
puts "Started Server"
server.register("/hello", HelloHandler.new)
puts "Registered handler"
t = server.run
t.join
***THE CATCH (as this may be viewed by many people)***
This isn't completely complete. rb_global_variable was #define'd out
to do nothing (so no garbage collection on the global vars), and there
was a slight modification from the trunk to make global aliasing
ignore the fact that the globals just weren't there. Mongrel's
http11.c was also _slightly (very very slightly)_ modified to use the
rb_str_get_char_* methods we've decided to move to from RSTRING()->ptr
and RSTRING()->len, and I haven't gotten around to defining ALLOC_N
yet, so it was changed to a simple malloc. That's it though.
And it seems to run. And I feel like I need to run around the block.
It's in 9976301ba.
WOOOOOOOOOOOOOOOOOOOOO!


Sweet work. All this Rubinius work is like a little chrissy pressie for us all!
You so rock Kevin.
Champion work. Now we just need the Turtles < Rubinius < Space Shuttle results and Evan’s RailsConf Europe slides will be validated.
Terrific work, Kevin.
Thank you so much for your work on Rubinius!