Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

According to my very unscientific measurements (I didn't bother looking which files are potentially auto generated), I got:

  182kloc of C (.c files)
  110kloc of c++ (.h + .cpp files)
  558kloc of ruby (.rb files)
That puts C/C++ at roughly 40% of total. Unless proven otherwise I would say "ruby written in ruby" is a bit untrue.


Your numbers are odd.

I would discount the .c code. Rubinius's native code (excluding third-party code) is largely C++, so better to focus on .cpp and .hpp files.

The .rb count is way higher than what I got. The line counts I got (on master, not hydra):

vm / {cpp,hpp}: 162kloc

kernel / rb: 31kloc

lib / rb: 145kloc

Oddly enough the total ratio is roughly what you came up with, but I'm not sure where your numbers came from.

It's worth noting that the density of .rb source is considerably higher than that of .cpp source; a few lines of .rb can do what might take dozens or hundreds of lines of .cpp. I wouldn't fault them based on LOC; Rubinius is still implemented more in Ruby than any other implementation out there.

Let's say .rb is conservatively worth 10LOC of C++. That puts them at more like 10% "not Ruby", going by the amount of work they get done in each language. Even if you only consider kernel / rb versus vm / {cpp,hpp}, the 10X ratio means they're less than 1/3 "not Ruby". That's pretty good.


I just counted everything including stdlib and whatnot (all that comes in the checkout). "Rubinius is still implemented more in Ruby than any other implementation out there." well that's probably true, but not really useful. If all ruby implementations had 0 lines of Ruby and Rubinius 1 would you call it "mostly written in ruby"?

10X on LOC count is bogus, just because it's a single number. It does depend on what you do, it might end up being that, being more or being less, essentially [citation needed].

Anyway, even assuming this odd coefficient, I wouldn't say 1/3 "not Ruby" is "pretty good", although "pretty good" is not a precisely defined term, so we're free to agree to disagree on that. Given the same assumptions you can say CPython is written mostly in Python (10x Python-vs-C, including all the library code).


Well, I suppose I go by the following guide:

* stdlib is library code, not core VM code. It shouldn't be counted. * Percentage of functionality of Rubinius's core implemented in Ruby is definitely higher than percentage of functionality implemented in C++, at least for the core Ruby classes. Hard to quantify that though. * Rubinius's VM is basically all C++. I will concede that.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: