Understanding the execution model?

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

Understanding the execution model?

Tim Mackinnon-6
Hi guys - slightly related to my question about where is the best documentation - I am trying to understand what the execution model of Amber is (I thought I read something about this ages ago - but all I can find is how Amber maps to JS).

Essentially, I understand that if I reload my main page - this effectively restarts everything (so I’m guessing that the ideal is to have a main page that has the most basic of frames - to bootstrap you into Amber where you get a more dynamic experience).

However, I’m not sure the above is quite true as - I was then hoping that once in a bootstrapped amber I can then save methods in helios and see them dynamically take effect. And in many cases this is true - I change a “+ 1” to “+ 5” and I see counts magically start changing. However in other examples this doesn’t seem to happen - I put a “self halt” in a method and it didn’t seem to take effect until I refreshed the page. I was also trying out the 3js example - and the render loop is a block of code, and if you edit inside that block, it didn’t seem to affect the speed of the spinning cube until I reloaded the page again as well (this one - maybe I understand, the block inlined to a function that is calling itself and my changes end up in some other method that isn’t executing?).

So I guess I’m wondering, how do I understand the execution model - so I understand what I can dynamically change like Smalltalk and what pokes out as Javascript?

Thanks,

Tim

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Understanding the execution model?

Herby Vojčík


Dňa 1. marca 2016 19:59:20 CET používateľ Tim Mackinnon <[hidden email]> napísal:

>Hi guys - slightly related to my question about where is the best
>documentation - I am trying to understand what the execution model of
>Amber is (I thought I read something about this ages ago - but all I
>can find is how Amber maps to JS).
>
>Essentially, I understand that if I reload my main page - this
>effectively restarts everything (so I’m guessing that the ideal is to
>have a main page that has the most basic of frames - to bootstrap you
>into Amber where you get a more dynamic experience).
>
>However, I’m not sure the above is quite true as - I was then hoping
>that once in a bootstrapped amber I can then save methods in helios and
>see them dynamically take effect. And in many cases this is true - I
>change a “+ 1” to “+ 5” and I see counts magically start changing.
>However in other examples this doesn’t seem to happen - I put a “self
>halt” in a method and it didn’t seem to take effect until I refreshed

It always saves and changes.
But, if the self halt is in a block that is installed at startup as an event handler, for example, than of course obly the method changed, not the handler. I hope I explained and confuse you more.

>the page. I was also trying out the 3js example - and the render loop
>is a block of code, and if you edit inside that block, it didn’t seem
>to affect the speed of the spinning cube until I reloaded the page
>again as well (this one - maybe I understand, the block inlined to a
>function that is calling itself and my changes end up in some other
>method that isn’t executing?).

Does not matter what it compiles to - but a block is always (to be read as) a value of its own which is passed somewhere or otherwise used. What you change by saving the method is just the code of method itself - but if old code keeps running in a loop, for example; it is still that old code tjat runs. New code is only run when you send the message.
But I think this is true of any Smalltalk.

>So I guess I’m wondering, how do I understand the execution model - so
>I understand what I can dynamically change like Smalltalk and what
>pokes out as Javascript?

???

>
>Thanks,
>
>Tim

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Understanding the execution model?

Tim Mackinnon-6
Thanks - that makes sense. I think I need to keep an eye on this (mentally) as there have now been a few times where I've found myself reloading the page thinking to myself that I shouldn't have to. I think it's just about me getting familiar with things.

One thing that you didn't mention - do Amber people normally create a very thin page and then do a Seaside thing to build up the page in code  (not sure how I feel about Silk yet, I need to use it in practice a bit more)?

If you do - is there any concept of an easy way to restart the page in code without refreshing the page (which seems a bit time consuming with the whole pop up dialog thing etc?)

I'm thinking along the lines of rerunning the #augmentPage method from Helios somehow?

Or is this just silly?

Tim

Sent from my iPhone

