I am currently brainstorming on how to update a program while it is running. (Not during debugging, the "production" system.)
But one thing that is required for this is to actually send the modified source code or compiled byte code to the running process.
Pseudo code
var method = typeof(MyClass).GetMethod("Method1"); var content = //get it from a database (bytecode or source code) SELECT content FROM methods WHERE id=? AND version=? method.SetContent(content);
First, I want the system to work without the complexity of object orientation. This leads to the following requirements:
- change the source code or byte code of a function
- drop function
- add new features
- change function signature
With .NET (and others), I could inject a class through IoC and thus modify the source code. But loading would be cumbersome because everything has to be in the assembly or created through Emit. Maybe with Java it would be easier? I think the whole Loader class is interchangeable.
With JavaScript, I could achieve many goals. Just evaluate the new function (MyMethod_V25) and assign it to MyClass.prototype.MyMethod. I think you can somehow drop functions with "del"
Which general purpose platform can handle such things?
Andreas
source share