how are globals resolved at run time?

Started by
10 comments, last by Dog_Food 22 years, 7 months ago
Dog_Food: Unless you want to release your language to your users or to utilize it large-scale, I would advise against writing your own compiler (to machine code) and using an existing language instead.

If you do, though, I would advise limiting its domain to COM. Global variables should never be needed in a good framework. Have your implicit objects handle them by storing them in a table. Don''t get machine-level...
VK
Advertisement
As I was writing my scripting language for a game editor, it was getting to the point where it would become easier just to compile the scripting language to machine code rather than to code special interfaces, importing and exporting methods for everything. I am going in the direction of java, with a just in time compiler.

Optimally, in the game editor environment, the user may derive classes from script or editor class types. Data representations must be similar so both the c++ and the script side can access eachother seamlessly. This is not as difficult as it would seem. The only hack thrown in is that virtual functions must be supported through a custom vtable rather than the built in one.

The only machine level support will be for writing new member functions. Class type data, static variables, and globals will be handled with regular c++ classes. External function calls will be hooked up to functions registered in the classes. This was another point, that I want reflection capabilities.

This topic is closed to new replies.

Advertisement