Forum: Ruby Why port a daemon from ruby to C++

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Panagiotis Atmatzidis (Guest)
on 2014-02-24 09:37
(Received via mailing list)
Hello,

I'm was reading about 'Clearskies[1]', an interesting project, when I
crossed this quote:

"There is an effort to port the daemon to C++ in a different repository
which will replace the ruby proof-of-concept once it's ready."

Are there any generally accepted reasons, speed apart, for which one
would want to port a daemon from ruby to C++?

Best regards,

[1] https://github.com/jewel/clearskies

Panagiotis (atmosx) Atmatzidis

email:  atma@convalesco.org
URL:  http://www.convalesco.org
GnuPG ID: 0x1A7BFEC5
gpg --keyserver pgp.mit.edu --recv-keys 1A7BFEC5
Eric Wong (Guest)
on 2014-02-24 10:54
(Received via mailing list)
Panagiotis Atmatzidis <atma@convalesco.org> wrote:
> Are there any generally accepted reasons, speed apart, for which one
> would want to port a daemon from ruby to C++?

Ease-of-installation.  It's likely more systems have a C++ toolchain
installed than a Ruby runtime.  The Ruby world evolves more rapidly than
C++, so users are more likely to have to deal with installation issues,
especially tough for users unfamiliar with Ruby.

It doesn't help that stable versions of Linux distros tend to ship Ruby
versions which are several years old, so users end up having to manage
Ruby installs themselves (or resort to 3rd-party tools like rbenv/rvm).


I don't know C++, but I have some experience with Perl vs C99:  I wrote
an experimental server[1] in C99 and GNU autotools.  Its main claim to
popularity within the small community of MogileFS users seems to be its
ease-of-build, install and deploy as a single file (compared to its Perl
equivalent).  I don't think users cared that it was a new, relatively
unproven codebase written from scratch, nor that it does strange things
unseen/uncommon in mainstream servers.


[1] - http://bogomips.org/cmogstored/README
7e17d370dc95b48cd82944a62f1caf76?d=identicon&s=25 Robert H. (shevegen)
on 2014-02-24 11:02
> Are there any generally accepted reasons, speed apart, for which
> one would want to port a daemon from ruby to C++?

No other reason makes sense.

speed is the only reason.

The laziness of some admins nor the incompetence of distributions to
provide users with components that can easily be updated on its own,
won't function as excuse to be able to update a system.

So the proper answer is speed.

You do gain more advantages with C++ though because you can use other
languages like python as well. Or lua, whereas if you use only ruby, you
are stuck with ruby - AND it is slow!
Carlo E. Prelz (Guest)
on 2014-02-24 11:03
(Received via mailing list)
Subject: Re: Why port a daemon from ruby to C++
  Date: lun 24 feb 14 09:53:23 +0000

Quoting Eric Wong (normalperson@yhbt.net):

> Ease-of-installation.  It's likely more systems have a C++ toolchain
> installed than a Ruby runtime.  The Ruby world evolves more rapidly than
> C++, so users are more likely to have to deal with installation issues,
> especially tough for users unfamiliar with Ruby.

My two eurocents: Ruby is much better in implementing the OO paradigm
than C++. Thus, writing Ruby extensions in C++ is not a good idea,
unless you write C code and have it compiled under C++, which is what
many do. But in that case, it is much better to just use C (and not
get forever lost in the messy tangle of STL and other wonders).

Carlo
13d0171c6ee97074d61f182a6e3a9f4e?d=identicon&s=25 Robert K. (robert_k78)
on 2014-02-24 12:51
(Received via mailing list)
On Mon, Feb 24, 2014 at 11:02 AM, Carlo E. Prelz <fluido@fluido.as>
wrote:
> My two eurocents: Ruby is much better in implementing the OO paradigm
> than C++. Thus, writing Ruby extensions in C++ is not a good idea,
> unless you write C code and have it compiled under C++, which is what
> many do. But in that case, it is much better to just use C (and not
> get forever lost in the messy tangle of STL and other wonders).

Not sure what you are getting at: this is about Ruby vs. C++ - not
mixing both.  The question was about porting a demon from Ruby to C++
- not parts of it. What did I miss?

Kind regards

robert
Carlo E. Prelz (Guest)
on 2014-02-24 12:59
(Received via mailing list)
Subject: Re: Why port a daemon from ruby to C++
  Date: Mon 24 Feb 14 12:51:23PM +0100

Quoting Robert Klemme (shortcutter@googlemail.com):

> Not sure what you are getting at: this is about Ruby vs. C++ - not
> mixing both.  The question was about porting a demon from Ruby to C++
> - not parts of it. What did I miss?

Instead of thinking about porting from Ruby to C++, you can think of
maintaining the daemon in Ruby, but code the parts that require
a performance boost in C.

I thought it was evident. Sorry if it wasn't.

Carlo
13d0171c6ee97074d61f182a6e3a9f4e?d=identicon&s=25 Robert K. (robert_k78)
on 2014-02-24 14:41
(Received via mailing list)
On Mon, Feb 24, 2014 at 12:59 PM, Carlo E. Prelz <fluido@fluido.as>
wrote:
> maintaining the daemon in Ruby, but code the parts that require
> a performance boost in C.

So basically you were slightly changing the question to "Are there any
generally accepted reasons, speed apart, for which one would want to
port a daemon [or parts of it] from ruby to C++?" ;-)

> I thought it was evident. Sorry if it wasn't.

No sweat. Thanks for clarifying!

Kind regards

robert
7f7f6930bf1af19e4adc43ac3f723834?d=identicon&s=25 Abinoam J. (abinoampraxedes_m)
on 2014-02-24 16:29
(Received via mailing list)
Smaller memory footprint?
Less dependencies?
More platforms supportted, like a wi-fi router for example (with or
without a complete operating system)?

Abinoam Jr.

On Mon, Feb 24, 2014 at 5:37 AM, Panagiotis Atmatzidis
9d2d160377d47a2144b12d36ab63126f?d=identicon&s=25 Regis d. (raubarede)
on 2014-02-24 20:16
Abinoam Jr. wrote in post #1137817:
> Smaller memory footprint?
> Less dependencies?
> More platforms supportted,
  code obfuscation
  performance
  masochism (for that, you should use ADA...)
7f7f6930bf1af19e4adc43ac3f723834?d=identicon&s=25 Abinoam J. (abinoampraxedes_m)
on 2014-02-24 20:39
(Received via mailing list)
+1 for masochism !
13d0171c6ee97074d61f182a6e3a9f4e?d=identicon&s=25 Robert K. (robert_k78)
on 2014-02-25 08:21
(Received via mailing list)
On Mon, Feb 24, 2014 at 8:39 PM, Abinoam Jr. <abinoam@gmail.com> wrote:
> +1 for masochism !

Whether it's that or sadism probably depends on who has to maintain the
code...

robert
4b4de96abbd3fe26cc285cebd5d806ca?d=identicon&s=25 tamouse m. (tamouse_m)
on 2014-02-26 02:37
(Received via mailing list)
On Tue, Feb 25, 2014 at 1:21 AM, Robert Klemme
<shortcutter@googlemail.com> wrote:
> On Mon, Feb 24, 2014 at 8:39 PM, Abinoam Jr. <abinoam@gmail.com> wrote:
>> +1 for masochism !
>
> Whether it's that or sadism probably depends on who has to maintain the code...

+1 for diversity!
This topic is locked and can not be replied to.