TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Which is the fastest programming language and why?

2 pointsby notforgotover 8 years ago
What's the best way to take any program and make it run as fast as possible? Feel free to go crazy on imagination here.

2 comments

tjalfiover 8 years ago
Here are a few ideas:<p>Use an extensible compiler and targeted optimizations. <a href="https:&#x2F;&#x2F;mitpress.mit.edu&#x2F;books&#x2F;automatic-algorithm-recognition-and-replacement" rel="nofollow">https:&#x2F;&#x2F;mitpress.mit.edu&#x2F;books&#x2F;automatic-algorithm-recogniti...</a> is an excellent book on this topic.<p>Use a cluster to evolve the best settings for compile options, executable layout, instruction scheduling, etc. There is a paper from a Google author about doing this for prefetching.<p>Use an ILP solver for register allocation, instruction scheduling and other problems that are normally solved with heuristics. The size of the program may make this intractable. There was a startup that used this approach for a custom programming language targeted at Intel&#x27;s network processors.
imaginenoreover 8 years ago
(Assuming, we&#x27;re not talking about distributed solutions)<p>The fastest way would be to create an ASIC: hardware designed to run your algorithm specifically.<p>Something simpler and a bit slower would be an FPGA.<p>Below that is a GPU implementation of your code, assuming it can be parallelized.<p>Below that is hand-crafted assembly by someone who is smarter than a good compiler.<p>Below that is hand-crafted C&#x2F;C++ or Fortran code.<p>Here are benchmarks of various languages for various problems:<p>N-body: <a href="https:&#x2F;&#x2F;benchmarksgame.alioth.debian.org&#x2F;u64q&#x2F;performance.php?test=nbody" rel="nofollow">https:&#x2F;&#x2F;benchmarksgame.alioth.debian.org&#x2F;u64q&#x2F;performance.ph...</a><p>Spectral-norm: <a href="http:&#x2F;&#x2F;benchmarksgame.alioth.debian.org&#x2F;u64q&#x2F;performance.php?test=spectralnorm" rel="nofollow">http:&#x2F;&#x2F;benchmarksgame.alioth.debian.org&#x2F;u64q&#x2F;performance.php...</a><p>Digits of pi: <a href="http:&#x2F;&#x2F;benchmarksgame.alioth.debian.org&#x2F;u64q&#x2F;performance.php?test=pidigits" rel="nofollow">http:&#x2F;&#x2F;benchmarksgame.alioth.debian.org&#x2F;u64q&#x2F;performance.php...</a><p>FASTA: <a href="http:&#x2F;&#x2F;benchmarksgame.alioth.debian.org&#x2F;u64q&#x2F;performance.php?test=fasta" rel="nofollow">http:&#x2F;&#x2F;benchmarksgame.alioth.debian.org&#x2F;u64q&#x2F;performance.php...</a>
评论 #13531157 未加载