MessiahAndrw wrote:MessiahAndrw's Edit-and-Continue algorithm:
1. Programmer pauses execution and enters the IDE.
Who exactly pauses the code? Who manages it here? Isn't is an act of management?
MessiahAndrw wrote:2. Programmer changes the code inside of a function.
3. The programmer presses 'Continue'.
4. The compiler recompiles the source file.
5. The linker compares the old and new object files, and notices the code inside one of the functions has changed.
This is IDE's part of job and it is common for managed and unmanaged environments.
MessiahAndrw wrote:6. The linker keeps a memory map from each time the program is compiled, and sees where in memory the old version of the function was, and frees that memory in the running process.
Who exactly is responsible for locating "where in memory the old version of the function was"? Who is responsible for "frees that memory in the running process"? Are those actions acts of management?
MessiahAndrw wrote:7. The linker then allocates some memory in the running process to fit the new version of the function in and loads that.
Who exactly allocates foreign process's memory? Isn't it an act of management?
MessiahAndrw wrote:8. The linker then knows everywhere this function is referenced, and updates the address.
Who allows the linker to do it? Or in other words - who exactly manages process's memory. Isn't it an act of management?
MessiahAndrw wrote:9. If the instruction pointer of any thread was in the old function, update it to the closest equivilent position in the new function.
10. Continue executing the process.
Who manages this sequence?
I hope you have noticed how often the word "management" was used. Next I want to remind about my and Brendan's contradiction, which I describe as borrowing of automation features by unmanaged solutions from managed ones. Brendan raises objections about "independence" of the features. But my reply was about the way the features have taken place in unmanaged solutions. This way had been completed by managed environments much earlier than many unmanaged solutions (or now they can be called partially managed) started to implement exactly the same managed activities. The managed environments just had shown the way for unmanaged solutions. And even if it was possible to see the way before the raise of managed environments, only the managed environments had implemented a full set of management features and proved to the world the efficiency of such solutions (in terms of size of involved developer community and development time reduction). Nobody before had courage to collect all required managed features in one environment. And after the way had been shown, we have voices around who speak loudly that they always have known the way and they still need no help from managed environments. But they alway are very eager to implement managed features as a part of their own solutions.
Exactly the same situation you have shown above - you have just demonstrated the power of managed solutions, next you agreed that such features are very useful, next you have proposed steps for unmanaged solutions to adopt solutions, borrowed from managed environments.
And after it all you just have to say that you still disagree with the way that is shown by managed solutions, for the complete absurdity of your claims will be as visible as ever possible.
MessiahAndrw wrote:Some other features:
- Array bounds checking in an unmanaged environment: Generate a small snippet of machine code before array accesses.
This can be done without runtime management, but the consequence is the lack of debugging information in case of a program crash.
MessiahAndrw wrote:- Garbage collection in a unmanaged environment: Exactly the same as garbage collection in a JIT'ed environment.
Here we again have just a clear adoption of managed features.
MessiahAndrw wrote:- GUI designer in an unmanaged environment: Exactly the same as a GUI designer in a managed environment - it just generates a source code file that constructs the GUI you designed (similar to InitializeComponent() in .Net when using WinForms), or a layout file (similar to .xaml in .Net when using XAML). None of that requires a managed environment.
GUI or any other library is out of scope of the managed vs unmanaged discussion. As it was pointed out earlier, any library is just the "x" in the comparison "x+y>x+z".
MessiahAndrw wrote:- Debugger that let's you singlestep: keep a record of what instruction points to what line of code and the stack/registers - virtually every language.
Here again you need a manager, that stops a process, introspects it's memory and registers and so on. It just a part of any managed environment. But managed environments include much more than this single part. And because of the very existence of the managed environments it is possible to modify code at runtime. But if you pretend that a managed environment, that is split into obscure parts, like in case of one part belongs to an OS and another belongs to something else, can not be called managed or at least "very close to managed", then again you just show the absurdity in your claims.
MessiahAndrw wrote:Personally, in my OS, I am going to distribute my applications as bytecode, but I'm thinking about invoking bytecode->native-code compilation only during the first execution or when a referenced library changes. Despite being bytecode, my language will allow 'unsafe' things like pointers. Would you call this managed? Does this fit your definition of requiring a virtual machine?
Your solution is seems as incomplete. So it can be called "very close to managed". But because I don't know how you use pointers in your solution, I can't be sure. May be your solution is still safe and then it can be called managed (in case other unknown parts include managed features also, which is very likely).