Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1031339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T13:54:45+00:00 2026-05-16T13:54:45+00:00

I have all kind of scripting with Ruby: rails (symfony) ruby (php, bash) rb-appscript

  • 0

I have all kind of scripting with Ruby:

rails (symfony)
ruby (php, bash)
rb-appscript (applescript)

Is it possible to replace low level languages with Ruby too?

I write in Ruby and it converts it to java, c++ or c.

Cause People say that when it comes to more performance critical tasks in Ruby, you could extend it with C. But the word extend means that you write C files that you just call in your Ruby code. I wonder, could I instead use Ruby and convert it to C source code which will be compiled to machine code. Then I could “extend” it with C but in Ruby code.

That is what this post is about. Write everything in Ruby but get the performance of C (or Java).

The second advantage is that you don’t have to learn other languages.

Just like HipHop for PHP.

Are there implementations for this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T13:54:46+00:00Added an answer on May 16, 2026 at 1:54 pm

    Such a compiler would be an enormous piece of work. Even if it works, it still has to

    1. include the ruby runtime
    2. include the standard library (which wasn’t built for performance but for usability)
    3. allow for metaprogramming
    4. do dynamic dispatch
    5. etc.

    All of these inflict tremendous runtime penalties, because a C compiler can neither understand nor optimize such abstractions. Ruby and other dynamic languages are not only slower because they are interpreted (or compiled to bytecode which is then interpreted), but also because they are dynamic.

    Example

    In C++, a method call can be inlined in most cases, because the compiler knows the exact type of this. If a subtype is passed, the method still can’t change unless it is virtual, in which case a still very efficient lookup table is used.

    In Ruby, classes and methods can change in any way at any time, thus a (relatively expensive) lookup is required every time.

    Languages like Ruby, Python or Perl have many features that simply are expensive, and most if not all relevant programs rely heavily on these features (of course, they are extremely useful!), so they cannot be removed or inlined.

    Simply put: Dynamic languages are very hard to optimize, simply doing what an interpreter would do and compiling that to machine code doesn’t cut it. It’s possible to get incredible speed out of dynamic languages, as V8 proves, but you have to throw huge piles of money and offices full of clever programmers at it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At the moment, I have lot's of Java which does all kind of nifty
I have all php tools set up for Jenkins php projects. I set up
i have a website that displays all kind of info to the client. It
I have one entity object (kind) for storing all information from user's advertisement. It
I get this error when installing rmagick, I have followed all kind of guides
I have all the parameters fixed to describe one plot including oma , mar
I have all dates stored as timestamps (int) in the database. how can I
I have all my user uploaded pictures in a directory outside of the public
I have all the time zone information that is needed and it saves all
We have all heard of how in a for loop, we should do this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.