Lazy Loading (was: Re: [squeak-dev] The Trunk: MorphicExtras-cmm.131.mcz)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Lazy Loading (was: Re: [squeak-dev] The Trunk: MorphicExtras-cmm.131.mcz)

Chris Muller-3
> OK, I see what you mean. We do this kind of lazy loading in several
> places. Every time I see it, I feel a strong ambivalence. On one hand,
> it's really easy to write, and it's really convenient, but! (b) it's a
> totally rubbish UX when you're offline. Click on something and

But, if you're offline, you won't be able to load that package
manually anyway.  One way or another, that function is unavavailable,
period.

So, what difference does it make _what_ error you get in that 1% case
of being offline if, for the 99% case (on-line), no error is incurred
at all?

> suddenly random failures happen because omigosh you're not connected
> to the internet.

I know you still don't have it on the train but persistent internet
connections are coming -- it's inevitable.  We should decide about the
future in the context of the future.

> I think lazy loading like this should be a last resort. Surely we can do better?

Why should it be a last resort instead of a first resort?  What do you
propose for better?

Reply | Threaded
Open this post in threaded view
|

Re: Lazy Loading (was: Re: [squeak-dev] The Trunk: MorphicExtras-cmm.131.mcz)

Frank Shearar-3
On 08 Dec 2013, at 22:41, Chris Muller <[hidden email]> wrote:

>> OK, I see what you mean. We do this kind of lazy loading in several
>> places. Every time I see it, I feel a strong ambivalence. On one hand,
>> it's really easy to write, and it's really convenient, but! (b) it's a
>> totally rubbish UX when you're offline. Click on something and
>
> But, if you're offline, you won't be able to load that package
> manually anyway.  One way or another, that function is unavavailable,
> period.
>
> So, what difference does it make _what_ error you get in that 1% case
> of being offline if, for the 99% case (on-line), no error is incurred
> at all?
>
>> suddenly random failures happen because omigosh you're not connected
>> to the internet.
>
> I know you still don't have it on the train but persistent internet
> connections are coming -- it's inevitable.  We should decide about the
> future in the context of the future.

That fails to help me now. It's also very not robust. _Depending_ on 'highly available' stuff makes you MORE vulnerable, not less. (because you end up trusting it, and 'trust' means 'something that can break my system')

>> I think lazy loading like this should be a last resort. Surely we can do better?
>
> Why should it be a last resort instead of a first resort?  What do you
> propose for better?

Well, I don't have a monopoly on good ideas :). But how about this: if it's that important that you go to the trouble of hooking in a lazy load, why not just load the package in eagerly?

And if it's merely nice to have, why not use some kind of pluggable thing that allows me to choose the option. Random Internet connections are made of fail.

frank
Reply | Threaded
Open this post in threaded view
|

Re: Lazy Loading (was: Re: [squeak-dev] The Trunk: MorphicExtras-cmm.131.mcz)

Chris Muller-4
>>> I think lazy loading like this should be a last resort. Surely we can do better?
>>
>> Why should it be a last resort instead of a first resort?  What do you
>> propose for better?
>
> Well, I don't have a monopoly on good ideas :). But how about this: if it's that important that you go to the trouble of hooking in a lazy load, why not just load the package in eagerly?

Because Nicolas wants to eliminate MorphicExtras static dependency on
UpdateStream, which is what started this thread.

You contend lazy loading doesn't eliminate the dependency, it only
defers it until runtime.  That's true, but how else could the
_original_ behavior be met?  Nicolas proposed that it shouldn't
anyway:  Change the original behavior.

In this case, I agree with him.  System initialization of this sort
can be done myriad of ways -- we don't need lazy-loading for this
case.  But it is good to remember this is a tool in our toolbox toward
achieving the same goals as the modularity effort.  -- I think your
expression of it being an additional "dependency" on the Internet is
not true.

Sometimes the modularization effort employs only "pure package
factoring" (preserving original behaviors).  Sometimes chopping out
behaviors to eliminate dependencies becomes necessary.  Ok, I
understand now why you "last resort" and I agree, but it _is_ useful
at times.

Reply | Threaded
Open this post in threaded view
|

Re: Lazy Loading (was: Re: [squeak-dev] The Trunk: MorphicExtras-cmm.131.mcz)

Frank Shearar-3
On 9 December 2013 21:18, Chris Muller <[hidden email]> wrote:
>>>> I think lazy loading like this should be a last resort. Surely we can do better?
>>>
>>> Why should it be a last resort instead of a first resort?  What do you
>>> propose for better?
>>
>> Well, I don't have a monopoly on good ideas :). But how about this: if it's that important that you go to the trouble of hooking in a lazy load, why not just load the package in eagerly?
>
> Because Nicolas wants to eliminate MorphicExtras static dependency on
> UpdateStream, which is what started this thread.

I don't want to eliminate only static dependencies. It's not that big
a deal for MorphicExtras, because that's like icing on the gingerbread
house: you can scrape it off with little more than cosmetic damage.

