Live data from Hacker News

Which programming language or compiler is faster

programming-language-benchmarks.vercel.app

61–70 of 90 posts

Re: Which programming language or compiler is faster

#61

Julia always seems to rank #1 or close to it when compared to other interpreted languages but I only ever see it used for research and math. Why doesn’t anyone use it for anything else?

Its ridiculously large memory usage might be a reason.

Re: Which programming language or compiler is faster

#63

What does it even mean for a language to be faster?

Strictly speaking it's meaningless, since a language is a set of syntax and semantics. Pragmatically though, when people talk about the speed of a language they actually mean the typical performance of processes defined by programs written in that language, which of course depends on the code generator and runtime, among other things.

There's nothing stopping anyone from writing a fully standards compliant C interpreter that will have considerably slower process execution after all. In fact, a quick search shows that it's been done many times, for example this[1].

[1] https://github.com/jpoirier/picoc

Re: Which programming language or compiler is faster

#65
post #26

Earlier quoted context omitted.

On a single core processor, obviously not, but massive C++ codebase are compiled with multicore CPU, and often distributed. The advantage of the header inclusion model is you get an bunch of independent compilation units, and so it's straight forward to parallelize. A common way to speed things up even more is to merge some cpp file together, so each compiler thread is active for longer and common headers are compile…

You show me that IDE for C++ who is using those multicore CPU's for compilation who's faster than Delphi, for same number of lines and/or external dependencies. Btw, Delphi is still using 32 bits for its IDE and a single core and still blows out of the water anything else in terms of millions of lines of code compilation time.

I wondered if Delphi supported LTO (as that's one of the main compile-time-eaters) and the only examples I could find of sentences containing both "Delphi" and "LTO" referred to Delphi support for TAPE DRIVES (https://wikipedia.org/wiki/Linear_Tape-Open). Of course prehistoric tech is faster, running a 1995 game on a i7 would also be fast. What matters is, is Delphi able to match C++ in run-time benchmarks ?

Also, here's a video of my edit-compile-run cycle ; cloc on that project gives me 506963 loc without counting dependencies. The software uses boost and fairly modern C++ with no particular feature restriction and templates going wild. It's not instant, but still, 2 seconds is somewhat tolerable (and definitely faster than various web stuff I've been involved with)

https://streamable.com/az397y

Re: Which programming language or compiler is faster

#66

Julia always seems to rank #1 or close to it when compared to other interpreted languages but I only ever see it used for research and math. Why doesn’t anyone use it for anything else?

During it's development Julia was heavily promoted as a language for scientific computing.

Nowadays, the language is promoted as a general purpose language suitable for any task or domain.

However, the perception that Julia is primarily for scientific computing remains strong among many developers. Only time will tell if that perception changes.

Re: Which programming language or compiler is faster

#68
post #7

This is a really strange benchmark to use. Compiler speed is not an issue for these 100ish line standalone benchmarks. The question is how fast it is for a million-line project or worse. I doubt c or c++ do good there with their header file includes for dependencies.

I think the title might be misleading you, when it mentions compiler speed, it means, for the same language there are different compilers. It's about runtime speed of different languages and different compilers for those languages

Re: Which programming language or compiler is faster

#69

The faster programming language or compiler is the one you use. Always.

This is almost never the criteria people use as it is often not that important. Productivity is often a bigger factor. Security and Robustness is another factor. Libraries is another, portability, Platform limitations, Domain problem to be solved. Most software these days isn't really constrained by speed, if the software ran 10x faster, you'd only get marginal gains.

Re: Which programming language or compiler is faster

#70
post #29

Julia always seems to rank #1 or close to it when compared to other interpreted languages but I only ever see it used for research and math. Why doesn’t anyone use it for anything else?

Julia is incredibly slow to compile. Far worse than C++ last time I tried. For interactive notebooks, I found it’s common to have a single line take a couple minutes to compile - it’s simply not interactive in the way Python is, despite having good runtime performance once compiled. The deal breaker for me is that its compiler is JIT based whether you want it or not. Code will hang at runtime for multiple minutes as…

This is absolutely false in my experience. You pay for startup (100 ms on my system, I think) and for initial compilation, which has still been decently fast for me. Beyond that it's very fast.
Post reply on HN