Which compiled language allows compiling expressions / functions / modules on the fly, and garbage collect them ?
Trying to explain with a pseudo-C++ sample:
expr = " if ( a > 10 ) { return b + 10 ; } else { return c * 10 }"
wrapped = "int function(int a,int b, int c) { " + expr + " } "
fnptr = compile_by_magic(wrapped)
result = fnptr(input)
fnptr = null
There will be several safety features to watch out when practically doing this, but right now the question is which languages make doing such a thing possible, and trivial !
Background:
take some expression from user, and run millions of data thru it. garbage collection of compiled expression to keep memory usage bound.
Aucun commentaire:
Enregistrer un commentaire