Re: No more platform(), conditional includes, conditional functions, condit
- Posted by Derek Parnell <ddparnell at bi?pond.co?> May 15, 2008
- 676 views
Shawn Pringle wrote: Hi Shawn, > Everything you are talking about here can be done in the existing syntax > of Euphoria. Thanks for this idea. However, it appears that current Euphoria can't actually do some of the things that 'ifdef' would bring to the language. The reason is one of timing. When Euphoria runs a program it does two things: (1) Converts your source code to IL (intermediate language). This is the front-end at work. (2) Executes the generated IL code. This is the back-end at work. To use the current Euphoria, the tests for version, debug, whatever... all happen during the back-end phase, everytime it needs to make a decision about which section of code to run. The proposal is to move a lot of this to the front-end. The effect will be to have it decide once only and to decrease the size of the IL generated. This is because it looks at the 'ifdef' during converting the text and if it needs to convert the next section of code it does otherwise it just skips over it. The result is that the runtime phase never needs to make the decision again, it just runs the required code. > Its a matter of syntax whether you define or not define something; or if you > define it to be one value or another. You just need two builtins: > version_string(), and version_atom(). You can guess what they could do and > why all of this ifdef stuff is surpufluous. In one way it is superfluous, but the value of it is that it can make programs run faster. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell