Programming Languages

Things aren’t just black and white.

In general, we can divide all programming languages to the following two categories, within which we can come up with more detailed categories. But many of them fall into the concept what we call “platonicity”, that is to say, they are not the properties of the thing itself but a platonic form humans assigned.

Static Typed

A static typed language (C, C++, Java, etc) is designed to optimize hardware efficiency, so that the code you write executes as quickly as possible.

But they can be different from each other for that Java is a dynamically compiled language, and C/C++ is a statically compiled language.

Dynamic compiling means that the language is compiled to machine code while the program is being executed, not before. This allow just-in-time(JIT) optimization.

Java source code is first compiled into bytecode(.class files) before using JIT compiler.

A JIT optimizer has the advantage that it has much more reliable information about which branches of the code are used most often and how they are usually used, because it can observe the application in action before applying optimizations.
-Philipp

Dynamic Typed

A dynamic typed language (Lisp, Perl, Python, Ruby) is designed to optimize programmer efficiency, so you can implement functionality with less code.

People like to split things into categories, here they come up with a notion called “interpreted(scripting)” and “compiled” languages, but that is not a property of the language but a property of the implementation.

For most languages, most if not all implementations fall in one category, so one might save a few words saying the language is interpreted/compiled too, but it’s still an important distinction, both because it aids understanding and because there are quite a few languages with usable implementations of both kinds.
-delnan

But according to Wikipedia:

Most so-called interpreted languages use an Intermediate Representation(IR), which combines compiling and interpreting. The intermediate representation can be compiled once and for all (as in Java), each time before execution (as in Perl or Ruby), or each time a change in the source is detected before execution (as in Python).

Form this sense, we should at least note that Python is in some way compiled(So is PHP, and Ruby for most of its implementations). The .pyc files are byte code for the Python virtual machine, similar to .class files in Java.

PS

Despite the categories mentioned above, all programming languages are designed to translate human-readable code into machine instructions. And there is no worse or better language, because each of them embodies a paradigm, a way its author and contributors think of the world. And each of them are designed for different purposes.

· 技术笔记