4 ms·
If you are are looking for a mature high performance language to keep in your back pocket for the cases where you can't use node, Java seems like a fair bet. Go
by Skunkleton 7y ago
If you are are looking for a mature high performance language to keep in your back pocket for the cases where you can't use node, Java seems like a fair bet. Go would also be useful. Neither are too much fun IMO, but that would fit the bill.
There are newer languages that are more interesting, but picking one of those is more about either attempting to anticipate where the industry is going, or just plain wanting a more fun language. Rust is an example here. Personally I think rust is worth learning, and has a fair shot at taking over a large chunk of software development that would have previously gone to C or C++. Learning rust might make you a better programmer because lots of poor-programming-hygiene type things are compiler errors in rust.
If you just want a way to wring maximum performance out of a piece of hardware, then I would caution you to consider your choice carefully. Writing high performance code requires a complete understanding of the stack underneath you. If you want to see my point in practice go check out the programming languages shootout. Specifically notice that there are benchmarks implemented in "fast" languages that are outperformed by better optimized code written in "slow" languages.
I would recommend against C++ unless you are planning on devoting a very large amount of time to learning it well. I also don't personally like C++. Too many footguns.
- saagarjha 7y agoJava has a JIT too…
- pjmlp 7y agoAnd AOT as well.
- acqq 7y ago> notice that there are benchmarks implemented in "fast" languages that are outperformed by better optimized code written in "slow" languages. I haven't observed that, at least not where one can't write a "better optimized" code in the "fast" language too. Can you give any specific examples?
- Skunkleton 7y agoSorry, I wasn’t clear. On shootout they have multiple implementation of each benchmark in the same language. The fastest implementations are always fast languages, but there are lots of implementations in fast languages that are bested by better implementations in slow languages[1]. The point I was trying to make is that picking a fast language isn’t enough to write truly fast programs. 1. https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/mandelbrot.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- acqq 7y agoBut even that doesn't follow from the link you give: the slowest C++ entry is taking 54 seconds there. But I don't see any, for example, Python code which is faster. There is node.js code which is fast, but we know that node.js depends on really, really, good JIT, which doesn't make it "slow language" in my view. The node.js implementation also uses all CPU cores, so we should at least compare among the implementations which also use all CPU cores. So in this case it's less "an algorithm" in the narrow sense and more "is it written to use all CPU cores effectively" and is it using the JIT to run the code compiled to the native. Other languages with good scores are also all that can do a good JIT and use all the CPU cores, which yes, confirms that good JITs are really good. Which still also doesn't mean that I don't know (or have happened to know) enough incompetent programmers who would, indeed, make even worse performing C++ than any entry that we see in the Benchmarks game. I could write a whole article about all the things they would or could do wrong. I only wanted to see the examples in "the Benchmarks game" specifically.
- Skunkleton 7y agoIts really hard to be slower than python, unless you are using ruby. Considering that the parent was asking about node, that is what I was looking at. While V8's performance is hugely impressive, it is still significantly slower than other languages. I'm not sure what you are trying to say though? My point was that you have to develop expertise before you can create high performance programs. If you are considering dropping node because you need more performance, be careful.