2 Nov 2004 22:35
Bug (0.8.30d): meta.context() exposes global state
? def c := meta.context() # value: <a StaticContext> ? c.__optUncall() # value: [<unsafe:org.erights.e.elang.scope.StaticContext>, "run", [<a ScopeLayoutLink>, null]] ? c == E.call(E, "call", c.__optUncall()) # value: true ? def oops := c.__optUncall()[0] # value: <unsafe:org.erights.e.elang.scope.StaticContext> ? oops == <unsafe:org.erights.e.elang.scope.StaticContext> # value: true ? oops.getStaticContextMaker() # value: <unsafe:org.erights.e.elang.scope.StaticContext> ? oops.setStaticContextMaker(null) # <-- globally visible mutation ? oops.getStaticContextMaker() ? oops.setStaticContextMaker(oops) In addition to this hole (which I assume will be fixed by making StaticContext.StaticContextMaker final), it seems inappropriate that the uncall of a 'literal' PassByCopy object (any E code implicitly has a reference to it) involves a maker that is not itself <import>able - either it is unsafe (and should not be accessible) or is safe (and should be marked so in safej).(Continue reading)
>
> It seems to me to be worthwhile to make further experiments.
> I have ran
> into problems when I have tried to figure out things
> concerning _persistence_. Ideally (from my perspective) it would be
> perfect if it was possible to make something similar to the following
> Smalltalk statement:
>
> Smalltalk snapshot: true andQuit: false
>
> Is something like this possible? It was not able to work it out.
Unfortunately, persistence is, as you have noticed, the least well
documented part of E. In addition to the persistent e-chat you ran into, you
might also want to check out the DonutLab scripts (in
scripts/donutServices), which use persistence relatively extensively. To
bring up a donutLab mint, for example, first run the script createMint.e.
This will create a bunch of persistent accounts and revokers for those
accounts, in addition to a vat checkpoint. Shut the mint down, and run
reviveMint.e (in the same directory, so it can find its checkpoint to revive
from), and the same mint will be revive with the same vat ID.
Both echat and donutLab use the addExit mechanism (you will find it in the
mint scripts), which is simple and useful but not a general purpose
RSS Feed