3 ms·
> Better have a compiled language, even if its within a VM, like C# or Java, rather than interpreted ones like JS or python I'm not sure you understand how the
by zumachase 6y ago
> Better have a compiled language, even if its within a VM, like C# or Java, rather than interpreted ones like JS or python
I'm not sure you understand how these languages work as none of the are truly compiled in the sense I think you mean (natively). Both Java/C# and Javascript work in the same way: they are compiled to bytecode which is then interpreted. The only difference is that Java/C# is compiled AOT whereas V8 (presumably) compiles on first execution and caches the output. Python is a truly interpreted language although PyPy can give a huge perf boost.
- kumarvvr 6y agoYour comment caught me by surprise. For one, I am under the understanding that strongly typed languages like C# and Java, are optimally compiled to bytecode such that the overhead of running in a VM is minimal and performance is comparable to native code. I maybe wrong, I dont have a up to date knowledge of JS runtime and optimizations, but for such a dynamic, loosely typed language, there is only so much AOT and optimization you can do. V8 might have bridged that gap a fair bit, but is nowhere close to performance of C#. However, in almost all benchmarks, for real world use cases, .net always trumps JS runtimes.Also, a developer needs a high level of awareness and knowledge of underlying systems in JS to write performant code. The same is not true with C#, in the sense that as a seasoned developer, the strongly typed nature of C# mostly saves me from writing poorly performing code. I dont have to worry too much about underlying mechanisms in C#. Edit : https://stackoverflow.com/questions/35457486/performance-and-memory-differences-between-c-sharp-and-javascript https://stackoverflow.com/questions/35457486/performance-and... I found this. So, a program made for performance comparision between C# and JS would probably be equally fast in both. However, JS loses performance in real world due to its dynamic typing.