Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ JIT compiliation using asmjit #649

Open
peterclemenko opened this issue Apr 16, 2013 · 6 comments
Open

C++ JIT compiliation using asmjit #649

peterclemenko opened this issue Apr 16, 2013 · 6 comments

Comments

@peterclemenko
Copy link
Contributor

It might be worth investigating using asmjit https://code.google.com/p/asmjit/ as a manner of doing runtime compilation of C++ code. This might help with C++ plugin distribution.

@cadaver
Copy link
Member

cadaver commented Apr 17, 2013

Note that this is only an assembler library, so it would have to be coupled with a C++ compiler. Furthermore actually compiling C++ code at runtime (even if it was possible) would require shipping all the include files of used third party libraries + Tundra core modules.

@peterclemenko
Copy link
Contributor Author

It is possible, unreal engine does it.

cadaver notifications@github.com wrote:

Note that this is only an assembler library, so it would have to be
coupled with a C++ compiler. Furthermore actually compiling C++ code at
runtime (even if it was possible) would require shipping all the
include files of used third party libraries + Tundra core modules.


Reply to this email directly or view it on GitHub:
#649 (comment)

Sent from my Android phone with K-9 Mail. Please excuse my brevity.

@peterclemenko
Copy link
Contributor Author

I should explicitly note however that odds are this is a bad idea security wise and should only be implemented if a way we're found to sandbox it.

cadaver notifications@github.com wrote:

Note that this is only an assembler library, so it would have to be
coupled with a C++ compiler. Furthermore actually compiling C++ code at
runtime (even if it was possible) would require shipping all the
include files of used third party libraries + Tundra core modules.


Reply to this email directly or view it on GitHub:
#649 (comment)

Sent from my Android phone with K-9 Mail. Please excuse my brevity.

@cadaver
Copy link
Member

cadaver commented Apr 17, 2013

It is true that UE4 does runtime compilation, however what I've seen it has been used to tweak the game code, which interfaces with the engine through its own interfaces. A Tundra plugin on the other hand needs full access to the C/C++ standard library, in addition to the Tundra core and the third party libraries.

Certainly it is doable, but could be an engineering effort on the man-year scale.

For example, if Tundra was to embed clang, which has a nice license, then we would require to always compile the core libraries + dependencies with clang to make sure the C++ ABI and STL implementation matches.

Note that the http://runtimecompiledcplusplus.blogspot.com library, which is available as open source, requires the user to have a C++ compiler installed in the system, but we naturally can not require this.

I'm very tempted to close this as unfeasible in practice.

@cadaver
Copy link
Member

cadaver commented Apr 17, 2013

Also, I'm quite sure the end-user runtime of UE4 does not include a C++ compiler. This means the don't need to care how large the files required by the compiler are. We on the other hand would require it on the end-user installs.

@antont
Copy link
Member

antont commented Apr 17, 2013

was just thinking that perhaps using this and some other optimization is sometimes possible on servers, or in a CAVE installation where there sometimes is not distribution at all or at least extra work for setting up an efficient env is feasible. also sandboxing / security considerations can be much easier.

just a general observation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants