user502052
user502052

Reputation: 15257

What are the relationship\dependencies between C++ and Ruby?

I am using Ruby on Rails 3 and I would to understant what means when I read "Convert Ruby to low level languages?"-

That means that I can use C\C++ code\logic directly in a Ruby application?

Upvotes: 1

Views: 268

Answers (1)

dnch
dnch

Reputation: 9605

Core parts of some implementations of Ruby (excluding rbx/jruby) and some RubyGems are implemented in C. It is possible to write libraries in C that – when compiled - can be used within a Ruby script, provided they conform to certain specifications:

http://www.ruby-doc.org/doxygen/current/

As for using C code or logic directly in a Ruby application – no, this is not possible. It needs to be encapsulated in a library that conforms to the specifications and then compiled.

Upvotes: 1

Related Questions