Gully Foyle <nospam / nospamnospamnospam.com> wrote in message news:<hXHKc.38807$eH1.18448437 / newssvr28.news.prodigy.com>... > I am currently using C++ as my compiled language but fell in love with > Ruby recently :) > > Which compiled language is the closest to ruby? Isn't that obvious? C++, of course. > Are there any that are > object-oriented Both C++ and Ruby are multi-paradigm languages that support OO programming, but don't try to enforce OO programming. (Unless, of course, you define OO to necessarily include dynamic typing. And please note that I also understand that Ruby is implemented in an OO-centric way - "everything is an object" - but my point is that, unlike with (earlier versions of) Java, C#, etc., you can write (and call) free functions, you can write generic code without casts, you can write "functional" code, ... That's multi-paradigm programming.) > and have support for blocks/closures? OK, C++ doesn't support blocks/closures, but with templates and function objects etc. you can get fairly close. (Using libraries like function, bind and lamda from boost it's even quite easy and straightforward to write.) Furthermore: The way STL algorithms work on iterators using function objects is - from a somewhat high-level, design oriented perspective - very similar to the iterator stuff in Ruby. C++ has operator overloading similar to Ruby. Policy-based design - often implemented using a combination of templates and inheritance - is something like module mixin in Ruby. The way blocks can be used in Ruby to encapsulate resource aquisition and release, e.g. passing code to the open method of file, is similar, even if somewhat turned inside-out, to using RAII in C++. Of course, Ruby is dynamically typed, dynamically evaluated and it's type system can be manipulated directly at run-time. But these are issues that are central to the compiled/interpreted distinction, unless you define compiled language in a very loose way. When I first learned about Ruby, I instantly liked it, thinking: Hey, that's great, all the cool techniques I have been using in C++, especially when programming with STL and stuff (boost, Loki, whatever ..., and that I really like to use with C++, will be available in Ruby, too.