[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Best compiled language for extending Ruby

Sharkie Landshark

12/18/2007 4:32:00 AM

I want to write my core logics in a compiled language for 1) performance
and 2) protecting my source code -- in case I will be selling my product
to a customer.

What would be the most natural-supported-easy-fast language to do this
in, given the many choices of language bridges?

I am particularly interested in,

1) C
2) Objective C
3) Ocaml
4) Lisp (SBCL)
5) Scheme

Does anyone have experience and would like to share?

I will be coding in OS X and deploying in FreeBSD mostly.

Thanks

Shark
--
Posted via http://www.ruby-....

24 Answers

M. Edward (Ed) Borasky

12/18/2007 5:55:00 AM

0

Sharkie Landshark wrote:
> I want to write my core logics in a compiled language for 1) performance
> and 2) protecting my source code -- in case I will be selling my product
> to a customer.
>
> What would be the most natural-supported-easy-fast language to do this
> in, given the many choices of language bridges?
>
> I am particularly interested in,
>
> 1) C
> 2) Objective C
> 3) Ocaml
> 4) Lisp (SBCL)
> 5) Scheme
>
> Does anyone have experience and would like to share?
>
> I will be coding in OS X and deploying in FreeBSD mostly.

The only one of these for which a well-documented interface exists is C.
C++ can be made to work, but Ruby itself is written in C.

I'm sure it's possible to write extensions in the other four languages
and build a C interface, so if your algorithms are more naturally
expressed in one of them, by all means use one of them. By the way,
which Scheme(s) were you considering? Quite a few of them compile to C
now, so that might make a Ruby interface easier.
>
> Thanks
>
> Shark


Sharkie Landshark

12/18/2007 6:10:00 AM

0

I am thinking of Stalin Scheme, and that is because I hear it is fast.
My first programming language is Scheme, and that is still my favorite.
I like Ruby because I find it similar to Lisp/Scheme -- in a strange
way.

Anyway, can I compile Stalin Scheme to C, or is there a high performance
scheme that will compile to C? It will allow me to get my work done
fastest, and most naturally suite my logics. I am very excited in
hearing that it can compile to C.
--
Posted via http://www.ruby-....

ThoML

12/18/2007 6:32:00 AM

0

> I am very excited in hearing that it can compile to C.

You can also compile ruby to C. Does this mean the code is in general
as
efficient as hand-coded C? No. Maybe for certain purposes.

Why would you combine Scheme and Ruby? If you like Scheme, use it.

BTW there are quite a few Scheme implementations that compile to
native
code. MzScheme (PLT), Chicken, Bigloo (which compiles also to Java),
Larency (which I have never tried) etc.

> because I hear it is fast.

Frankly, I'd suggest to actually test it and ask again later.

M. Edward (Ed) Borasky

12/18/2007 6:32:00 AM

0

Sharkie Landshark wrote:
> I am thinking of Stalin Scheme, and that is because I hear it is fast.
> My first programming language is Scheme, and that is still my favorite.
> I like Ruby because I find it similar to Lisp/Scheme -- in a strange
> way.
>
> Anyway, can I compile Stalin Scheme to C, or is there a high performance
> scheme that will compile to C? It will allow me to get my work done
> fastest, and most naturally suite my logics. I am very excited in
> hearing that it can compile to C.

There are several Scheme-to-C processors that I know of, and there are
lots of published speed benchmarks. The ones I can recall off the top of
my head are bigloo, larceny, gambit-c and chicken. I personally like
gambit-c because it has an Erlang-like lightweight process extension
called Termite. And I'm pretty sure Chicken has a SWIG interface, which
means you could drive common C libraries from both Chicken and Ruby via
SWIG.

If you head over to comp.lang.scheme, I think you'll get plenty of answers.


Chad Perrin

12/18/2007 10:26:00 AM

0

On Tue, Dec 18, 2007 at 03:35:10PM +0900, tho_mica_l wrote:
>
> You can also compile ruby to C.

(perhaps slightly off-topic)

What tool(s) would you recommend for that?

--
CCD CopyWrite Chad Perrin [ http://ccd.ap... ]
Amazon.com interview candidate: "When C++ is your hammer, everything starts
to look like your thumb."

ThoML

12/18/2007 1:02:00 PM

0

> What tool(s) would you recommend for that?

The full sentence probably should have been: There are a few scripts
that translate a subset of ruby to C. I don't think they are ready for
prime time.

With respect to "stalin", IIRC early editions of the language shootout
included timings for this compiler.

John Joyce

12/18/2007 1:31:00 PM

0

There is a backward way of using Objective-C
You create a lib in Objective-C and then use the RubyCocoa approach...
Of course, this isn't very portable...

jwmerrill@gmail.com

12/18/2007 3:17:00 PM

0

On Dec 17, 11:32 pm, Sharkie Landshark <shark.fin.s...@mac.com> wrote:
> I want to write my core logics in a compiled language for 1) performance
> and 2) protecting my source code -- in case I will be selling my product
> to a customer.
>
> What would be the most natural-supported-easy-fast language to do this
> in, given the many choices of language bridges?
>
> I am particularly interested in,
>
> 1) C
> 2) Objective C
> 3) Ocaml
> 4) Lisp (SBCL)
> 5) Scheme
>
> Does anyone have experience and would like to share?
>
> I will be coding in OS X and deploying in FreeBSD mostly.
>
> Thanks
>
> Shark
> --
> Posted viahttp://www.ruby-....

There's rocaml: http://eigenclass.org/h... . Never used it,
but thought I'd mention it.

JM

Vitor Peres

12/18/2007 4:24:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

On Dec 18, 2007 4:10 AM, Sharkie Landshark <shark.fin.soup@mac.com> wrote:

> I am thinking of Stalin Scheme, and that is because I hear it is fast.
> My first programming language is Scheme, and that is still my favorite.
> I like Ruby because I find it similar to Lisp/Scheme -- in a strange
> way.
>

Stalin is great, and all, but it isn't a full Scheme implementation (AFAIK
it's mostly R4RS compatible). It's fast, indeed, but if you're thinking of
enjoying Scheme in its entirety, I don't think it's the best choice.

--
Vitor Peres (dodecaphonic)
------------------------------------
http://twitter.com/do...

SunRaySon

12/18/2007 4:29:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

I had developed some applications using smalltalk but they are small utility
programs. I would prefer smalltalk for utility programs but I am not sure if
this is a good choice for getting good performance.

Kiran

On Dec 18, 2007 8:49 PM, jwmerrill@gmail.com <jwmerrill@gmail.com> wrote:

> On Dec 17, 11:32 pm, Sharkie Landshark <shark.fin.s...@mac.com> wrote:
> > I want to write my core logics in a compiled language for 1) performance
> > and 2) protecting my source code -- in case I will be selling my product
> > to a customer.
> >
> > What would be the most natural-supported-easy-fast language to do this
> > in, given the many choices of language bridges?
> >
> > I am particularly interested in,
> >
> > 1) C
> > 2) Objective C
> > 3) Ocaml
> > 4) Lisp (SBCL)
> > 5) Scheme
> >
> > Does anyone have experience and would like to share?
> >
> > I will be coding in OS X and deploying in FreeBSD mostly.
> >
> > Thanks
> >
> > Shark
> > --
> > Posted viahttp://www.ruby-....
>
> There's rocaml: http://eigenclass.org/h... . Never used it,
> but thought I'd mention it.
>
> JM
>
>