From: Robert Klemme Date: 2004-07-01T20:12:50+09:00 Subject: Re: Why I don't use Ruby. I totally agree with you. "gabriele renzi" schrieb im Newsbeitrag news:1rp7e0dc0bgkm0t82r1rk2ta126ut75iuf@4ax.com... > il Thu, 01 Jul 2004 04:43:49 -0500, TLOlczyk ha > scritto:: > > > This message may be trollish, but it seem it is'nt :) > > >The first comment I would make is that I base my desires on features > >provided in languages created in the functional programming community. > >Languages such as Scheme/SML/OCaml/Haskell. [..] In > >effect most of these systems give short shrift to Windows. I preffer > >my code to work more or less the same on both types of OS. > > > have you tried DrScheme ? The GUI environment is based on wxwindows > and runs quite fine on windows. > > >The main thing I am looking for is a basic environment similar to > >functional languages. In particular a ( native-code ) compiler and > >an extensible REPL. By REPL I mean read-eval-print-loop, a fancy > >word for interpreter. To make clear what I want, and why I think > >it is a superior approach, I will now explain how it is used. > > Why do you feel the need for a native code compiler, > Do you expect better performances or something else? > > Anyway, about REPL env, that's what IRB is for: > >> def f > >> 10 > >> end > => nil > >> f > => 10 > >> > > >Typically you open the file you are working on in emacs,vi or > >an IDE. ( Typically it would be emacs or vi. The IDEs available > >tend to be too primitive. Other editors might do but I am not > >aware of them. ) The you split the session into two windows > >and start your REPL in one.[..] > > I think ruby-mode.el allows this. I usually do this in different > terminals, anyway, but that's quite subjective. > > > > >Afdter a while the file is complete. Then you compile it into a > >library file or application. This way you get the speed of a compiled > >program with the flexibility of an interpreted program. And in > >some cases you need the speed. In others you don't. In others > >you don't know (eg libwww). Of course it would be nice to be > >able to build new REPL with libraries incorporated, or at > >least specified on the commandline. > > I'm not sure what you intended with the last statement, maybe > irb -r mylib > > It's really agreeable that better performance would be nice. I think a > JIT would be ok, anyway. > > If you feel that speed is such an important thing in your application > field, and that current C libraries or ruby extension are not a good > fit, I completely agree with you, ruby is not fine. > > OTOH IIRC there are some effort to build ruby2c, ruby2asm, and JIT > compilers for ruby. I hope those will mature with time, but I > understand you can't care about them. And, for real high performance requirements it's likely that Ruby - whether compiled to native or whatever - will not reach the mark that can be set languages like C and C++. The dynamic nature does cost some performance. If performance is paramount one either has to use another language or write an extension that does the performance critical things. > >It would also be nice to have an optional core/image. > >That way if I run tests where testing uses a lot of data, > >I can save images when i debug later stages and > >save myself some time initializing. > > I'm not sure what you mean here. Do you want to freeze the interpreter > in a given state? Or do you feel the need for some serialization > format that can be retrieved at any time fast? (in this case Marshal > could fit, maybe?) I'd use Marshal for that. I even once wrote a function that automatically loads the marshalled representation of a file if that is unchanged and otherwise loads the file. Marhshall is pretty fast indeed. Regards robert