Re: fact inquiring questions
- Posted by mattlewis (admin) Apr 29, 2012
- 1329 views
I actually meant a c binded library
I'm sorry but I'm not sure what you mean exactly by a "c binded library". Are you referring to a library created by a C compiler (and librarian tool)? In which case, what gets included into the final application depends on the abilities of the link editor tool, and has nothing to do with Euphoria.
Hmm...I suspect that he's asking about a euphoria library translated as a dynamic library.
If that's the case, then we keep anything that would be required for the library to function. Basically, we look at routines as though your code had simply included the library as a normal euphoria code. So any bit of code that could be reached that way will be included.
Any code that couldn't be reached will not be included in the final library. So, for instance, if you included parts of the standard library, but your routines didn't use all of the included file, then some of those routines will not be included in the final library.
When you translate euphoria code, it makes several passes. You may have noticed the translator counting passes when you translate some code. The process it uses is to first parse the code, then make several passes through in "dry run" mode. No actual C code is emitted, but the translators watches what values variables take on, and which routines are actually called.
Eventually, it gets to a point where it's learned all that it can, and it writes out the C code. This is why a simple program may take only a couple of passes before the C code is actually written out. The front end of the interpreter, for instance, takes 11 passes (IIRC).
Matt