If I make a JVM in Java, for example, is it possible to make the implementation I made actually faster than the original implementation I used to build this implementation, even though my implementation is built on top of the original implementation and may even be dependant on that implementation?
( Confusing... )
Look at PyPy. It's a JIT Compiler for Python made in Python. That's alright, but how can it claim to be faster than the original implementation of Python which it is using and is dependent on?
The predominant characteristic that is considered to make a language fast is how well its data types correspond to machine data types. Java is considered to be an efficient language because it has primitive data types.
Simple answer is, the closer a language is to the hardware the faster it would be. The more a language depends on libraries and other functions to do it's tasks the longer it takes for program execution in that language.
Interpreted Language: One More StepBecause these languages don't need prior compilation, programs written in them are generally much easier to make and test. As a result however, the software itself can be significantly slower. Interpreters execute the source of a program line by line, which incurs a speed penalty.
C++ is one of the most efficient and fastest languages. It is widely used by competitive programmers for its execution speed and Standard Template Libraries(STL).
You are confused between a language and the execution apparatus for that language.
One of the reasons why PyPy can be faster than CPython is because PyPy is compiled to a completely separate native executable, and does not depend on, nor execute in, CPython.
Nevertheless, it would be possible for an inefficient implementation of one language to be surpassed by an interpreter written in that same language, and hosted in the inefficient interpreter, if the higher-level interpreter made use of more efficient execution strategies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With