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.

Compiler Explorer

135 pointsby kerckerabout 9 years ago

10 comments

mattgodboltabout 9 years ago
It&#x27;s not very discoverable but there are sister sites for Rust, Go and D:<p><a href="https:&#x2F;&#x2F;rust.godbolt.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;rust.godbolt.org&#x2F;</a> <a href="https:&#x2F;&#x2F;go.godbolt.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;go.godbolt.org&#x2F;</a> <a href="https:&#x2F;&#x2F;d.godbolt.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;d.godbolt.org&#x2F;</a>
评论 #11675021 未加载
评论 #11672320 未加载
评论 #11674514 未加载
评论 #11674114 未加载
评论 #11674802 未加载
评论 #11674150 未加载
评论 #11672933 未加载
评论 #11672608 未加载
znpyabout 9 years ago
I would like to point out that compiler explorer is very easy to extend with other toolchains and that Matt Godbolt is a very nice person.<p>I extended Godbolt&#x27;s Gcc Explorer adding other toolchains (Motorola 68000 and MIPS, built with crosstools-ng) beside the standard AMD64 one, and released as a Docker image.<p>I did this because... I had to read and write M68k code for a class, and having GCC generate code for me (with -O0 and the colourisation feature) was the easiest way to get some code to read, besides the very basic examples)<p>In case you have to work with MIPS or M68K, you can find my &quot;version&quot; here: <a href="https:&#x2F;&#x2F;hub.docker.com&#x2F;r&#x2F;esantoro&#x2F;acso-explorer&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hub.docker.com&#x2F;r&#x2F;esantoro&#x2F;acso-explorer&#x2F;</a><p>IIRC, the bundled gcc is version 4.9.something
aapplebyabout 9 years ago
This is a fabulous tool for exploring micro-optimizations across a range of CPUs.<p>I&#x27;ve used it for investigating how some inner loops get pipelined across AVR, ARM+Thumb, ARM32, ARM64, PowerPC, x86-32, and x86-64 processors.
rryanabout 9 years ago
This site is so handy -- if it&#x27;s useful to you too please Flattr the author so they can continue to host it. It&#x27;s been a helpful tool to be able to link people to code+assembly when trying to convince people not to &quot;optimize&quot; code in code reviews :).
willvarfarabout 9 years ago
Excellent!<p>LLVM used to have an online compiler page but IIRC they took it down due to security concerns.<p>Of course I have a couple of suggestions ;) :<p>What this needs is synchronized scrolling ala <a href="http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;21410675&#x2F;getting-the-original-variable-name-for-an-llvm-value" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;21410675&#x2F;getting-the-orig...</a><p>And would be nice if it can show intermediate steps (the AST, the IR) in parallel or show different optimisation levels beside each other too.
评论 #11676332 未加载
teraflopabout 9 years ago
Some of the examples are broken because they use C++ language constructs but they&#x27;re being compiled as C code, which leads to error messages like:<p><pre><code> 13 : error: &#x27;static_cast&#x27; undeclared (first use in this function) input = static_cast&lt;int*&gt;(__builtin_assume_aligned(input, 64)); ^</code></pre>
评论 #11673301 未加载
mrichabout 9 years ago
Suggestion: Add a switch to show C&#x2F;C++ code lines next to the created assembly. This is very helpful for learning.<p>In gdb you can get this with disassemble &#x2F;m, or with objdump -S.<p>Helped me a lot in the past.
评论 #11672944 未加载
ameliusabout 9 years ago
Suggestion: make the opcodes clickable, leading the user to the documentation of the opcode.
评论 #11674234 未加载
tempodoxabout 9 years ago
Great tool! I sometimes do the same locally to check out language behaviour, but most of the time it&#x27;s just one compiler. This tool lets me see compiler differences and the evolution between compiler versions. Nice.
gravypodabout 9 years ago
I&#x27;ve used this to help friends fudge their CS homework in a CS class.<p>It&#x27;s an assembly class that&#x27;s impossible since you aren&#x27;t taught, so they can write their labs in C and decompile it to make it easy.
评论 #11673989 未加载