1,105,423 Community Members

Quick question

Member Avatar
G_S
Junior Poster
142 posts since Mar 2010
Reputation Points: 38 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 0 [?]
 
0
 

Hello everybody


I have a question: is it possible to compile ruby files into bytecode. Does ruby have something like .pyc files?

I found some discussions online about generating .exe's from ruby files, but what I want to know if it is possible to compile .rb files just like you compile .py files.


Thanks

Member Avatar
b1izzard
Junior Poster
118 posts since Jun 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 14 [?]
Skill Endorsements: 0 [?]
 
0
 

It is not possible to generate bytecode with normal Ruby i.e C-Ruby. But I think its possible in Jruby

Member Avatar
G_S
Junior Poster
142 posts since Mar 2010
Reputation Points: 38 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 0 [?]
 
0
 

It is not possible to generate bytecode with normal Ruby i.e C-Ruby. But I think its possible in Jruby

This very interesting. So, if I understood correctly, this is the same ruby programming language but they removed the standard interpreter and changed it to an interpreter that works using Java bytecode instead of ruby bytecode? So the compiled output is JVM-executable??? Which in turn means I can create Java programs using Ruby?!


If so this is nice :)


Thank you

Member Avatar
b1izzard
Junior Poster
118 posts since Jun 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 14 [?]
Skill Endorsements: 0 [?]
 
0
 

@windso0: I am a beginner in C-ruby and don't know much about the other and I think you are right. Also see http://en.wikipedia.org/wiki/Ruby_(programming_language)#Implementations

Member Avatar
G_S
Junior Poster
142 posts since Mar 2010
Reputation Points: 38 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 0 [?]
 
0
 

YEs. It seems that Ruby itself can't generate bytecode, but these other alternatives can.

Thank you all guys.

Question Answered as of 3 Years Ago by b1izzard
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article