> On 1 Mar 2016, at 20:25, Herby Vojčík <[hidden email]> wrote:
>
>
>
> Dňa 1. marca 2016 19:59:20 CET používateľ Tim Mackinnon <[hidden email]> napísal:
>> Hi guys - slightly related to my question about where is the best
>> documentation - I am trying to understand what the execution model of
>> Amber is (I thought I read something about this ages ago - but all I
>> can find is how Amber maps to JS).
>>
>> Essentially, I understand that if I reload my main page - this
>> effectively restarts everything (so I’m guessing that the ideal is to
>> have a main page that has the most basic of frames - to bootstrap you
>> into Amber where you get a more dynamic experience).
>>
>> However, I’m not sure the above is quite true as - I was then hoping
>> that once in a bootstrapped amber I can then save methods in helios and
>> see them dynamically take effect. And in many cases this is true - I
>> change a “+ 1” to “+ 5” and I see counts magically start changing.
>> However in other examples this doesn’t seem to happen - I put a “self
>> halt” in a method and it didn’t seem to take effect until I refreshed
>
> It always saves and changes.
> But, if the self halt is in a block that is installed at startup as an event handler, for example, than of course obly the method changed, not the handler. I hope I explained and confuse you more.
>
>> the page. I was also trying out the 3js example - and the render loop
>> is a block of code, and if you edit inside that block, it didn’t seem
>> to affect the speed of the spinning cube until I reloaded the page
>> again as well (this one - maybe I understand, the block inlined to a
>> function that is calling itself and my changes end up in some other
>> method that isn’t executing?).
>
> Does not matter what it compiles to - but a block is always (to be read as) a value of its own which is passed somewhere or otherwise used. What you change by saving the method is just the code of method itself - but if old code keeps running in a loop, for example; it is still that old code tjat runs. New code is only run when you send the message.
> But I think this is true of any Smalltalk.
>
>> So I guess I’m wondering, how do I understand the execution model - so
>> I understand what I can dynamically change like Smalltalk and what
>> pokes out as Javascript?
>
> ???
>
>>
>> Thanks,
>>
>> Tim
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Understanding the execution model?

Herby Vojčík


Dňa 2. marca 2016 0:17:52 CET používateľ Tim Mackinnon <[hidden email]> napísal:

>Thanks - that makes sense. I think I need to keep an eye on this
>(mentally) as there have now been a few times where I've found myself
>reloading the page thinking to myself that I shouldn't have to. I think
>it's just about me getting familiar with things.
>
>One thing that you didn't mention - do Amber people normally create a
>very thin page and then do a Seaside thing to build up the page in code
>(not sure how I feel about Silk yet, I need to use it in practice a bit
>more)?
>
>If you do - is there any concept of an easy way to restart the page in
>code without refreshing the page (which seems a bit time consuming with
>the whole pop up dialog thing etc?)
>
>I'm thinking along the lines of rerunning the #augmentPage method from
>Helios somehow?

#augmentPage, as its name suggests, is meant to augment existing dead html with some life. So it's not the thin "empty page, fill with contents" thing.

Though, you can decide to do things that way, it's another approach.

Thpugh having things completely generated by code using Web seems to me (YMMV) a bit overboard, but it may be just me not familiar. Did not try with Silk, but I would probably prefer it. The nearest I got to the idea of "reset the page" was in fact a level higher, when I played with trapped. There, resetting the page was (IMNSHO) very logical, as I juat reset the model and view rerendered.

>
>Or is this just silly?
>
>Tim
>
>Sent from my iPhone
>
>> On 1 Mar 2016, at 20:25, Herby Vojčík <[hidden email]> wrote:
>>
>>
>>
>> Dňa 1. marca 2016 19:59:20 CET používateľ Tim Mackinnon
><[hidden email]> napísal:
>>> Hi guys - slightly related to my question about where is the best
>>> documentation - I am trying to understand what the execution model
>of
>>> Amber is (I thought I read something about this ages ago - but all I
>>> can find is how Amber maps to JS).
>>>
>>> Essentially, I understand that if I reload my main page - this
>>> effectively restarts everything (so I’m guessing that the ideal is
>to
>>> have a main page that has the most basic of frames - to bootstrap
>you
>>> into Amber where you get a more dynamic experience).
>>>
>>> However, I’m not sure the above is quite true as - I was then hoping
>>> that once in a bootstrapped amber I can then save methods in helios
>and
>>> see them dynamically take effect. And in many cases this is true - I
>>> change a “+ 1” to “+ 5” and I see counts magically start changing.
>>> However in other examples this doesn’t seem to happen - I put a
>“self
>>> halt” in a method and it didn’t seem to take effect until I
>refreshed
>>
>> It always saves and changes.
>> But, if the self halt is in a block that is installed at startup as
>an event handler, for example, than of course obly the method changed,
>not the handler. I hope I explained and confuse you more.
>>
>>> the page. I was also trying out the 3js example - and the render
>loop
>>> is a block of code, and if you edit inside that block, it didn’t
>seem
>>> to affect the speed of the spinning cube until I reloaded the page
>>> again as well (this one - maybe I understand, the block inlined to a
>>> function that is calling itself and my changes end up in some other
>>> method that isn’t executing?).
>>
>> Does not matter what it compiles to - but a block is always (to be
>read as) a value of its own which is passed somewhere or otherwise
>used. What you change by saving the method is just the code of method
>itself - but if old code keeps running in a loop, for example; it is
>still that old code tjat runs. New code is only run when you send the
>message.
>> But I think this is true of any Smalltalk.
>>
>>> So I guess I’m wondering, how do I understand the execution model -
>so
>>> I understand what I can dynamically change like Smalltalk and what
>>> pokes out as Javascript?
>>
>> ???
>>
>>>
>>> Thanks,
>>>
>>> Tim
>>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.