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.

Proposal: C++ Should Support Just-in-Time Compilation

28 pointsby kbumsikalmost 6 years ago

4 comments

m0zgalmost 6 years ago
This could be pretty cool. Right now you have to drop down to non-portable, assembly-style JIT like Xbyak (<a href="https:&#x2F;&#x2F;github.com&#x2F;herumi&#x2F;xbyak" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;herumi&#x2F;xbyak</a>) or VIXL on ARM (<a href="https:&#x2F;&#x2F;community.arm.com&#x2F;developer&#x2F;ip-products&#x2F;processors&#x2F;b&#x2F;processors-ip-blog&#x2F;posts&#x2F;announcing-vixl-a-dynamic-code-generation-toolkit-for-armv8" rel="nofollow">https:&#x2F;&#x2F;community.arm.com&#x2F;developer&#x2F;ip-products&#x2F;processors&#x2F;b...</a>). It might not be obvious why you&#x27;d want something like that, so I&#x27;ll explain. Basically think of this as templates which you don&#x27;t have to pre-instantiate. You can specify exactly how long your loops are, so the compiler will be able to do a much better job of vectorizing, eliminating branches, etc etc. In a tight math-kernel style code this could easily improve the perf by 2x or more. Combined with intrinsics this could eliminate the need for assembly in many cases.<p>This would be exciting if it came to fruition at some point. Unfortunately C++ standard being what it is, we&#x27;re looking at like 2025 before we see the first standard compliant implementation. Perhaps other languages could take this idea and run with it.
评论 #20660833 未加载
评论 #20661022 未加载
评论 #20660843 未加载
ecealmost 6 years ago
There is cling: <a href="https:&#x2F;&#x2F;root.cern.ch&#x2F;cling" rel="nofollow">https:&#x2F;&#x2F;root.cern.ch&#x2F;cling</a><p>You can also use cling as a jupyter C++ kernel as well.
rurbanalmost 6 years ago
pragma&#x27;s are now in [[ ]] brackets, not normal #pragma anymore? that doesn&#x27;t look backcompat to me.
评论 #20661011 未加载
okiganalmost 6 years ago
As per example the templates are in compute intensive part of the app — pull that out to a library, compile once and done - no need for JIT in the standard &#x2F;runtime (did they mention +75MB! runtime?)
评论 #20660393 未加载