Topic: Code generation
Some code (src/game/generate) is generated at compile time, is there way to prevent it, or is it realy needed? Can anybody explain what it serves(not a code, but its generation) and what profit it makes here?
You are not logged in. Please login or register.
Teeworlds Forum → Development → Code generation
Some code (src/game/generate) is generated at compile time, is there way to prevent it, or is it realy needed? Can anybody explain what it serves(not a code, but its generation) and what profit it makes here?
It's really needed, it's all the repetitive data loading stuff that is C code generated from python.
But why it can not be just hardcoded? If it realy must be configurable looks like runtime better place then compile time? Is there generated some stuff except game resources?
It all looks like, that python scripts introduced only to make resource loading code little readable, but it may be implemented throught json or xml which will be compiled in?
I ask because i try to make port for another build system, which more scallable and ide friendly, so at current moment only thouse files realy blocks.
Don't ask me why, I didn't conceive Teeworlds and noone here did. It probably can be done in a different way, but it's the way it is and it's necessary.
It was done for the sake of security iirc
Generating the netmsg, data, netversion etc. is safer than writing everything by hand
(e.g preventing conflicts in the network protocol, etc.)
Ok, so if it will be loaded in runtime from built in xml or json data it still will be ok? Or there is some stuff which must be calculated in build time anyway ?
The email you sent got sucked up by the spam filter. I have marked it as an email that I will reply to.
EDIT: or come talk to us on IRC like Dune said.
It's needed for tools, and it is faster to generate it at compile time rather than load it from XML (xml parser overload + data overload etc.)
then security points also...
<<< Don't touch it unless you are one of the main developpers and the feature has been accepted by most others...
Ok, so if it will be loaded in runtime from built in xml or json data it still will be ok? Or there is some stuff which must be calculated in build time anyway ?
Yea, it would be theoretically fine to do it at run-time, but I imagine it's quite a bit harder to do so.
Teeworlds Forum → Development → Code generation
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 3 official extensions. Copyright © 2003–2009 PunBB.