Writing a compiler with LLVM - Cailin Smith - NDC Oslo 2022

preview_player
Показать описание
LLVM is an "bytecode" like language and ecosystem, which allows for compilation of high level languages into a common representation, which can then be further compiled to native executables of the target architecture. In this talk, we will go over the basics of what LLVM is, how it works at a deeper level, and how MethodScript is planning on using it going forward, along with plenty of code examples.

Check out more of our featured speakers and talks at
Рекомендации по теме
Комментарии
Автор

Really enjoyed the talk! Thank you! It's crazy how compilers optimize code!

HarshKapadia
Автор

Good llvm intro - especially in showing how optimizations work and static single assignment if one has not encountered it before.

benjaminscherrey
Автор

I don't really understand why she's making the claim that prior to LLVM, compilers didn't have front-end and back-end subsystems, where the front-end would target generic intermediate code. This was very common in compiler technology. For instance, that's how HP's compilers worked.

I realize that LLVM made has made this accessible to the masses, but just because you didn't see it, doesn't mean that's not how most proprietary language compilers were architected.

I don't want to take away from the talk as this point wasn't really the point of what is being discussed, but I thought a point of clarification is in order.

artistish
Автор

Also Apple's Swift programming language builds on top LLVM :)

MattKnowsTech
Автор

Very interesting talk, unfortunately the audio level is very low (and I have maxed it out on my machine) so I had a hard time hearing what is said

tordjarv
Автор

I always thought compiler writers first write their compiler in C and finally rewrite it in their own language, once it's mature enough. But here it seems this is more or less an abstract assembly language, but not any easier. Crazy!

deNudge
Автор

Good talk. Nice that you have mentioned that llvm has Windows linker (I think almost full) compatible with Visual Studio linker. So you can live without VS installation (can be helpfull if you can't install VS for some reason). Thanks for sharing lld-link command for Windows.

karloes
Автор

hm. it might be a cool idea to write an 'IR assembly' language compiler. kind of a more human readable IR assembly transpiler to LLVM IR. then maybe incorporate concepts from the HLA language. i'll have to juggle this around in my head for a bit.

androth
Автор

Does the LLVM system use lex and yacc?

JohnWasinger
Автор

The Full LLVM Libs Package can be over 24 to 48 gigs in package size. Its not only crazy, its absurd and backwards. CPython has the superior and far less costly way of doing things honestly. And CPython is an already compiled Language even before you write any program with it. And it works One to One with C++.

CPython reads in your applications syntax Lexes it then evaluates it as a Compiled Byte Code instantly and doesn't require the Lexer after the first execution. It then stores an already byte code representation of your application by name as a dot pyw file if no new changes are made.

Then for production that dot pyw byte code then becomes your compiled byte code making it an instantly executed application. And CPython only requires 101 MB of package space.

aboutmount
Автор

The JVM doesn't interpret the AST code (or whatever other code). The JVM compiles to an intermediate bytecode, interprets that, and *while* running, decides how to compile to machine code. The end result is near or sometimes even faster than optimized C++ code even.
People need to stop associating the JVM with interpreting bytecodes.

Antiorganizer
Автор

Why is she talking about the IR like she's making edits to it directly? You're supposed to make the edits in the source files. Show us that. Are you going to fix the bugs in the IR every time you compile it?

kaos
Автор

ngl, that metascript looks like assembler compared to javascript. interesting talk anyway. Only worry is that Microsoft is interested in it, that means its probably be really bad as other microsofts initiatives in the coding world. edit: sorry, I cant believe kids think that method script is easy.. it looks very very very complicated for something that should be simple.

AndrewTSq
Автор

If I have 50 min, then I do not waste 6 mins at the start with trivia/irrelevant remarks. Otherwise, important material.

robertbarta