Re: Scripting Systems

"Brett Bibby" <[email protected]>
Newsgroups gmane.games.devel.general
Organization GameBrains
Message-ID <[email protected]>
> Run-time is the only way to do it.  Lua is a dynamically typed 
> language, and since it doesn't even comprehend the idea of user 
> defined types, "type checking" is kind of a no-op.  
> 
> What we'd need is a preprocessor that uses a convention where any 
> uninitialized element accessed out of a table constructor or 
> declaration is definitely bad.
> 
> v = { x = 0, y = 0, z = 0 }
> v.zz = 3 --<< BZZZT!
>

Idea 1
A hack to be sure, but I could trap the __index error and do some sort of "spell checker" against known elements, starting with the locals and working my way upward. If it finds a recommended match (within some sort of error metric) it changes it and keeps going. If I have a debugger it could pop-up with the suggestion and allow me to accept or choose another symbol and optionally modify the source for me to correct the problem. Without a debugger it could output a log that looks like preprocessor logs showing the error, line number, etc. As long as there is an option to enable/disable the feature, it would probably fix like 90% of the errors.

Idea 2
Based upon the concept of automated unit testing, I could load the function to compile, generate a unit test for each function, compile and load both of them, and run the unit test against it. Failures could do something like Idea 1 above and when fixed is written to disk (as an obj). This gives you a Lint-like system and since we compile each function as an object, incremental build will keep the performance acceptable. Plus it has the ability to interactively fix problems.

Anybody tried this? This sounds pretty workable to me.

Brett


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Gamedevlists-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-general
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_idU7
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.