Class-based dynamic languages on Truffle OSM
thomas.wuerthinger at oracle.com
Sun Nov 9 18:25:35 UTC 2014
Languages are free to chose their own way of implementing the object layout when using Truffle. The paper describes one specific technique that has shown to be good for objects of dynamic size and shape.
In case of fixed size objects, one might still want to speculate on the types of fields. This can be beneficial even in case of static languages like Java, because the provided static type of a field is only a conservative estimate of the actual type of values stored in the field at run time. Stefan Marr’s TruffleSOM (https://github.com/smarr/TruffleSOM) is an example implementation of Smalltalk using Truffle.
On 09 Nov 2014, at 18:26, Raffaello Giulietti <raffaello.giulietti at supsi.ch> wrote:
> I recently read the very interesting Truffle OSM paper (http://dl.acm.org/citation.cfm?id=2647517).
> If my understanding is correct, the paper proposes to treat all guest language (g-lang) objects as instances of a *single* Java subclass of StorageObject, like the exemplar JSObject.
> While this one-size-fits-all approach might be ideal for prototype-based or open-ended class-based g-langs, where instances can grow as new properties are added at runtime, I wonder if it is ideal for those dynamic g-langs where the set of instance variables (fields) is fixed at class definition time, like in Smalltalk.
> I'm not sure if my understanding is correct or if Truffle/Graal's magic is able to optimize the size and the shape of objects along their way from birth to death. This would be wonderful!
> Any clarifications, even technically detailed ones, would be welcome.
> Thanks in advance
> Raffaello Giulietti
More information about the graal-dev