🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

how can i compile a script to an executable?

Started by
17 comments, last by brightening-eyes 10 years, 1 month ago

well, the problem is, i have to get all of the functions that i've registered with script into game, and copy them into executable!

and a question:can i compile them with the JIT compiler and then copy them into executable?

or not, it's imposible!

and: what algorithm do you recommend to pack the executable?

archiving with zlib, encryption with aes or blowfish!

thanks again!

when you can't see well like me, you can't test your applications and you can't read something

Github

Advertisement

Nothing is impossible. :)

But what you describe as trying to do looks very much like trying to build a fullblown linker, with the additional complexity that you want to be able to extract partial code from an existing application, convert bytecode into native machine code, and then put it all together as a native application.

If this is the path you want to go, then I suggest you look into some open source C++ compiler, for example MinGW, to see how it works.

You have a whole lot to investigate if you want to go down this path. I re-iterate my previous suggestion: concentrate on getting your game engine to work first so that you can actually make the games you want. Only when that is done do you need to think about how to package them for distribution.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

ok, do you know any compiler for AngelScript to do this?

i dont want to recreate everything from scrach!

i think i have to switch on lua!

sad.png

when you can't see well like me, you can't test your applications and you can't read something

Github

There is no existing compiler for AngelScript to do what you want. AngelScript wasn't created to be a standalone programming language. It is meant for embedding inside an application.

By the way, have you heard of BGT from Blastbay studios? It is a game engine for visually impaired users, it uses AngelScript, and it packages everything into a single executable for distribution. It actually sounds very much the same to what you want to accomplish. :)

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

well, i think that i can use LLVM and asIJitCompiler together

and a question about JIT compiler:

if JIT instruction is enabled, and JIT compiler is given to engine, does it uses it automaticly?

or i have to code something in order for it to work

when you can't see well like me, you can't test your applications and you can't read something

Github

Yes, if the JIT compiler is registered with the script engine using SetJITCompiler, the script engine will invoke it automatically to translate the bytecode to native code.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

well, thanks

but i want a recommendation:

what is your apinian about using LLVM as the compiler?

because it can compile the script (any scripts) to windows executables, elf, PE, coff, xCoff, etc

clang and clang++ are using LLVM

when you can't see well like me, you can't test your applications and you can't read something

Github

I've never used LLVM, so I can't give much opinion on it. I guess it would be possible to translate the bytecode to something that LLVM understands and can then translate to native code.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

i'll try to develop a compiler with LLVM

thanks, i've got my answers

when you can't see well like me, you can't test your applications and you can't read something

Github

This topic is closed to new replies.

Advertisement