A few questions about Core internals.
Posted: Fri Dec 07, 2012 9:16 pm
I wasn't sure where to post this so if the moderators think it needs moving, please do so.
I suppose these are directed to the inner circle of the POLitburo, ie. them folks what knows how to code in C and understands how the POL Core and eCompile performs its magic.
Mind you these are mostly to satisfy my curiosity but they do have their practical side too.
My first question is about the way eCompile handles include files. Let's say I have an include file named utilities.inc. Within this file I have defined 20 functions. utilities.inc has no included files. Now I create a script in which I include utilities.inc. In this script I only call one function from utilities.inc and that function does not call any of the other 19 functions contained within the include file. When I compile my script does eCompile include the entire utilities.inc file in the ECL file or just the compiled code for my function I called from my script?
These next questions are regarding modules *.em files. Module files appear to be just text files and nothing more. A few years ago I examined a a couple in a hex editor and found them to contain only the text that one would see if the file is loaded into a text editor. Prior to that I had thought they were similar to Pascal's units which are pre-compiled blocks of code that add functionality to a program. I assumed this because the statement to invoke both modules, use for POL, and units, uses for Pascal, is so similar. So here are my questions:
1. What exactly are the modules? I'm not sure what I am asking with this question. I guess I want to know why have them? Why not just add these functions as Core functions? I suppose the answer to this will depend on what the answer to question 3 is.
2. How does invoking a module add functionality to the Core?
3. Are the functions contained within the modules already part of the POL Core but not made available until invoked?
4. Does invoking a module add to the size of the compiled ECL file by including some or all of the function(s)'s code from the module?
5. Based on the answer to question 3, are constants defined within a module added to the "global" constant symbol table (forgive any ignorance on my part of how POL handles things internally) or, if the functions contained within a module are already defined in the Core are the constants as well?
As I said these are mostly to satisfy my curiosity but as I begin to examine the source code for POL Core maybe the answers will help me to learn how it works.
I suppose these are directed to the inner circle of the POLitburo, ie. them folks what knows how to code in C and understands how the POL Core and eCompile performs its magic.
Mind you these are mostly to satisfy my curiosity but they do have their practical side too.
My first question is about the way eCompile handles include files. Let's say I have an include file named utilities.inc. Within this file I have defined 20 functions. utilities.inc has no included files. Now I create a script in which I include utilities.inc. In this script I only call one function from utilities.inc and that function does not call any of the other 19 functions contained within the include file. When I compile my script does eCompile include the entire utilities.inc file in the ECL file or just the compiled code for my function I called from my script?
These next questions are regarding modules *.em files. Module files appear to be just text files and nothing more. A few years ago I examined a a couple in a hex editor and found them to contain only the text that one would see if the file is loaded into a text editor. Prior to that I had thought they were similar to Pascal's units which are pre-compiled blocks of code that add functionality to a program. I assumed this because the statement to invoke both modules, use for POL, and units, uses for Pascal, is so similar. So here are my questions:
1. What exactly are the modules? I'm not sure what I am asking with this question. I guess I want to know why have them? Why not just add these functions as Core functions? I suppose the answer to this will depend on what the answer to question 3 is.
2. How does invoking a module add functionality to the Core?
3. Are the functions contained within the modules already part of the POL Core but not made available until invoked?
4. Does invoking a module add to the size of the compiled ECL file by including some or all of the function(s)'s code from the module?
5. Based on the answer to question 3, are constants defined within a module added to the "global" constant symbol table (forgive any ignorance on my part of how POL handles things internally) or, if the functions contained within a module are already defined in the Core are the constants as well?
As I said these are mostly to satisfy my curiosity but as I begin to examine the source code for POL Core maybe the answers will help me to learn how it works.