[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: bug report
- From: Ralph Hempel <rhempel@...>
- Date: Fri, 09 Feb 2007 11:45:21 -0500
Currently, I am not sure constant folding is worth the trouble. We had
all kinds of problems with it: division and module by zero, NaN results,
problems with exotic lua_Number types (which may need a state to create
new values), etc. And it adds very little to the language: it is very
easy for the programmer to define suitable local "constants" to avoid
recomputing constant expressions, when needed.
Except for embedded systems where every constant with a name uses
up valuable RAM :-)
How much code is there related to constant folding?
At some point in the development of the Gems related to this topic,
it would be nice to get some ideas for building Lua for systems
where constants can be stored in ROM and the tables that store
them don't end up getting allocated in RAM when the library
Sorry if the meaning is unclear, but I am playing with these
ideas right now and have not fully understood the issues...