Skip to main content
GameDev.net gamedev.net
🔒 Locked

Are There On-Ram Code Compilers?

Started by Prozak Nov 25, 2003 at 6:15 PM 1 replies 400+ views
Original Post
Prozak
Prozak
Ok, i would have some script code, that would interact with my "real" c++ code. Instead of having it interpreted can it be compiled and converted to assembly code in memory? Does any package do this?

[Hugo Ferreira][Positronic Dreams][Colibri 3D Engine][Entropy HL2 MOD][Yann L.][Enginuity]
Stop reading my signature and click it!

NickB
NickB
There are various packages that implement scripting languages, generally you need to provide objects to allow the scripts to interact with your ''conventional'' code. Your options are roughly:

a) Use the MS ActiveScripting COM interfaces (limits you to the windows platform, implements VBScript & JScript out of the box, there is certainly a Perl interpreter (ActivePerl) and there are others)

b) Use a dedicated script-engine library (SpiderMonkey implements &#106avascript, there are others implementing other languages {however I can''t remember any names atm})

c) Write your own script compiler/vm code (tools that will help are such things as ANTLR (the traditional tools many prefer are YACC & BISON) which help lexing & parsing the script text
Extrarius
Extrarius
Usually, a language designed for scripting is used for scripts, such as vbscript, or lua. When those languages don''t fit, the next option is usually a custom scripting language. If you want to try the latter and still want to compile to machine code, there are some classes that do asm->machine code conversion on flipcode''s code of the week archive.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.