Re: whaddabout a VARPTR func?
- Posted by Robert Craig <rds at ATTCANADA.NET> Nov 27, 1999
- 424 views
Nick Metcalfe writes: > It occured to me some time ago that a new function > for DOS/Win? Euphoria that returns pointers to variables in > memory like BASIC's VARPTR() would allow for some > serious performance improvements when using > embedded assembler or virtual screens in programs. This has been suggested before from time to time. On the surface it may sound like a good idea. However it will probably never be implemented because: - It would force me to freeze the current internal format for data. This format has changed many times, leading to enhanced performance, and change was only possible because no program depends on the format. - It would open a "Pandora's Box" of evil code that would access and alter variables in ugly and invisible ways. You'd see a lot of unexplained crashes and weird behavior, that would tend to be blamed on Euphoria itself. - It would reveal proprietary information that might help the competition to make faster interpreters (Rebol 44x slower?, Perl 34x slower? Python 34x slower?) - A variable's value is not always stored at the same place. A fixed varptr address is not that meaningful in the context of garbage collection etc. - You wouldn't get the full speed-up that you imagine. The machine code would have some of the same overheads as the interpreter when reading the internal format. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com