Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Ruby (http://www.velocityreviews.com/forums/f66-ruby.html)
-   -   Is Ruby to Objective-C Source Translator Easier? (http://www.velocityreviews.com/forums/t815804-is-ruby-to-objective-c-source-translator-easier.html)

Gully Foyle 07-23-2004 10:53 PM

Is Ruby to Objective-C Source Translator Easier?
 
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).

Lennon Day-Reynolds 07-23-2004 11:18 PM

Re: Is Ruby to Objective-C Source Translator Easier?
 
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



Phil Tomson 07-23-2004 11:31 PM

Re: Is Ruby to Objective-C Source Translator Easier?
 
In article <UFgMc.2791$cL3.2428@newssvr15.news.prodigy.com> ,
Gully Foyle <nospam@nospamnospamnospam.com> 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

David Ross 07-24-2004 01:48 AM

Re: Is Ruby to Objective-C Source Translator Easier?
 
--- Gully Foyle <nospam@nospamnospamnospam.com> 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



Frank Mitchell 07-25-2004 01:36 AM

Re: Is Ruby to Objective-C Source Translator Easier?
 
Phil Tomson wrote:
> In article <UFgMc.2791$cL3.2428@newssvr15.news.prodigy.com> ,
> Gully Foyle <nospam@nospamnospamnospam.com> 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



All times are GMT. The time now is 06:53 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.