Day to day rubinius
The venerable Eric Hodel (drbrain) has whipped the rubinius team into blogging more, so this should be the first of many posts to come.
Development front
We continue to push forward, getting rubinius running everyday ruby code. I continue to use irb under rubinius daily, and it’s proved quite stable.
Though, we’ve begun to hit the standard lib code that is quite tricky. Case in point, mathn.rb. mathn.rb adds some new methods to Fixnum and Bignum, as well as redefining some very core methods, like, Fixnum#/ (divide). We’re currently working through how to support this, because as is, when mathn redefines that method to start returning Floats, most of the rubinius system goes south. Thats because the kernel currently assumes that if it uses Fixnum#/, a Fixnum is returned, and it can pass that to other primitives and such.
We’re still unsure about the long term solution for this, but it does bring up a problem with having a very open, dynamic language, where the kernel of the language uses that same open, dynamic runtime. A user can change the behavior of a core, system method, and effect a lot more than they could in MRI. This is the famous double edged sword.
My hope is that we’re able to code the kernel a little defensively and really stabilize the kernel to the point that these kinds of changes wont cause the whole system to go south.
Conference front
Seems that 2008 is going to be the year of conferences for me.
- On Feb 8th and 9th, Ezra and I will be at acts_as_conference, giving a charity tutorial talk about how to be a better ruby developer.
- Next, I’ve been invited to give at talk about rubinius, as well as the “Party” keynote (not sure what the party part is actually) at RubyFools over in Copenhagen, Denmark. This should be a lot of fun for a few reasons.
- I’ll be giving a non-Rubinius specific talk for once (the keynote), which is something I’ve wanted to do for a while.
- I’ve never been to Denmark, so it’s always fun to visit a new city.
- Abby is coming too! She’s going to sightsee and such while I’m at the conference, and we’ll have a few days before and after to take day trips and such. She loves europe, it should be a great time.
- There a bunch after this, but I’m not yet sure which I’m going to. The total is something like 5 or 6 before June 1st, so it’s going to be busy busy busy no matter what.
More to come!
That’s pretty awful — surely code that fundamentally changes the operation of a method on a basic object is a bad idea anyway. Maybe that really is one of the major issues; it’s a great feature, but misused it can totally screw people over.
Keep up the good work on Rubinius, it’s always been my favourite out of the new VMs…
Simon
January 16, 2008 at 5:24 am
don’t forget about comiccon in june. i’m going as a block of tofu. what’s your costume?
shaners
January 16, 2008 at 9:52 pm
I’m tempted to draw analogies to similar problems in other languages – but its difficult, with the main language I know being C++.
It seems like the problem is one of unexpected changes of semantics.
I suppose the closest thing I can think of is importing an extra header file that redefines stuff with macros and e.g. makes all your printouts disappear.
Actually, in the case of the macros, I can imagine situations where you DO exactly want to include a macro that made all your debug print messages disappear – as well as that situation where you didn’t want it to happen.
A related problem crops up in debugging where you also want only e.g. a specific subset of debug information to appear – i.e. you want to change semantics for some modules, not all. The solutions I most often see to this aren’t pretty. A different macro for printing for every module. (extra work/complexity, recompiling the affected files) ‘Debug levels’ to run the program at. (bad granularity)
I suppose a way out for this particular problem is distinguishing in kernel code with rigid semantic requirements by using a different name for the fixnum division that HAS to return fixnum from the fixnum division that can be user-redefined to return what the user wants to work in (fractions, decimals, etc).
Then the user is free to redefine the semantics of the operator (which becomes an alias for one or other division func) without changing semantics the ‘fixdiv’ routine, or whatever.
But every other function that can be redefined gives you the same sort of potential dangers…
You could call this ‘The danger of side effects in a language’… and contrast it to ‘the danger of side effects in programs’.
Tim Lovell-Smith
January 17, 2008 at 5:48 pm
Hi Evan – Why haven’t you used fork() to implement the multi VM feature?
Robert Hulme
January 18, 2008 at 4:25 am
One possible solution
class Fixnum

alias divide :/
def / x
if caller.first =~ /kernel/
divide x
else
…
end
end
end
(j/k)
Charles
January 18, 2008 at 5:31 am
I’m talking at Ruby Fools too and my girlfriend is coming and going sightseeing during it also. Might be worth introducing them!
I’m also going to be at the European Ruby conference (EuRuKo) that’s a week or two after in Prague.. that should be even more fun.
Peter Cooper
January 19, 2008 at 2:17 am
Oh, and I pretty ticked off that my session is at the same time as yours, as I’d rather like to see it. Not only that, competition for attendees.. oh well! I guess I’ll get all of the people who haven’t really done any coding before and you’ll get all the experts
Peter Cooper
January 19, 2008 at 2:18 am
Not to dominate the comments (I hope) but I’d be interested to know how you’re doing for hotel arrangements for Ruby Fools given that your girlfriend is going too. The organizers suggested they either pay me what they would have paid and I can sort the accommodation out, or pay the extra to them, but I haven’t really made my mind up yet..
Peter Cooper
January 20, 2008 at 4:22 pm
What mathn does is awful. Case in point: ((2 ** 64 + 1).quo(2) * 2) – (2 ** 64) = 0.0
The right thing to do would be to have Fixnum#/ return a rational number; this is what Smalltalk does.
Paolo Bonzini
January 27, 2008 at 4:34 am
Uhm, I screwed up. What mathn does is not awful, it is correct, because it requires “rational.rb” before aliasing Fixnum#/ to Fixnum#quo. So, it *does* return a rational number for Fixnum#/ and the above snippet returns 1 after requiring “mathn.rb”. In fact, with mathn Ruby has the same behavior I attributed to Smalltalk.
Looks like you Rubinius people have some work to do.
Paolo Bonzini
January 28, 2008 at 1:04 am
What are the other rubinius team blogs? My GoogleReader rubinius tag is too sparse
Branden Timm
February 5, 2008 at 8:37 am