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.

Cranelift, a low-level retargetable code generator written in Rust

63 pointsby exrookalmost 7 years ago

7 comments

smaddoxalmost 7 years ago
It&#x27;s interesting that booleans are stored as 0 or -1 [1]. I wonder what drove that decision. I just checked, and Rust&#x27;s LLVM stores booleans as 0 or 1.<p>[1] <a href="https:&#x2F;&#x2F;cranelift.readthedocs.io&#x2F;en&#x2F;latest&#x2F;ir.html#boolean-types" rel="nofollow">https:&#x2F;&#x2F;cranelift.readthedocs.io&#x2F;en&#x2F;latest&#x2F;ir.html#boolean-t...</a>
评论 #17740666 未加载
评论 #17740262 未加载
评论 #17741447 未加载
seeekralmost 7 years ago
The README says:<p>&quot;Cranelift is designed to be a code generator for WebAssembly, but it is general enough to be useful elsewhere too. The initial planned uses that affected its design are:<p>WebAssembly compiler for the SpiderMonkey engine in Firefox. Backend for the IonMonkey JavaScript JIT compiler in Firefox. Debug build backend for the Rust compiler.&quot;
xvilkaalmost 7 years ago
Hopefully will replace LLVM one day.
评论 #17740048 未加载
评论 #17740755 未加载
steveklabnikalmost 7 years ago
Previously called “cretone”, by the way.
评论 #17741433 未加载
kodablahalmost 7 years ago
Does it, or are there plans to, translate the IR to WASM (i.e. a WASM backend instead of just frontend)? This seems to have a more expressive set of instructions than WASM and could be a good target for compilers.
评论 #17740165 未加载
ndh2almost 7 years ago
Any example or tutorial?
评论 #17739803 未加载
评论 #17739548 未加载
jeandejeanalmost 7 years ago
I understand the enthusiasm for Rust, but I&#x27;m growing tired of these project advertised as &quot;written in Rust&quot; like it proves a point in itself.
评论 #17740384 未加载
评论 #17741566 未加载
评论 #17742139 未加载