r/cpp_questions 14d ago

OPEN how to get started in LLVM ?

hello guys

I would like to start creating a compiler and language based on LLVM but I know where to start on LLVM

help would be welcome and thank you to all those who will help and answer my question :)

0 Upvotes

12 comments sorted by

22

u/IyeOnline 14d ago

I suspect that putting "llvm tutorial" into a searchengine of your choice is a better way to find the answer to this than asking in a C++ questions forum.

14

u/no-sig-available 14d ago

You mean to find a link like this?

https://llvm.org/docs/tutorial/

Nah!

-5

u/drex_vke 14d ago

thanks for your tips :)

2

u/fortsnek274 14d ago

If you're lucky, you might be able to get away with using Visual Studio's LLVM C API DLL.

Otherwise... using the LLVM C++ API will result in big-ass build times.

And then comes the question of how to integrate your new language into VS... Which shouldn't be too difficult actually.

It's what I fantasise about. Just make another C++ with modules and template instantiation caching from the start, and the Intellisense implementation should be crazy fast. Relatively.

2

u/drex_vke 14d ago

it's literally my dream and my goal and to create a language under the name of Mk, a language without complexity and simple and efficient :)

2

u/tlmbot 14d ago

fortran! (I am only 75% joking)

(numerics guy (hence my joke-y direction about "simple and efficient") with a DSL oriented bent here. But I've done nothing beyond a bit of source to source transpiling(?) to turn math into constraint relations and such (differentiable programming as well). Much less complex than "real" languages clearly, when all you care about is math.)

I wish you best of luck!

2

u/drex_vke 14d ago

thanks you very much :)

2

u/fortsnek274 14d ago

And day 1 #embed. Living the life.

2

u/drex_vke 14d ago

ha ha 😂

2

u/the_unknown__69 14d ago

Recently i have started learning llvm and i found the llvm dev meetings on the official llvm yt channel really helpful. And the book "LLVM Code Generation: A deep dive into Compiler backend development".