TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Compiler Explorer

541 点作者 disadvantage超过 2 年前

26 条评论

mattgodbolt超过 2 年前
Wow - we&#x27;re on Hacker News again! Hello all, and thanks for the link and discussion! While we&#x27;re here, we recently made some stats public: <a href="https:&#x2F;&#x2F;stats.compiler-explorer.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;stats.compiler-explorer.com&#x2F;</a> (spot the Hacker News spike!)<p>General stuff: we&#x27;re always looking for help; everything&#x27;s open source on GH: <a href="https:&#x2F;&#x2F;github.com&#x2F;compiler-explorer&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;compiler-explorer&#x2F;</a> (the base project, our cloud setup, all our build scripts, etc). The most valuable way to help us is with issues and PRs, or hang out on our Discord (<a href="https:&#x2F;&#x2F;discord.gg&#x2F;zNNgyRKh" rel="nofollow">https:&#x2F;&#x2F;discord.gg&#x2F;zNNgyRKh</a>). Then spread the word, and last we welcome sponsors on GH (<a href="https:&#x2F;&#x2F;github.com&#x2F;sponsors&#x2F;mattgodbolt" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sponsors&#x2F;mattgodbolt</a>) or Patreon (<a href="https:&#x2F;&#x2F;www.patreon.com&#x2F;mattgodbolt" rel="nofollow">https:&#x2F;&#x2F;www.patreon.com&#x2F;mattgodbolt</a>).
评论 #33226565 未加载
评论 #33227202 未加载
评论 #33227716 未加载
b3morales超过 2 年前
A small tip when visiting godbolt: you can use the name of the language you&#x27;re interested in as a subdomain, to get a page immediately set up for that language, rather than starting with the default C++. For example <a href="https:&#x2F;&#x2F;erlang.godbolt.org" rel="nofollow">https:&#x2F;&#x2F;erlang.godbolt.org</a> or <a href="https:&#x2F;&#x2F;rust.godbolt.org" rel="nofollow">https:&#x2F;&#x2F;rust.godbolt.org</a>
评论 #33226103 未加载
评论 #33225785 未加载
choeger超过 2 年前
When I was still programming in C++ that tool was <i>the</i> method to discuss compiler internals and language semantics with colleagues. Just setup a minimal example and share it with your colleagues. Impressive and sad at the same time. Impressive for obvious reasons. Sad, because the language is so confabulated that there is no easy concise way to talk about its semantics.
评论 #33225318 未加载
评论 #33224959 未加载
评论 #33228937 未加载
评论 #33225160 未加载
slavik81超过 2 年前
I&#x27;ve used Compiler Explorer for many years as a C++ developer. When I started working in HIP, I really missed having Compiler Explorer in my toolbox. I&#x27;ve been on leave for the past couple months and I took the opportunity to make some contributions outside my normal work. Consequentially, full support for compiling HIP to AMDGPU assembly was merged last week.<p>Here&#x27;s an example: <a href="https:&#x2F;&#x2F;godbolt.org&#x2F;z&#x2F;qjsErWzcs" rel="nofollow">https:&#x2F;&#x2F;godbolt.org&#x2F;z&#x2F;qjsErWzcs</a>
评论 #33226484 未加载
dorongrinstein超过 2 年前
Thank you Matt Godbolt for creating such a wonderful tool. You&#x27;re as cool as they get!
评论 #33224948 未加载
photochemsyn超过 2 年前
It&#x27;s great that you can now get RISC-V output. IMO RISC-V is the most pleasant way to learn assembly-level programming. For anyone interested here&#x27;s a nice resource:<p><a href="https:&#x2F;&#x2F;riscv-programming.org&#x2F;book.html" rel="nofollow">https:&#x2F;&#x2F;riscv-programming.org&#x2F;book.html</a>
评论 #33226892 未加载
dang超过 2 年前
Related:<p><i>Compiler Explorer</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=24066570" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=24066570</a> - Aug 2020 (48 comments)<p><i>Compiler Explorer</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18671993" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18671993</a> - Dec 2018 (44 comments)<p><i>RMSbolt – An implementation of the Godbolt compiler-explorer for Emacs</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18104167" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18104167</a> - Sept 2018 (9 comments)<p><i>Compiler bug in MSVC?</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=16142512" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=16142512</a> - Jan 2018 (2 comments)<p><i>C compiler undefined behavior: calls never-called function</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15147335" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15147335</a> - Sept 2017 (83 comments)<p><i>GodBolt: Enter C, get Assembly</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13182726" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13182726</a> - Dec 2016 (151 comments)<p><i>Compiler Explorer – now with side-by-side compiler comparison</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12627295" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12627295</a> - Oct 2016 (6 comments)<p><i>Compiler Explorer</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11671730" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11671730</a> - May 2016 (38 comments)<p><i>Interactive C++ Assembly Explorer</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9861294" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9861294</a> - July 2015 (8 comments)<p><i>See What Your C Function Compiles To</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9808870" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9808870</a> - June 2015 (2 comments)<p><i>C&#x2F;C++ Fiddle</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7593109" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7593109</a> - April 2014 (40 comments)<p><i>Interactively watch how your C++ gets compiled.</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=4020814" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=4020814</a> - May 2012 (1 comment)
评论 #33226431 未加载
ChrisMarshallNY超过 2 年前
I&#x27;ve used Godbolt for years.<p>The story that I heard, was that he was arguing with someone about some compiler optimization, and created the site to prove a point.
评论 #33225470 未加载
sylware超过 2 年前
WOW!<p>There is a noscript&#x2F; basic (x)html version AND it does handle the _canonical_ gcc aka the last C compilable gcc (4.7.4).<p>Many of the optimization tricks hidden deep into those massive and complex software will be yours now.
ufo超过 2 年前
I recently learned that it&#x27;s not too difficult to run Compiler Explorer locally on your machine. Clone it from github and run the appropriate makefile and npm commands. Recently I&#x27;ve been using it Compiler Explorer a lot like this. It&#x27;s easier to use your own header files and it&#x27;s nice to not have the extra latency of compiling remotely or worry that you&#x27;re using so many of their CPU cycles. The main downside is that if you run locally you can only test on the version of gcc and clang that you have installed, while on the website you can test other versions and also other CPU architectures.
5e92cb50239222b超过 2 年前
A decent interview with the creator in podcast form.<p><a href="https:&#x2F;&#x2F;cppcast.com&#x2F;matt-godbolt-compiler-explorer&#x2F;" rel="nofollow">https:&#x2F;&#x2F;cppcast.com&#x2F;matt-godbolt-compiler-explorer&#x2F;</a>
评论 #33227207 未加载
usefulcat超过 2 年前
Awesome tool. I do mostly c++ all day and I use this almost daily, and certainly weekly. I think it’s really improved my feel for what the compiler will do with different constructs.
xfgusta超过 2 年前
I&#x27;d like to share a command-line tool to interact with Compiler Explorer that I made: <a href="https:&#x2F;&#x2F;github.com&#x2F;xfgusta&#x2F;cexpl" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;xfgusta&#x2F;cexpl</a>. It&#x27;s written in Python and it&#x27;s available on PyPI.
elromulous超过 2 年前
Seriously asking, how is it even possible to submit this to hn at this point? When one submits a previously submitted link, doesn&#x27;t it just alias to the previous submission?
评论 #33227670 未加载
caramelcream超过 2 年前
Compiler Explorer is such a wonderful tool. It made examining and comparing compiler outputs so much easier and now pretty much everyone interested in optimizations is using it.
bori超过 2 年前
I&#x27;m looking at the C maxArray example and see that the for loop:<p><pre><code> for (i = 0; i &lt; 65536; i++) </code></pre> gets compiled as<p><pre><code> .L2: add rax, 8 cmp rax, 524288 jne .L4 </code></pre> Is there any fundamental reason why the loop increments with 8 instead of 1? Or is this completely arbitrary? Thanks.
评论 #33230239 未加载
shortlived超过 2 年前
I just discovered goldbolt aka compiler explorer via this excellent podcast episode: <a href="https:&#x2F;&#x2F;corecursive.com&#x2F;to-the-assembly&#x2F;" rel="nofollow">https:&#x2F;&#x2F;corecursive.com&#x2F;to-the-assembly&#x2F;</a>
TobyTheDog123超过 2 年前
First ran across this when looking into Carbon - it&#x27;s a very cool tool!
seabass超过 2 年前
Is there a trick to make the typescript compiler run? All the other examples seem fine out of the box. No matter what I write, the ts compilation fails.
评论 #33228113 未加载
at_compile_time超过 2 年前
I was using CE earlier today to verify that rustc was optimizing the way I thought it would. It&#x27;s a great service!
motgilk超过 2 年前
It&#x27;s an excellent tool. Would be nice if it showed you the full linker output too, of the final binary.
评论 #33228126 未加载
RobotToaster超过 2 年前
It&#x27;s interesting to see what the different levels of compiler optimisation produce.
whatsakandr超过 2 年前
The addition of cppfront during Herb&#x27;s the talk was legendary.
mik09超过 2 年前
wow i first saw this on a small alternative reddit site. great to see it here and being this popular!
londont超过 2 年前
This is VERY cool. Congrats!
justshowpost超过 2 年前
Its better than the others but also very unprofessional as the other web stuff. It DOES link but its absolutely impossible to view generated map. People are just hyping about codegen related microoptimizations but don&#x27;t care about layout at all.<p>Very typical for today&#x27;s world where javascript coder counts as software engineer.
评论 #33228272 未加载