Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking for LLVM-based language which allows to reload part of binary on-the-fly

Tags:

reload

jit

llvm

Are the any GIL-less LLVM-based languages, targeted mainly for JIT-execution which allows to reload PART of the code on the fly?

Like re-compile 1 class, and reload it without stopping the whole program.

Anyone tryed that?

Any chance on doing that with clang (surely, with great deal of developers caution, restriction and manual state handling)?

like image 918
BarsMonster Avatar asked Aug 25 '10 00:08

BarsMonster


1 Answers

I think that this is a dynamite idea, and a feature that I would love to have! Have you given any thought to how you would like to interface with the feature?

obj1 = Foo()
compiler.Recompile(Foo, '/some/path/myapp/newsrc/foo.blah');
obj2 = Foo()
// Would this be True?
type(obj1) == type(obj2)

I assume that you expect existing instances to remain unchanged by the recompile? This seems like it would be easier with functions, as long as they kept the same prototype, but doing it with classes seems like it would get messy.

Also, what to do about threading?

Thread.start(wait 1; bar(););  // bar is a function
compiler.Recompile(bar, '/some/path/myapp/newsrc/bar.blah');

Lets say that in our thread we start calling "bar" during the recompile. Does the call block until the recompile is done and then call the new function? Does the old function still exist until the compile is complete? What if we have a function pointer, after the recompile, where does it point? To the original function or to the new one?

Does anyone have any thoughts on how this could be implemented in a strait forward way?

like image 91
Real John Connor Avatar answered Nov 14 '22 07:11

Real John Connor