Anonymous
while there will be other compiler s which will convert language to IR.
Anonymous
funny, I just saw that there is a LLVM ir -> javascript compiler :D
TypeScript uses LLVM to compile to JS Or Kotlin uses LLVM to compile to native machine code
Anonymous
LLVM runs some general optimizations on code in its IL
Anonymous
TypeScript uses LLVM to compile to JS Or Kotlin uses LLVM to compile to native machine code
Not quite but I'm sort of convinced about how things r working.
Anonymous
So it is optimising the intermediate code
Stephanos
The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. Despite its name, LLVM has little to do with traditional virtual machines. The name "LLVM" itself is not an acronym; it is the full name of the project. LLVM began as a research project at the University of Illinois, with the goal of providing a modern, SSA-based compilation strategy capable of supporting both static and dynamic compilation of arbitrary programming languages. Since then, LLVM has grown to be an umbrella project consisting of a number of subprojects, many of which are being used in production by a wide variety of commercial and open source projects as well as being widely used in academic research. Code in the LLVM project is licensed under the "Apache 2.0 License with LLVM exceptions" The LLVM Core libraries provide a modern source- and target-independent optimizer, along with code generation support for many popular CPUs (as well as some less common ones!) These libraries are built around a well specified code representation known as the LLVM intermediate representation ("LLVM IR"). The LLVM Core libraries are well documented, and it is particularly easy to invent your own language (or port an existing compiler) to use LLVM as an optimizer and code generator.
Anonymous
And then there's so called backend
Anonymous
TypeScript uses LLVM to compile to JS Or Kotlin uses LLVM to compile to native machine code
So it is optimising the intermediate code but what about conversion the machine language.
Anonymous
And then there's so called backend
And backend compiles LLVM IL to target platform
Anonymous
I guess LLVM is doing that too
Anonymous
And target platform could be machine code, JavaScript etc
Stephanos
LLVM Core compiles it to binary for the chosen cpu architecture
Anonymous
*converting to machine lang. Typo there.
Stephanos
yeah,... but lets say, @unterumarmung , that this js output is rather hacky and not part of the actual LLVM core, is it
Stephanos
the main goal of LLVM core is to generate code for a CPU
Stephanos
@unterumarmung well, you are correct, that you can compile IR to js, but that is more an "add-on"
Anonymous
My question is that how do I write an opengl program with visual studio code as my code editor
Stephanos
LLVM is huge and i don't think, that there are many people that know what you can do with it as a whole.
Anonymous
My question is that how do I write an opengl program with visual studio code as my code editor
Anonymous
I want to know how to do it
Stephanos
Turbo, at what stage are you facing problems. Could you be more specific, please
Pavel
I want to know how to do it
There's lot of tutorials about opengl in the internet as far as I know. What problems do you have?
Anonymous
With your hands, probably?
I have set up c++ with it but when I add glfw3 gdi32 and opengl
Anonymous
I get a message about undefined reference
Stephanos
okay,... are you using cmake for the build process?
Anonymous
No sir
Anonymous
1. Learn about build systems 2. Learn about compilers on your platform 3. Learn how to use opengl on your platform 4. Open the editor 5. Write some valid code using your knowledge 6. Compile your program ??? Profit
Anonymous
Ok sir
Stephanos
Turbo have you ever build a opengl program in your commandline?
Stephanos
by using compiler options?
Anonymous
No sir
Anonymous
I have used code block
Anonymous
But now I want to use visual studio code
Anonymous
The ui is nice
Stephanos
okay, then i have a task for you, are you ready?
Stephanos
oh wait
Anonymous
Yes sir
Stephanos
on linux, mac or win?
Anonymous
Anything
Anonymous
Windows
Stephanos
oh... okay...
Stephanos
ähm... i have no clue how to compile in commandline on windows :D
Anonymous
Ok give me your ideas on other systems maybe it will help
Stephanos
i'd start, using vim, to write a simple opengl hello world, as stated in online tutorials
Stephanos
then try and compile this one file with g++
Anonymous
No, you just have to learn how to use opengl on windows
Anonymous
Anonymous
The build process is what troubles me
Stephanos
Turbo but you have no clue how the buildsystem works
Anonymous
There is a thing called Visual Studio
Stephanos
@unterumarmung with "vim" i mean.... any kind of bare text-editor
Anonymous
There is a thing called Visual Studio
Do you able to use it, Turbo?
Anonymous
No sir
Anonymous
Why not?
Anonymous
The network in my region is slow
Anonymous
I will take a very long time to download
Anonymous
That is why I don't have it
Anonymous
I think you have to do it Because there's a lot of tutorials using VS
Anonymous
Ok sir
Anonymous
Thank you
Anonymous
May God bless you
Anonymous
The first option is much easier
Anonymous
Well
Anonymous
Ok
Anonymous
So, wanted to ask
Stephanos
Turbo if you want to compile a glfw3 program, use the compileroptions: -lglfw3 -lGL -lm -lXrandr -lXi -lX11 -lXxf86vm -lpthread
Anonymous
that do all c and cpp compilers use LLVM as their backend
Stephanos
that should do the trick with the undef ref
Anonymous
gcc, g++
Anonymous
clang
Anonymous
Did you ever compile your program using command line, turbo?