DEV Community

Discussion on: Thoughts on interpreted vs compiled languages?

Collapse
 
yaser profile image
Yaser Al-Najjar

Compiled languages just win on everything (performance, reliability,

But, most famous enterprise backend langs (Python, C#, Java... etc) are using both of the best worlds... they get compiled into some special binary format, then an interpreter on any platform (android, ios, win, linux) gets that special code and execute it.

All that to achieve super cross-platform, and they do work on virtually all devices.

Ah, JS is an exception :D

Collapse
 
jj profile image
Juan Julián Merelo Guervós

You can't just "win" at performance. It will depend on payload. Languages such as Perl might be faster at regexes than compiled languages (whose implementation is, often, based on Perl). Compiled languages have a wide range of performance on a wide range of features; interpreted languages too, and they often overlap.
Some interpreted languages, like Perl 6, have a JIT compiler that optimizes a program as it runs. All optimizations for compiled languages are done at compile time. So you would really have to look at particular payloads.
Ditto for reliability. I can't see C being more reliable than Haskell, for instance.

Collapse
 
yaser profile image
Yaser Al-Najjar

You can't generalize just because Perl regex "seemed" faster... you were programming since the 19s and not everyone did like you, so you know why a low-level lang like Assembly should be faster than writing the same app in C.

Same goes to interpreted languages, it all depends on the implementation. If Perl is faster than Java in regex, it means their implementation is just faster... nothing more.

C / C++ are just faster than any other lang (given we use the latest compiler optimizations and the right implementation of the software)... Perl interpreter itself is implemented in C & C++.

All the people here agree on this point: news.ycombinator.com/item?id=8626131

Ditto for reliability. I can't see C being more reliable than Haskell, for instance.

From my experience, run-time errors occur more in interpreted languages than compiled languages. I do Python and C#, and I face lots of run-time errors in Python than C#.

Thread Thread
 
jj profile image
Juan Julián Merelo Guervós

Well, Java is slower than almost anything in Regexes (and apparently buggy), according to this post: attractivechaos.github.io/plb/ Lua clocks in very good time, and Javascript (interpreted, with a JIT compiler) is faster than C# (compiled to bytecode).
This is only a particular case, dealing with regexes. In general, you can't make a sweeping statement on general performance. Your mileage might vary depending on the actual application you are running, and the actual implementation you use (different compilers will have different performance, for instance).

Thread Thread
 
yaser profile image
Yaser Al-Najjar

I agree on what you say.

All that being said, the performance difference isn't really affecting the business cuz most companies, banks, and organizations are happy with Java & C#.

So, I really think it's pointless to make a decision out of these metrics.