Can a Programming Language Be Called Slow?
Often I read on blogs and such of how one cannot call a given programming language slow - that's it's the individual implementation of the language or a runtime which is to blame. Here is an example of such a post.
I disagree.
If we look at core language specifications, it become abundantly clear that a programing language can, by it's very own specification, be considered slow. As a point of comparison, I'm going to use 2 different languages which I use regularly - Ruby and Java.
First off, here is an explanation using simple arithmetic. Under Ruby, absolutely everything is an object (even null/nil values, which are expressed as NilClass). Even if you just have a "def xyz" in your source file, the runtime still attaches that method to the base "Object" class. Java is also object-oriented, but support native datatypes (boolean, int, long, float, double, char, byte, short). Without even delving into anything too technical, we can already guess which one will always execute arithmetic faster. Since everything in Ruby is an object, any runtime implementation would inherently have to deal with the overhead of maintaining objects. This would not be the case under Java.
Even if we consider a simple variable (although in the case of Java, we also have to consider the benefit of compilation in relation to speed). Since Java is static-typed, every step of the actual execution makes no guesses as to what type of object or value is being acted upon. Native datatype conflicts are captured in the compilation stage. By contrast, Ruby objects must continually be inspected, introspected and queried to see if the object is capable of satisfying a particular function.
These aren't cases of poor implementations, or a faulty runtime - these are artifacts of the language specifications themselves. Given the inherent limitations and overheads imposed by the specifications themselves as illustrated above, I think it's fairly safe to call a language slow. And, fans, let's be honest about one thing - Ruby is slow. Is it acceptable speed-wise? That's entirely up to the programmer and the user to decide.
Comments
There are no comments for this post.
Add comment
Visit my Friends and Family
If you've enjoyed my site, please take a moment to visit my friends and family, many of whom have some interesting insights, and entertaining thoughts and ideas.
- Crause Family - the family website
- Peter Crause - my father
- Justin Crause - my brother
- Cencina Photomagic - great photographer
- Shawn Adrian - talented graphic designer, bad driver, and all-round fun guy