> You contend lazy loading doesn't eliminate the dependency, it only
> defers it until runtime.  That's true, but how else could the
> _original_ behavior be met?  Nicolas proposed that it shouldn't
> anyway:  Change the original behavior.

Yep, and I'm glad he found a better way.

> In this case, I agree with him.  System initialization of this sort
> can be done myriad of ways -- we don't need lazy-loading for this
> case.  But it is good to remember this is a tool in our toolbox toward
> achieving the same goals as the modularity effort.  -- I think your
> expression of it being an additional "dependency" on the Internet is
> not true.

How so? Well, making use of the package-cache or some other
local-network cache would go a long way towards mitigating the
problem. But the code's outside the image, and it has to come from
_somewhere_.

> Sometimes the modularization effort employs only "pure package
> factoring" (preserving original behaviors).  Sometimes chopping out
> behaviors to eliminate dependencies becomes necessary.  Ok, I
> understand now why you "last resort" and I agree, but it _is_ useful
> at times.

I agree, it is useful. I suppose I'd object less to lazy loading being
driven off a user action. The only example I can think off is how we
load WebClient lazily when updating through the SqueakMap browser.
There (a) it's driven directly off user input and (b) the nature of
updating necessarily involves a network connection anyway, so lazy
loading looks like a natural part of the flow.

But imagine if we used lazy loading all over the place, and you could
never be sure when things would or wouldn't require a network
connection. As a user things would randomly fail with mysterious
debugger windows popping up talking about primitive failures, and as a
product developer you wouldn't be able to know in advance that you
shipped the image with all necessary parts.

frank

Reply | Threaded
Open this post in threaded view
|

Re: Lazy Loading (was: Re: [squeak-dev] The Trunk: MorphicExtras-cmm.131.mcz)

Chris Muller-3
On Mon, Dec 9, 2013 at 3:53 PM, Frank Shearar <[hidden email]> wrote:

> On 9 December 2013 21:18, Chris Muller <[hidden email]> wrote:
>>>>> I think lazy loading like this should be a last resort. Surely we can do better?
>>>>
>>>> Why should it be a last resort instead of a first resort?  What do you
>>>> propose for better?
>>>
>>> Well, I don't have a monopoly on good ideas :). But how about this: if it's that important that you go to the trouble of hooking in a lazy load, why not just load the package in eagerly?
>>
>> Because Nicolas wants to eliminate MorphicExtras static dependency on
>> UpdateStream, which is what started this thread.
>
> I don't want to eliminate only static dependencies. It's not that big
> a deal for MorphicExtras, because that's like icing on the gingerbread
> house: you can scrape it off with little more than cosmetic damage.
>
>> You contend lazy loading doesn't eliminate the dependency, it only
>> defers it until runtime.  That's true, but how else could the
>> _original_ behavior be met?  Nicolas proposed that it shouldn't
>> anyway:  Change the original behavior.
>
> Yep, and I'm glad he found a better way.
>
>> In this case, I agree with him.  System initialization of this sort
>> can be done myriad of ways -- we don't need lazy-loading for this
>> case.  But it is good to remember this is a tool in our toolbox toward
>> achieving the same goals as the modularity effort.  -- I think your
>> expression of it being an additional "dependency" on the Internet is
>> not true.
>
> How so? Well, making use of the package-cache or some other
> local-network cache would go a long way towards mitigating the
> problem. But the code's outside the image, and it has to come from
> _somewhere_.
>
>> Sometimes the modularization effort employs only "pure package
>> factoring" (preserving original behaviors).  Sometimes chopping out
>> behaviors to eliminate dependencies becomes necessary.  Ok, I
>> understand now why you "last resort" and I agree, but it _is_ useful
>> at times.
>
> I agree, it is useful. I suppose I'd object less to lazy loading being
> driven off a user action. The only example I can think off is how we
> load WebClient lazily when updating through the SqueakMap browser.
> There (a) it's driven directly off user input and (b) the nature of
> updating necessarily involves a network connection anyway, so lazy
> loading looks like a natural part of the flow.
>
> But imagine if we used lazy loading all over the place, and you could
> never be sure when things would or wouldn't require a network
> connection. As a user things would randomly fail with mysterious
> debugger windows popping up talking about primitive failures, and as a
> product developer you wouldn't be able to know in advance that you
> shipped the image with all necessary parts.

Because lazy-loading satisfies convenience, it does not supplant the
need for the system to be able to be configured eagerly.  You either
configured properly before you left on the train, or you didn't.  If
you didn't, you're getting an error, whether lazy-loading TRIES for
you beforehand, or not.

I understand that the presence of lazy-configuration hides it from the
Dependency Browser, and this is my biggest reservation about it.  But
configuration is not done using that tool, we use other tools which
must regard the "potential-depdendency" as a dependency for the
purposes of eager configuration.