The Trunk: Compiler-nice.457.mcz

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

The Trunk: Compiler-nice.457.mcz

commits-2
Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-nice.457.mcz

==================== Summary ====================

Name: Compiler-nice.457
Author: nice
Time: 16 April 2021, 10:19:30.223501 pm
UUID: e2ce8f47-9ed2-0d46-aca1-1dd90ebed4b4
Ancestors: Compiler-nice.456

Rename resume: source -> retryWithNewSource: source.

The purpose of such exception handling is indeed to retry the compilation with new source.

The purpose of resume: anObject is to return anObject to the context that sent signal, that's a slightly different semantic.

It happens that if we resume after setting newSource, the signaller (Parser>>notify:at:) will effectively then tryNewSourceIfAvailable.
So effectively, resuming will end up in retrying (if there is a handler of ReparseAfterSourceEditing up the sender stack, but the Parser normally puts one).

But, even if this is HOW we implement the #retryWithNewSource:,
this is not WHAT we wish to ask to the SyntaxErrorNotification.
in other words, we shouldn't let the implementation leak in the semantics, otherwise we put the burden of understanding the implementation on the shoulders of programmers, when they could just have trusted the semantics of pseudo natural language offered by keywords.

While at it, remove the accessors of newSource.
They are not used and may be considered private.
This will reduce the unecessary polymorphism.

=============== Diff against Compiler-nice.456 ===============

Item was removed:
- ----- Method: SyntaxErrorNotification>>newSource (in category 'accessing') -----
- newSource
- ^newSource!

Item was removed:
- ----- Method: SyntaxErrorNotification>>newSource: (in category 'accessing') -----
- newSource: aTextOrString
- newSource := aTextOrString!

Item was removed:
- ----- Method: SyntaxErrorNotification>>resume: (in category 'accessing') -----
- resume: source
-
- self reparse: source notifying: nil ifFail: nil.
- ^ super resume: self defaultResumeValue!

Item was added:
+ ----- Method: SyntaxErrorNotification>>retryWithNewSource: (in category 'handling') -----
+ retryWithNewSource: source
+ "Retry the compilation with new source code.
+ Assume
+ - that the signallerContext will tryNewSourceIfAvailable
+ - the presence of a handler of ReparseAfterSourceEditing on the sender stack"
+
+ newSource := source.
+ ^ self resume!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Compiler-nice.457.mcz

Christoph Thiede

Hi Nicolas,


the renaming is a breaking change. We should make sure to document such changes in the changelog for the next release.


Best,
Christoph

Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Freitag, 16. April 2021 22:19:40
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: Compiler-nice.457.mcz
 
Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-nice.457.mcz

==================== Summary ====================

Name: Compiler-nice.457
Author: nice
Time: 16 April 2021, 10:19:30.223501 pm
UUID: e2ce8f47-9ed2-0d46-aca1-1dd90ebed4b4
Ancestors: Compiler-nice.456

Rename resume: source -> retryWithNewSource: source.

The purpose of such exception handling is indeed to retry the compilation with new source.

The purpose of resume: anObject is to return anObject to the context that sent signal, that's a slightly different semantic.

It happens that if we resume after setting newSource, the signaller (Parser>>notify:at:) will effectively then tryNewSourceIfAvailable.
So effectively, resuming will end up in retrying (if there is a handler of ReparseAfterSourceEditing up the sender stack, but the Parser normally puts one).

But, even if this is HOW we implement the #retryWithNewSource:,
this is not WHAT we wish to ask to the SyntaxErrorNotification.
in other words, we shouldn't let the implementation leak in the semantics, otherwise we put the burden of understanding the implementation on the shoulders of programmers, when they could just have trusted the semantics of pseudo natural language offered by keywords.

While at it, remove the accessors of newSource.
They are not used and may be considered private.
This will reduce the unecessary polymorphism.

=============== Diff against Compiler-nice.456 ===============

Item was removed:
- ----- Method: SyntaxErrorNotification>>newSource (in category 'accessing') -----
- newSource
-        ^newSource!

Item was removed:
- ----- Method: SyntaxErrorNotification>>newSource: (in category 'accessing') -----
- newSource: aTextOrString
-        newSource := aTextOrString!

