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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

A Complete Guide to LLVM for Programming Language Creators

402 点作者 mseri超过 4 年前

12 条评论

ufo超过 4 年前
A question for the LLVM experts here:<p>In the past when I&#x27;ve looked at LLVM from a distance, the biggest stumbling block I found were that it&#x27;s written in C++ , which isn&#x27;t the language I&#x27;m using for my frontend.<p>How important is the C++ API in practice? Are the bindings for other languages usable? Is it possible to have my frontend emit LLVM IR in a text format, similarly to how you can feed assembly language source code to an asssembler? Or should one really just bite the bullet and use C++ to generate the IR? I noticed that the compiler in this tutorial has a frontend in Ocaml and a backend in C++, with the communication between them being done via protobufs.
评论 #25541623 未加载
评论 #25540725 未加载
评论 #25540637 未加载
评论 #25541447 未加载
评论 #25542921 未加载
评论 #25542608 未加载
评论 #25542897 未加载
评论 #25542412 未加载
评论 #25542924 未加载
finiteloop超过 4 年前
As someone who writes a lot of toy languages, I made this scaffolding for a LLVM-based compiler: <a href="https:&#x2F;&#x2F;github.com&#x2F;finiteloop&#x2F;compiler" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;finiteloop&#x2F;compiler</a><p>It uses Bison and Flex for parsing and lexing unlike this post, but may be a useful starting point for those building their own toy languages.
评论 #25540963 未加载
评论 #25540742 未加载
mrathi12超过 4 年前
While we&#x27;re here, let&#x27;s not forget about the incredible Kaleidoscope tutorial. They really helped me get a grip with LLVM.<p><a href="https:&#x2F;&#x2F;llvm.org&#x2F;docs&#x2F;tutorial&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;llvm.org&#x2F;docs&#x2F;tutorial&#x2F;index.html</a>
评论 #25543648 未加载
TazeTSchnitzel超过 4 年前
&gt; LLVM IR looks like a more readable form of assembly<p>I think assembly is more readable than the dumped LLVM IR output of a real compiler…<p>Anyway, that was a good overview of how to build simple LLVM IR. :)
评论 #25540444 未加载
评论 #25542539 未加载
CGamesPlay超过 4 年前
It’s possible I missed this from the article, since I’m not actually following along, but why do I need to create the custom C++ adapter? The article mentions both ll bc formats, but I don’t see how they are used?<p>If I wanted to target LLVM, why wouldn’t I emit ll or bc files?
评论 #25541032 未加载
HexDecOctBin超过 4 年前
Is there a similar resource for liblldb? The only documentation I could find was the Doxygen-based one, and it doesn&#x27;t provide enough hints to a newcomer to know where to get started if I want to write a debugger frontend.
jooz超过 4 年前
When I studied compilers back in the university, the subject consist in reading understanding and putting in practice the &#x27;dragon book&#x27; (not the full book but a big part of it). We all used flex+yacc and a simplified ASM that was interpreted by some educational software which name I cant remember. The project for the year was to implement a basic compiler language: included if&#x2F;for loops, function calls, recursivity ... basic stuff but enough as starting point to build something.<p>Trying to get into LLVM, Id love to find an example done in flex+yacc vs the same done in LLVM.
评论 #25543678 未加载
mraza007超过 4 年前
Really loved reading it. It made it so much easier for me understand LLVM.<p>Just wanted to appreciate you for writing this awesome guide
评论 #25542959 未加载
ithkuil超过 4 年前
Does anybody know a good resource like this but for writing backends for a new cpu ISA?
评论 #25543128 未加载
评论 #25542254 未加载
nevi-me超过 4 年前
I&#x27;m playing around trying to create a JIT execution engine for Rust code. I was struggling a bit with the codegen part, so the description of the function structure helped make more sense of what I&#x27;m trying to do.<p>Thanks
kevindeasis超过 4 年前
Thanks for this, I used to have other resources too about 3 years ago when I was making my own toy blockchain project that takes in a programming language to create smart contracts<p>let me see if i can still find those
jtsiskin超过 4 年前
LLVM: used to be “Low Level Virtual Machine”, but the acronym no longer applies<p>IR: intermediate representation