4 ms·
> Your language, that was made in c/c++, can hardly be faster than the language it was written in What if the language you wrote includes a run-time that does
by randomsearch 7y ago
> Your language, that was made in c/c++, can hardly be faster than the language it was written in
What if the language you wrote includes a run-time that does JIT?
- IcePic 7y agoand the JIT is written in...
- naikrovek 7y agoI am bemused by C and C++ fanatics who simply do not and apparently can not see beyond C and C++. Like it is impossible for society to surpass those languages, and that everyone will use them a million years from now... We will obviously still have them for a while, but anyone that thinks we have reached maturity in an industry that is around 50 years old is just not thinking objectively.
- randomsearch 7y agoThe JIT compiler is written in C. Its output is assembly code. That assembly code can outperform code written in C, because it has access to dynamic run time information that your C compiler does not.
- stiray 7y agoThis would be "equivalent" but as jit has to process it first (overhead) and code here is just executing binary code, it will be faster. I am not talking here about readability, how much knowlidge is behind etc. #include <unistd.h> char code[] = "\x01\xb8\x00\x00\xbb\x00\x00\x2a\x00\x00\x80\xcd\x00"; int main(int argc, char argv) { int (func)(); func = (int ()()) code; (int)(*func)(); return 0; } This whole sharade of how fast the language is a nonsense. There are other metrics that are more important TODAY, the industry needs languages that are maintainable, can be used by cheap workforce that is simple to find anywhere and dont need to know much about computers, memory,... but rather about a problem. Why picking on c/c++ which is not solving any of those problems is such a trendy topic today, is beyond my understanding.
- randomsearch 7y ago> code here is just executing binary code, it will be faster No it won't. JIT-ed code can take into account dynamic information, and therefore outperform even the best general static compiler.
- deleted 7y ago[deleted]
- stiray 7y agoI have written the (bogus) code in assembler and executed it using C, there is nothing compiled about it. Without any dynamic information as there is nothing dynamic about it. There is nothing to outperform/optimize it will run at max speed on specific architecture. Compiler is only involved to do a 'call'. Same as with JIT. But hand optimized. Let me repeat it, stop this stupid evangelist wars. They are nonsense. Who cares about C speed when the lasagna with spaghetti frameworks are run on daily bases. Speed is irelevant today for almost all cases as no one is prepared to pay for it. And nobody cares about those left.