47 points · by delinquentme · 15y ago · 21 comments
The stock mri vm has a gil, and historically, with 1.8, a very naive iterpreter+garbage collector. 1.9.x helps with this, but still suffers performancewise unless you get into massive object creation/etc...
The difference is alternative implementations like jruby+rubinius can drastically shave time off of computation. Much like the difference of CPython to pypy. If however you're overly worried about computational speed and need to have the fastest possible speed bar none, then do the right thing and use c++/java/c. But for exploratory learning or non-time critical computation, why not use a language like Ruby or Python or Lua or whatever?
2) Will learning to program C++ throw off my ruby mojo? Can you speak from the perspective of someone whos fluent in multiple languages?
2) Why would it? I won't say I'm fluent in c++, but thats mainly due to not having to use it daily. That and I prefer straight c normally, I tend to dig into kernel source and drivers often so c++ isn't a big deal most times.
But don't let language preferences of anyone guide you, evaluate what works best and use it for your problems. I like ruby in general but sometimes python is a better choice, other times perl, other times c, or even shell. Don't optimize code you haven't written yet. Explore the domain with ruby if you want and write a faster version in c once you understand the problem. Or java or whatever.
I'd leave C++ alone for the time being. Once you've explored the concepts in a simpler, higher-level language you can start to think about making them fast.
But, like you say, there's nothing wrong with using a lighter-weight language to explore. Although Python with numpy/scipy and Matlab/Octave are way ahead here.
And agree on the python bit, ruby may win for a web language/system administration bits, but python definitely has the leg up with support and use in the sciences.
^^ is this the case in terms of speed? or are you saying ease of exploratory programming?
http://www.reddit.com/r/aiclass/comments/jkg6v/stanford_open...