DEV Community

Discussion on: Why programming languages are slow

Collapse
 
kopylov_vlad profile image
Vladislav Kopylov • Edited

And I just want to clarify one point:

Second of all java and c# compile to byte code, not python and what other language you typed there.

Each modern interpreted language doesn't read and execute each line of the source code at the same time. Honesty they aren't "pure" compilation languages.

Starting with Ruby 1.9 the official Ruby interpreter implementation switched to YARV ("Yet Another Ruby VM"). It pre-compiles Ruby into bytecodes. Once Ruby source code is converted to bytecode, a VM executes the bytecode. Converting source code to bytecode gave significant speed advantages to Ruby.

Python source code is also compiled to bytecode. In Python, you can directly observe it in the .pyc files. In Ruby 2.6.0 we have Just-In-Time compiler (JIT). It compiles instructions that are used often into optimized binary which runs faster.

So these languages are a hybrid of compiled and interpreted code.