Why Ruby?

Caligo iteronvexor at gmail.com
Fri Dec 17 21:54:58 PST 2010


Obviously you're not going to find an OS kernel that's written in Python or
Ruby, and just because it's an OS kernel doesn't necessarly mean it's that
big.  The Linux kernel is about 8 million, and about half of it is the
drivers.  The core is actually rather small (about 2 million).  Qt, on the
other hand, is well over 14 million lines of C/C++.  Things are very
different for an actual operating system, however.  Gentoo Linux is a great
example, and I've been using it for almost 10 years.  Portage, its package
management system, is over 1 million lines of bash; that's a lot for bash,
and portage is a very important part of the Gentoo OS (i.e., it's big).

"Big" doesn't necessarily have to be lines-of-code, and keep in mind that 5
lines of, say, Ruby code could easily translate into 50 lines of C++.  If a
software program plays an important role in people's lives, then I think it
could be considered big.  SCons is a medium-size project (100k of Python),
but it sure beats Make when it come to ease of use.  Interesting enough, the
Qt team is working on a new build tool to replace qmake, and JavaScript is
their primary choice for a programming language to do the job.

Another example is Emacs.  It's well over 1 million lines of Lisp.  Not to
start a religious war, but Emacs is by far one of the best, if not the best,
text editor out there.  It's much more than that.  I feel sorry for
developers who are constantly begging for IDEs for every new programming
language that comes out when all they need is Emacs.  You said to text
processing, so I'll stop.

IMO there is no honor in game development as it contributes nothing to
society.  I've rarely played any, so I won't be able to name too many, but I
do know about EVE Online.  Its core is in C++ as far as I know, but majority
of it is in Python.  In fact, I remember reading how CPP temporarily hired
Guido Rossum to help out because they were pushing Python to its limits.

Another example is Autodesk Maya.  The core is probably C/C++, but Maya
Embeded Language (MEL) plays a very big role.  In fact, at start-up, the
entire GUI is created by MEL scripts.  Maya by itself is probably one of the
most complex software programs out there, and in the early days a single
license used to cost close to 15k dollars (probably because of a niche
market and all the secrecy in the computer graphics industry).  Today it's
about half I think.  They've also recently added Python to it.  Maya has
been used in pretty much every motion picture in the last ten years or so,
and I don't see how special effects artists could have written all those
lines of code in C/C++ instead of MEL or Python.  The Foundry Nuke and Apple
Shake are other some examples.

So, I guess it's fair to say that sometimes large software programs are
written in multiple programming languages.  The core might be C/C++ because
of performance and efficiency, but everything else is some form of scripting
language.  I guess that goes to show that there is a right tool for any job,
and the guy in the Ruby video is wrong by implying that Ruby could be used
for anything.

BTW, I'm not trying to bash D in any way.  In fact I'm very excited about
it, and I want to see it succeed.  I'm a university student and C++ is my
main programming language.  I tried D1 about two years ago for the first
time, and that was with GDC (the old one).  Since then I haven't been able
to experience all the cool features in D2 because there are no stable D2
compilers available for my system.  I've tried compiling GDC from source
several times with different versions of GCC, but it always failed with an
error.  Spending a long time waiting for a compile to finish, and finally
failing is a big turnoff when you want to try something new.  I remember
when Go was announced, and it took me less than 5 minutes to clone the repo
and compile.  I was coding in Go in no time.  I still prefer D, but it's
little things like this that dictate whether or not a new programming
language gains traction quicker.  I think the day that I'm able to do 'git
clone git at github.com:walter/d.git' or 'emerge gdc' is the day that D will be
ready :-)

I think I'm digressing.  I'll shut up now.

P.S.
I agree, C++ is a very complex language and I speak from experience.  But I
wouldn't say the same about C.  C is surely low-level, but not complex.
Based on my observation, the size of Python and C grammar are in the same
range, whereas Ruby is much more complex (someone graphed these, and I don't
know how accurate they are).  At first I was drawn to Ruby because of its
one-liners, but I soon realized that it kept reminding me of C++'s
complexity.  I don't like the idea of "more than one way to do the same
thing" in a programming language.  I think a natural language suffers from
this, and that is why, no matter how formal, your writings are almost always
open for interpretation.  Interesting enough, if you notice when you are
talking to someone you're not actually talking to them, but, rather, at
them.  That's probably why scientists use mathematics to communicate.  I
haven't touched Ruby in over a year now, and I've been learning Python in my
free time.

Peace!



2010/12/17 so <so at so.do>

> On Sat, 18 Dec 2010 02:51:28 +0200, Caligo <iteronvexor at gmail.com> wrote:
>
>  People have indeed designed and implemented very big software systems
>> using
>> "one of those so called not so complex languages".
>>
>
> Why don't you name one?
> I obviously wasn't clear enough with "big software".
> I don't know of any serious OS, game, <insert anything but text processing>
> written in anything except C/C++ (both complex languages).
>
>
>  What people have not done is write anything meaningful of any size in D.
>> The main reason for that is that, after so many years, there is still no
>> decent D compiler, nothing near GCC quality, to be found.  For such a
>> complex language as D, there are sure too many compilers and "standard"
>> libraries, none of which are stable, up-to-date, or usable enough.  GCC is
>> the gold standard (for openness, quality, and user-base), and it seems D
>> won't make it in till 2012.  So, we're still years away from the "big D
>> software".  According to Ohloh, there is currently a total of 16 million
>> lines of code written in D.  Compare that to 70 million for Ruby, and 160
>> million for Python.  And that's only for open source projects that Ohloh
>> keeps track of.  The count is in billions for C/C++.
>>
>> What I don't understand is this: how is it that Walter was able to
>> implement
>> C++ all on his own from scratch, and yet D is having so many issues?  How
>> complex is D really?
>>
>
> I completely agree with you, Walter is a superman.
> But i guess he is not super enough, he couldn't even singlehandedly solve
> every programming issue known to man for last 50 years.
>
>
> --
> Using Opera's revolutionary email client: http://www.opera.com/mail/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20101217/37610123/attachment.html>


More information about the Digitalmars-d mailing list