How does Unreal call code that doesn't exist yet?
So I've been learning C and I'm actually a bit curious how they implemented it, Unity compiles stuff to CIL because it primarily runs C# scripts and AFAIK is programmed in C#, this makes sense because Microsoft provides tools to do this and it's in a virtual environment in it's runtime, a lot of engines use Lua, which turns into bytecode and is interpreted, this also makes sense because it's being put into essentially a runtime with completely virtual memory like C#. Now Unreal does Blueprint (if you use Blueprints) -> C++ -> Machine code. I have two questions:
- How does it actually look in the source code? Do they call the compiler and it magically gives them a function pointer to the machine code? (obviously isn't this simple but you get what I'm asking)
- How does that look under the hood? How does Unreal know that what it's about to execute won't cause an error in the rest of the program/whatever other user-defined code is running on that thread? Even the best compiler can't account for every possible error