Item was removed:
- ----- Method: SyntaxErrorNotification>>resume: (in category 'accessing') -----
- resume: source
-
-        self reparse: source notifying: nil ifFail: nil.
-        ^ super resume: self defaultResumeValue!

Item was added:
+ ----- Method: SyntaxErrorNotification>>retryWithNewSource: (in category 'handling') -----
+ retryWithNewSource: source
+        "Retry the compilation with new source code.
+        Assume
+        - that the signallerContext will tryNewSourceIfAvailable
+        - the presence of a handler of ReparseAfterSourceEditing on the sender stack"
+       
+        newSource := source.
+        ^ self resume!




Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Compiler-nice.457.mcz

Nicolas Cellier
Hi Christoph,
given that resume: was a recent addition, i don't think that we must
care too much.
https://source.squeak.org/trunk/Compiler-ct.405.diff
Maybe we released Squeak 5.3 since?
In this case, it MUST at least be in the release notes indeed.


Le lun. 19 avr. 2021 à 13:11, Thiede, Christoph
<[hidden email]> a écrit :

>
> Hi Nicolas,
>
>
> the renaming is a breaking change. We should make sure to document such changes in the changelog for the next release.
>
>
> Best,
> Christoph
> ________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
> Gesendet: Freitag, 16. April 2021 22:19:40
> An: [hidden email]; [hidden email]
> Betreff: [squeak-dev] The Trunk: Compiler-nice.457.mcz
>
> Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
> http://source.squeak.org/trunk/Compiler-nice.457.mcz
>
> ==================== Summary ====================
>
> Name: Compiler-nice.457
> Author: nice
> Time: 16 April 2021, 10:19:30.223501 pm
> UUID: e2ce8f47-9ed2-0d46-aca1-1dd90ebed4b4
> Ancestors: Compiler-nice.456
>
> Rename resume: source -> retryWithNewSource: source.
>
> The purpose of such exception handling is indeed to retry the compilation with new source.
>
> The purpose of resume: anObject is to return anObject to the context that sent signal, that's a slightly different semantic.
>
> It happens that if we resume after setting newSource, the signaller (Parser>>notify:at:) will effectively then tryNewSourceIfAvailable.
> So effectively, resuming will end up in retrying (if there is a handler of ReparseAfterSourceEditing up the sender stack, but the Parser normally puts one).
>
> But, even if this is HOW we implement the #retryWithNewSource:,
> this is not WHAT we wish to ask to the SyntaxErrorNotification.
> in other words, we shouldn't let the implementation leak in the semantics, otherwise we put the burden of understanding the implementation on the shoulders of programmers, when they could just have trusted the semantics of pseudo natural language offered by keywords.
>
> While at it, remove the accessors of newSource.
> They are not used and may be considered private.
> This will reduce the unecessary polymorphism.
>
> =============== Diff against Compiler-nice.456 ===============
>
> Item was removed:
> - ----- Method: SyntaxErrorNotification>>newSource (in category 'accessing') -----
> - newSource
> -        ^newSource!
>
> Item was removed:
> - ----- Method: SyntaxErrorNotification>>newSource: (in category 'accessing') -----
> - newSource: aTextOrString
> -        newSource := aTextOrString!
>
> Item was removed:
> - ----- Method: SyntaxErrorNotification>>resume: (in category 'accessing') -----
> - resume: source
> -
> -        self reparse: source notifying: nil ifFail: nil.
> -        ^ super resume: self defaultResumeValue!
>
> Item was added:
> + ----- Method: SyntaxErrorNotification>>retryWithNewSource: (in category 'handling') -----
> + retryWithNewSource: source
> +        "Retry the compilation with new source code.
> +        Assume
> +        - that the signallerContext will tryNewSourceIfAvailable
> +        - the presence of a handler of ReparseAfterSourceEditing on the sender stack"
> +
> +        newSource := source.
> +        ^ self resume!
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Compiler-nice.457.mcz

Christoph Thiede

Hi Nicolas,


Squeak 5.3 has Compiler-eem.416 and "resume: source". So this is worth a mention in the release note.


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Nicolas Cellier <[hidden email]>
Gesendet: Montag, 19. April 2021 14:29:34
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] The Trunk: Compiler-nice.457.mcz
 
Hi Christoph,
given that resume: was a recent addition, i don't think that we must
care too much.
https://source.squeak.org/trunk/Compiler-ct.405.diff
Maybe we released Squeak 5.3 since?
In this case, it MUST at least be in the release notes indeed.


