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

A7fca2db6ff3f4583df98043bd5166f9?d=identicon&s=25 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
18813f71506ebad74179bf8c5a136696?d=identicon&s=25 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
4828d528e2e46f7c8160c336eb332836?d=identicon&s=25 Robert Heiler (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!
3853dd5371ac1e094fc45d6c2aa0e459?d=identicon&s=25 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
E0d864d9677f3c1482a20152b7cac0e2?d=identicon&s=25 Robert Klemme (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
3853dd5371ac1e094fc45d6c2aa0e459?d=identicon&s=25 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
E0d864d9677f3c1482a20152b7cac0e2?d=identicon&s=25 Robert Klemme (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
09a32175057418748822c587ac08c429?d=identicon&s=25 Abinoam Jr. (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
B078cb4f4fb473c7a54d1fc36d10c70e?d=identicon&s=25 Regis d'Aubarede (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...)
09a32175057418748822c587ac08c429?d=identicon&s=25 Abinoam Jr. (abinoampraxedes_m)
on 2014-02-24 20:39
(Received via mailing list)
+1 for masochism !
E0d864d9677f3c1482a20152b7cac0e2?d=identicon&s=25 Robert Klemme (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
Aa082c8b00a50928e5860dcd70bf2368?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!
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.