Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Ruby to C?

Reply
Thread Tools

Ruby to C?

 
 
Mohammad ---
Guest
Posts: n/a
 
      11-08-2006
Okay, I'm working an a robotics project and instead of using C could I
actually write it in ruby then convert it into C code?

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Ryan Davis
Guest
Posts: n/a
 
      11-09-2006

On Nov 9, 2006, at 2:10 AM, Paul Lutus wrote:

> Mohammad --- wrote:
>
>> Okay, I'm working an a robotics project and instead of using C
>> could I
>> actually write it in ruby then convert it into C code?

>
> If you mean convert automatically, no, not really. Not unless what
> you write
> in Ruby is very generic, and you don't use any of C's distinct
> properties.
> If that were true, converting to C would have little point.


Not quite accurate. Depending on what you're doing ruby2c might work.
Given that it is a robotics program, we're generally talking fairly
boring prorgamming anyhow. It might be translatable with ruby2c,
possibly even without much work.

> Why do you think you need to convert to C?


Presumably so he can download the program to the robot and ruby
doesn't run there.

> For speed? I have written a
> number of projects in Ruby because the development time is so
> short, then,
> after establishing the design, I converted to a faster language.
> But the
> conversion was by no means easy.


There are several much easier ways to make your ruby fast. Usually
keeping most everything ruby. Full ports are my absolute LAST option.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ruby extension (C++) on OS X [ruby 1.8.2] and Google-Sketchup [ruby 1.8.5] Nicholas Ruby 3 01-28-2007 01:48 AM
The Ruby Edge - Digg for Ruby and Ruby On Rails roschler Ruby 0 10-15-2006 11:35 PM
ruby-talk, comp.lang.ruby, ruby-talk-google Phrogz Ruby 4 09-05-2006 08:19 PM
#!/usr/bin/ruby , #!/usr/bin/ruby -w , #!/usr/bin/ruby -T?, #!/usr/bin/ruby -T1... anne001 Ruby 1 04-23-2006 03:02 PM
[ANN] ruby-freedb, ruby-serialport, ruby-mp3info moved to Rubyforge guillaume.pierronnet@ratp.fr Ruby 0 08-31-2003 11:57 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57