Le lun. 19 avr. 2021 à 13:11, Thiede, Christoph
<[hidden email]> a écrit :
>
> Hi Nicolas,
>
>
> the renaming is a breaking change. We should make sure to document such changes in the changelog for the next release.
>
>
> Best,
> Christoph
> ________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
> Gesendet: Freitag, 16. April 2021 22:19:40
> An: [hidden email]; [hidden email]
> Betreff: [squeak-dev] The Trunk: Compiler-nice.457.mcz
>
> Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
> http://source.squeak.org/trunk/Compiler-nice.457.mcz
>
> ==================== Summary ====================
>
> Name: Compiler-nice.457
> Author: nice
> Time: 16 April 2021, 10:19:30.223501 pm
> UUID: e2ce8f47-9ed2-0d46-aca1-1dd90ebed4b4
> Ancestors: Compiler-nice.456
>
> Rename resume: source -> retryWithNewSource: source.
>
> The purpose of such exception handling is indeed to retry the compilation with new source.
>
> The purpose of resume: anObject is to return anObject to the context that sent signal, that's a slightly different semantic.
>
> It happens that if we resume after setting newSource, the signaller (Parser>>notify:at:) will effectively then tryNewSourceIfAvailable.
> So effectively, resuming will end up in retrying (if there is a handler of ReparseAfterSourceEditing up the sender stack, but the Parser normally puts one).
>
> But, even if this is HOW we implement the #retryWithNewSource:,
> this is not WHAT we wish to ask to the SyntaxErrorNotification.
> in other words, we shouldn't let the implementation leak in the semantics, otherwise we put the burden of understanding the implementation on the shoulders of programmers, when they could just have trusted the semantics of pseudo natural language offered by keywords.
>
> While at it, remove the accessors of newSource.
> They are not used and may be considered private.
> This will reduce the unecessary polymorphism.
>
> =============== Diff against Compiler-nice.456 ===============
>
> Item was removed:
> - ----- Method: SyntaxErrorNotification>>newSource (in category 'accessing') -----
> - newSource
> -        ^newSource!
>
> Item was removed:
> - ----- Method: SyntaxErrorNotification>>newSource: (in category 'accessing') -----
> - newSource: aTextOrString
> -        newSource := aTextOrString!
>
> Item was removed:
> - ----- Method: SyntaxErrorNotification>>resume: (in category 'accessing') -----
> - resume: source
> -
> -        self reparse: source notifying: nil ifFail: nil.
> -        ^ super resume: self defaultResumeValue!
>
> Item was added:
> + ----- Method: SyntaxErrorNotification>>retryWithNewSource: (in category 'handling') -----
> + retryWithNewSource: source
> +        "Retry the compilation with new source code.
> +        Assume
> +        - that the signallerContext will tryNewSourceIfAvailable
> +        - the presence of a handler of ReparseAfterSourceEditing on the sender stack"
> +
> +        newSource := source.
> +        ^ self resume!
>
>
>



Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Compiler-nice.457.mcz

marcel.taeumel
So this is worth a mention in the release note.

Best,
Marcel

Am 19.04.2021 15:09:43 schrieb Thiede, Christoph <[hidden email]>:

Hi Nicolas,


Squeak 5.3 has Compiler-eem.416 and "resume: source". So this is worth a mention in the release note.


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Nicolas Cellier <[hidden email]>
Gesendet: Montag, 19. April 2021 14:29:34
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] The Trunk: Compiler-nice.457.mcz
 
Hi Christoph,
given that resume: was a recent addition, i don't think that we must
care too much.
https://source.squeak.org/trunk/Compiler-ct.405.diff
Maybe we released Squeak 5.3 since?
In this case, it MUST at least be in the release notes indeed.


