Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Is Ruby to Objective-C Source Translator Easier?

Reply
Thread Tools

Is Ruby to Objective-C Source Translator Easier?

 
 
Gully Foyle
Guest
Posts: n/a
 
      07-23-2004
Would it be easier to create a ruby to objective-c translator than it is
to create a ruby compiler? Given the following, it appears it might be
easier to do this than converting ruby to pure c or c++.

Support for blocks in Objective-C described here (its been tested with
POCS, not sure how many other compilers support this):

http://users.pandora.be/stes/block98/index.html


And here's a short description of Objective-C from
http://www.dekorte.com/Objective-C/

C-based

Unlike C++, Objective-C is a true superset of C.

Dynamic

Objective-C is dynamicaly typed so class libraries are much
easier to deal with than in C++. The Objective-C run-time allows you to
access methods and classes by their string names, as well as do dynamic
linking and addition of classes and categories at runtime.

Simple

Unlike C++, Objective-C only extends the C language to support
Smalltalk like OO features without any extra functional-programming baggage.

Elegant

Objective-C supports dynamic binding and has a messaging syntax
like SmallTalk's.

Example:

[myColor setRed:0.0 green:0.5 blue:1.0];

Fast

Objective-C performs dynamicaly bound message calls very quickly
(about 1.5-2.0 times as long as a C function call).
 
Reply With Quote
 
 
 
 
Lennon Day-Reynolds
Guest
Posts: n/a
 
      07-23-2004
It might make more sense to adapt some of the implementation tricks
from POC or the GCC libobjc runtime to get the Ruby runtime overhead
down closer to that of Objective-C. However, in order to get
competitive performance, you're still going to have to either JIT or
inline C code in places; doing runtime method dispatch for operations
on native ints and chars is never going to be as fast as a compiled
version.

Lennon


 
Reply With Quote
 
 
 
 
Phil Tomson
Guest
Posts: n/a
 
      07-23-2004
In article <UFgMc.2791$> ,
Gully Foyle <> wrote:
>Would it be easier to create a ruby to objective-c translator than it is
>to create a ruby compiler? Given the following, it appears it might be
>easier to do this than converting ruby to pure c or c++.
>
>Support for blocks in Objective-C described here (its been tested with
>POCS, not sure how many other compilers support this):
>
> http://users.pandora.be/stes/block98/index.html
>


I could be wrong, but I don't believe that the gcc Objective C compiler
supports this and it is the most widely used compiler for Obj C (and it's
essentially what is used on the Mac platform for compiing Obj C/cocoa).

Phil
 
Reply With Quote
 
David Ross
Guest
Posts: n/a
 
      07-24-2004
--- Gully Foyle <> wrote:
> Would it be easier to create a ruby to objective-c
> translator than it is
> to create a ruby compiler?


Easier yes, faster no. I know ObjC very well. If you
program on a MacOSX computer with the GNUstep
libraries, the overhead is HUGE. Decided language is
C. After I get it somewhat stable I will be using
little peephole tricks to make it faster, with asm
most likely. After I get it stable of course. --David
Ross




__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo


 
Reply With Quote
 
Frank Mitchell
Guest
Posts: n/a
 
      07-25-2004
Phil Tomson wrote:
> In article <UFgMc.2791$> ,
> Gully Foyle <> wrote:
>>Support for blocks in Objective-C described here (its been tested with
>>POCS, not sure how many other compilers support this):
>>
>> http://users.pandora.be/stes/block98/index.html

>
> I could be wrong, but I don't believe that the gcc Objective C compiler
> supports this and it is the most widely used compiler for Obj C (and it's
> essentially what is used on the Mac platform for compiing Obj C/cocoa).


You're not wrong. The writer of POC has decided to go his own way with
the Objective-C language, starting with the original Stepstone compiler.
He also reviles Apple's additions since Stepstone at every breath;
check out comp.lang.objective-c for any length of time. So, no matter
how interesting some of his extensions are, you'll never be able to
integrate them with Apple ObjC short of forking his source.

Plus, last time I checked, the GNU runtime is based on a version of
NeXT's runtime *before* they switched to NSObject and the whole NS*
class hierarchy.

So the subset of Objective-C that compiles with GCC, POC, and Apple is
vanishingly small ....

--
Frank Mitchell (fmitchell each acm period org)

Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html

 
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 -> python translator exists? rogerdpack Python 3 12-27-2008 05:49 AM
Ruby to Python translator Aureliano Calvo Ruby 8 11-19-2007 01:55 AM
Ruby -> Lisp translator = much faster Ruby interpreter harsh@computer.org Ruby 4 05-02-2006 03:19 PM
re: bronco50 postet -> Power Translator Pro v8 0 Multilang- "Power Translator Pro v8.0 Multilang.sfv" (0/1) spiman@gmx.ch Computer Support 0 06-12-2005 07:51 PM
C++ to Java source translator rooban Java 3 07-03-2004 03:38 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