On Fri, Dec 6, 2013 at 12:46 PM, Bienlein <
jet...@web.de> wrote:
>
>
> Am Freitag, 6. Dezember 2013 12:01:40 UTC+1 schrieb Peter von der Ahé:
>>
>>
>> In the context of
try.dartlang.org, I have been thinking a lot about
>> incremental compilation and hot swapping. A big part of what lacks is
>> to identify what needs to be fixed up, making this the hard part of
>> supporting hot swapping.
>>
>> For the VM to support hot swapping, my understanding is it is
>> currently lacking not tracking dependencies (meaning that identifying
>> what needs to be fixed up is the hard part here as well).
>
>
> One approach I could think of would be to organize the code in modules.
The dependencies I'm concerned about are not between modules. It is
the dependencies that are created when a compiler optimizes one method
by inlining another. This sort of dependency violates all abstractions
the programmer has put in place, in order to make the code run fast.
We expect the compiler to do this, but unless you think about hot
swapping early, chances are that the compiler forgets what it inlined
(a dependency).
> Some
> process in your Dart application periodically checks whether some new module
> was added to some pickup directory. If so the code compiled on the fly. What
> I don't know is whether this way the old code would get replaced with the
> newly compiled code. OSGi for the JVM has a dependency system that knows
> about dependencies between modules. For the time being I would ignore that
> kind of functionality and leave responsibility to the developer who has to
> make sure that a new module is compatible with existing ones.
>
>>
>> Hot swapping is an essential feature in Smalltalk, and many of the
>> people involved in the Dart project from the start would like to see
>> such features from Smalltalk be made available in Dart.
>
>
> I earned my pay for about 10 years in a row with Smalltalk development. The
> idea of snapshots clearly corresponds with the concept of images in
> Smalltalk. But I don't see how Smalltalk allows for hot swapping.
You hot swap each time you accept a new method during development.
When the compiler is available, the Smalltalk VM can hot swap.
In Dart, the compiler is available, but neither the VM nor the output
generated by dart2js supports hot swapping.
Cheers,
Peter
> If you
> hand in source code at runtime you need the Smalltalk compiler to be present
> to turn it into byte code executable by the vm. That would violate license
> conditions of many Smalltalk systems. Some Smalltalk systems later had
> something called Smalltalk link libraries (SLL) that were introduced in
> order show up with something similar to Java's jars. But loading in a SLL
> would probably not replace existing code as it doesn't either on the JVM
> (OSGi does some tricks here where the newly loaded code becomes visible
> somehow. The old code remains in the code space, though).
>
> Regards, Oliver
>
>