From: schnitkerAffenschaukel@... (Uwe Schnitker) Date: 2004-07-22T15:12:03+09:00 Subject: Re: Which compiled language is closest to Ruby? "Robert Klemme" wrote in message news:<2m73fjFjuibcU1@uni-berlin.de>... > "Uwe Schnitker" schrieb im > Newsbeitrag news:30381f67.0407210016.4d0e6a33@posting.google.com... > > "Robert Klemme" wrote in message > news:<2m4dhrFis860U1@uni-berlin.de>... > > > "Uwe Schnitker" schrieb im > > > Newsbeitrag news:30381f67.0407192151.25675ec2@posting.google.com... > > > You are kidding, are you? > > > > No. > > That's what I figured when reading on. :-) OK, since the central arguments have been exchanged, I'lll just add a few classifications. > > > In Ruby, everything is an object and every method > > > has a receiver. > > > > Yes, and this has some nice effects. > > > > But I find it important that you can ignore this: I can, e.g., > > write a global function in Ruby like I could write it in C++, > > even if it's implemented in a totally different way. > > Well you can, but that does not have any implications on the OO-ness. :-) Oh, it has: You can write code ignoring the OO-ness. You don't have to write a class, etc ... The OO-ness doesn't get into the way when I don't want to use it conciously. > > I just wanted to take into account that Java and C# are being > > enhanced with generics now. The "earlier version" I wrote about > > are what is currently used. > > I was referring to > > "... but my point is that, unlike with (earlier versions of) Java, C#, > etc., you > can write (and call) free functions, ..." > > I don't know whether there was ever a Java version that didn't have > 'static', but if there was, this must've been quite an old version. So > maybe your wording was just a bit confusiong (at least for me). I consider the use of static functions inferior to free functions. In a language where an int is not of class type I want to write sqrt(x) but not Math.sqrt(x). The new Java version makes it possible to import statics so that you can call them as if they were free functions even if they are static ones. But of course, the Math.sqrt example is just a little ugly. More important is the abillity to write free template functions. Template functions are essential in C++ for compile-time type deduction. > > (I just wish that someone with more relevant > > experience would write a Boost.Ruby lib soon.) > > What's in boost that we don't have in Ruby at the moment? I don't know > boost good enough, maybe you can shed some light on this. No, no, Boost.Ruby should be like Boost.Phyton, i.e. allowing for easy wrapping of C++ classes and functions to be used from the other language. It's something like SWIG, just easier to integrate and use and also more powerful. With Boost.Phyton you can write your application in Phyton and write performance-critical stuff in C++, or just integrate existing C++ libraries for that. You can also doing prototype implementation in Phyton and gradually replace them with C++ code, e.g. you can write a class doing matrix math or image processing, first write all functions in Phyton, and then replace just those member functions you want or need to with C++ ones by overriding them in a derived class. And you can use a unit testing framework in Phyton to test your C++ code, even if your whole application is written in C++. I'd just love to be able to do all that with Ruby instead. > Thanks for the interesting exchange! Ditto. > Kind regards > > robert Uwe