Compiling a script
Is there a scripting language or a tool for a popular scripting language, which allows compiling a script to binary and executing it immediately. I know that it is possible with C#, but the framework initialization needs to much time. Are there alternatives?
Thank you!
Most of the scripting languages do have that. If you want a C like scripting language, try Small. If you don't care about C likeness, you might try other scripting languages, such as LUA, Python, etc.
I am using Lua for a while, but as far as I know, it compiles scripts to a byte code, which is interpreted at runtime. But I would like to have machine code, which can be runned directly without an interpreter.
Using C# I am able to build a DLL at the runtime of my application, which can call functions of that library.
Using C# I am able to build a DLL at the runtime of my application, which can call functions of that library.
Python with Psyco will emit machine code for Python scripts. Off the top of my I head I believe there are Lisp implementations that will also emit machine code at runtime, but I can't recall specific names right now.
July 19, 2004 10:09 AM
It is not possible to completely precompile weak-typed languages (under which category most of the scripting/interpreted languages fall) because final types cannot be predicted. There are some "workarounds" (some are already mentioned in previouse replies) but all of them are runtime solutions. In general Bytecode is the closest you can get to machine code at pre-runtime.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement