next up previous contents
Next: D. Coupling to TMA Up: Dissertation Previous: B. Additional MDL Functions


C. Just in Time Compilation

While the Algorithm Library has no built-in support for the ``Just in Time'' compilation of MDL classes, this feature can easily be simulated by using the dynamic MDL class extension library FurtherLibcFuncs which is part of the Algorithm Library. Amongst other ANSI C compatible functions this library extends the basic MDL dialect with the system function. Example C.1 lists an MDL code sequence which generates a compiled version of the MDL class CompileTest available to the application right after the MDL parser finished.

\includegraphics[width=0.6cm]{figures/exaLeft.eps}

LoadObjectLibrary "FurtherLibcFuncs";
NewModel CompileTest { }             // define an MDL class to compile
CompilerProject = "JustInTimeTest";  // set the project name
compile "Comp.*";                    // compile the C++ Source Files
undef "Comp.*";                      // forget about CompileTest
NewModel SystemCall {                
   // compile the dynamic MDL extension library
   evaluate {                        
      system("vmake -wp JustInTimeTest -goal all;");
   }
}
instantiate VMAKE_executor = SystemCall;
evaluate VMAKE_executor;

Example C.1: ``Just in Time'' compilation of an MDL class

Since the compilation and linkage of the generated C++ code into MDL extension libraries consumes noticeable CPU time, the trade of between compiling MDL classes and the performance losses of the MDL interpreter in comparison to compiled MDL classes has to be done for each application separately.


next up previous contents
Next: D. Coupling to TMA Up: Dissertation Previous: B. Additional MDL Functions
Robert Mlekus
1999-11-14