0

I know i'm walking into a big pile of cow manure with this question from all the other questions and answers I've seen but I've got my hip boots on.

At the company I work for, there are about a decade and a half worth of perl libraries that are used constantly to make scripting easier for testers and other people.

In my mind, since Perl "compiles" down to c and Ruby does, too, it seems there would be a way to call the modules from ruby after the modules have been compiled down to C.

Of course, judging by the answers I've seen here and elsewhere that's an incredibly naive viewpoint. Could someone help me understand why I can't or how I would go about doing this?

7
  • Completely leaving aside the technical aspect of your question, I'm just curious why you want to do this. Does your company use both Perl and Ruby actively, or was there a switch from one to the other at some point? Commented Apr 11, 2014 at 18:01
  • 1
    Well, actually, I don't want to do this. I'll keep slogging along with perl. It's a perfectly fine language, i just much prefer ruby. Even if there IS a way to do this, I'm not certain I'll actually do it. However, one motivation of mine is maybe for recruiting. It's a much harder sell to someone starting their career in IT today to say "you'll be programming in perl" than to say "you'll be programming in Ruby (or any language you so choose)". Commented Apr 11, 2014 at 18:05
  • 9
    Not leaving aside the technical aspect of your question, there is no meaningful sense in which Perl and Ruby "compile down to C". The Perl and Ruby interpreters are C programs, but there is no point in running a Perl or Ruby script where the instructions in the script are translated into C. Commented Apr 11, 2014 at 18:17
  • You could fork/exec a Perl script and communicate through IPC if you had to. Or get all unixy and communicate using text formats and pipes. Commented Apr 11, 2014 at 18:32
  • 2
    Perl code does not compile down to C or machine code. Maybe you meant Perl and Ruby are both written in C? That may be, but so is Microsoft Word, and you wouldn't expect Ruby to execute Word documents, right? Commented Apr 11, 2014 at 20:53

1 Answer 1

1

ruby-perl exists.

I offer no guarantees as to its usefulness.

Inline::Ruby is the inverse.

Sign up to request clarification or add additional context in comments.

1 Comment

I did see ruby-perl. It seems that any viable answer is going to require a lot of hacking. probably a level of hacking that is at least theoretically close to just changing all of the libraries to ruby and going that route. Which is not a route at all. Thanks for all the info, all!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.