5 ms·
LLVM Tutorial
- altschuler 13y agoI can highly recommend going through this tutorial if you're interested in LLVM or just compilers in general. While it lacks some polish here and there, it's still quite easy to follow and what you end up with is some actually "useable". It's also rather easy to extend upon what is made, adding your own features.
- TheLegace 13y agoI'm very curious if I can compile static Python code with LLVM and use it on Cortex-M4 microcontrollers. I have seen some code which compiles Clang to STM32F4 microcontrollers and I have found py2llvm can compile Python into LLVM IR. I am wondering if it is even worth it, (but according to py2llvm you can get almost C like performance).
- icefox 13y agoAnd for what it is worth you can submit patches to improve the tutorial, after going through it that is what I did.
- arh68 13y agoI had trouble understanding this tutorial head-on, but it's much more digestible after some intro reading material ([2] will make a lot more sense after understanding Forth [3]). [1] http://www.aosabook.org/en/llvm.html http://www.aosabook.org/en/llvm.html [2] http://www.cs.ucla.edu/classes/spring08/cs259/llvm-2.2/docs/Stacker.html http://www.cs.ucla.edu/classes/spring08/cs259/llvm-2.2/docs/... [3] http://www.forth.com/starting-forth/sf1/sf1.html http://www.forth.com/starting-forth/sf1/sf1.html
- spacemanaki 13y agoIf writing compilers in C++ sounds like a pain, there's also an OCaml version of this tutorial: http://llvm.org/docs/tutorial/OCamlLangImpl1.html http://llvm.org/docs/tutorial/OCamlLangImpl1.html
- carterschonwald 13y agoOr check out the world class really nice llvm bindings in Haskell that were recently released: haskell.org/package/llvm-general They're already in use to provide an llvm backend for the idris compiler, and ill be using them myself soon too. One of the notable novelties about llvm general Is that you can manipulate the llvm AST as a normal Haskell data type. It also has really nice hooks for using most of the well maintained llvm Apis.
- oconnor0 13y agoThe URL for the llvm-general bindings is http://hackage.haskell.org/package/llvm-general http://hackage.haskell.org/package/llvm-general
- stiller 13y agoI personally started with this one, then switched to Create Your Own Programming Language [1] and am working my way back up. This helped getting the main concepts across before throwing C++ in the mix. [1] http://createyourproglang.com/ http://createyourproglang.com/
- munin 13y agoI gave an LLVM tutorial at PLDI2013, the slides are here: https://bitbucket.org/munin/llvm_tutorial/src/61f6300f76b8f092ba85bac34b404d348b2f7e04/slides/LLVM_Tutorial.pdf?at=master https://bitbucket.org/munin/llvm_tutorial/src/61f6300f76b8f0... I tried to be more introductory and hopefully the slides stand a little on their own...