Le lun. 19 avr. 2021 à 13:11, Thiede, Christoph
<[hidden email]> a écrit :
>
> Hi Nicolas,
>
>
> the renaming is a breaking change. We should make sure to document such changes in the changelog for the next release.
>
>
> Best,
> Christoph
> ________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
> Gesendet: Freitag, 16. April 2021 22:19:40
> An: [hidden email]; [hidden email]
> Betreff: [squeak-dev] The Trunk: Compiler-nice.457.mcz
>
> Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
> http://source.squeak.org/trunk/Compiler-nice.457.mcz
>
> ==================== Summary ====================
>
> Name: Compiler-nice.457
> Author: nice
> Time: 16 April 2021, 10:19:30.223501 pm
> UUID: e2ce8f47-9ed2-0d46-aca1-1dd90ebed4b4
> Ancestors: Compiler-nice.456
>
> Rename resume: source -> retryWithNewSource: source.
>
> The purpose of such exception handling is indeed to retry the compilation with new source.
>
> The purpose of resume: anObject is to return anObject to the context that sent signal, that's a slightly different semantic.
>
> It happens that if we resume after setting newSource, the signaller (Parser>>notify:at:) will effectively then tryNewSourceIfAvailable.
> So effectively, resuming will end up in retrying (if there is a handler of ReparseAfterSourceEditing up the sender stack, but the Parser normally puts one).
>
> But, even if this is HOW we implement the #retryWithNewSource:,
> this is not WHAT we wish to ask to the SyntaxErrorNotification.
> in other words, we shouldn't let the implementation leak in the semantics, otherwise we put the burden of understanding the implementation on the shoulders of programmers, when they could just have trusted the semantics of pseudo natural language offered by keywords.
>
> While at it, remove the accessors of newSource.
> They are not used and may be considered private.
> This will reduce the unecessary polymorphism.
>
> =============== Diff against Compiler-nice.456 ===============
>
> Item was removed:
> - ----- Method: SyntaxErrorNotification>>newSource (in category 'accessing') -----
> - newSource
> -        ^newSource!
>
> Item was removed:
> - ----- Method: SyntaxErrorNotification>>newSource: (in category 'accessing') -----
> - newSource: aTextOrString
> -        newSource := aTextOrString!
>
> Item was removed:
> - ----- Method: SyntaxErrorNotification>>resume: (in category 'accessing') -----
> - resume: source
> -
> -        self reparse: source notifying: nil ifFail: nil.
> -        ^ super resume: self defaultResumeValue!
>
> Item was added:
> + ----- Method: SyntaxErrorNotification>>retryWithNewSource: (in category 'handling') -----
> + retryWithNewSource: source
> +        "Retry the compilation with new source code.
> +        Assume
> +        - that the signallerContext will tryNewSourceIfAvailable
> +        - the presence of a handler of ReparseAfterSourceEditing on the sender stack"
> +
> +        newSource := source.
> +        ^ self resume!
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Compiler-nice.457.mcz

Christoph Thiede
Hi Nicolas,

your removal of #newSource broke the handling of syntax errors in
Monticello, see MethodAddition >> #createCompiledMethod. Would you mind
restoring them if you cannot find another solution? :-)

Best,
Christoph



-----
Carpe Squeak!
--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Compiler-nice.457.mcz

Nicolas Cellier
Hi Christoph,
Done!
I missed this usage indeed, case of blindness...

Le jeu. 29 avr. 2021 à 15:25, Christoph Thiede
<[hidden email]> a écrit :

>
> Hi Nicolas,
>
> your removal of #newSource broke the handling of syntax errors in
> Monticello, see MethodAddition >> #createCompiledMethod. Would you mind
> restoring them if you cannot find another solution? :-)
>
> Best,
> Christoph
>
>
>
> -----
> Carpe Squeak!
> --
> Sent from: http://forum.world.st/Squeak-Dev-f45488.html
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Compiler-nice.457.mcz

Christoph Thiede

Great, thank you! :-)


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Nicolas Cellier <[hidden email]>
Gesendet: Donnerstag, 29. April 2021 19:49:13
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] The Trunk: Compiler-nice.457.mcz
 
Hi Christoph,
Done!
I missed this usage indeed, case of blindness...

Le jeu. 29 avr. 2021 à 15:25, Christoph Thiede
<[hidden email]> a écrit :
>
> Hi Nicolas,
>
> your removal of #newSource broke the handling of syntax errors in
> Monticello, see MethodAddition >> #createCompiledMethod. Would you mind
> restoring them if you cannot find another solution? :-)
>
> Best,
> Christoph
>
>
>
> -----
> Carpe Squeak!
> --
> Sent from: http://forum.world.st/Squeak-Dev-f45488.html
>



Carpe Squeak!