#recompile:from: does not apply syntax error fixes

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

#recompile:from: does not apply syntax error fixes

Christoph Thiede

Hi all,


you remember Compiler-ct.417? I have been carrying this change around with my image for a few months, and when the migration to Sista was published recently, I got a number of SyntaxErrors from Trunk methods that do not follow the vertical bar rule we agreed on. I'll fix these errors, depending on Compiler-ct.417, soon - however, I think there could be a problem with the current #recompile:from: logic. After fixing the Syntax errors while all selectors were being recompiled, the new source code had not been applied to the methods. I think the reason could be that we reuse the old method trailer instead of simply starting with a fresh one.


But I don't know many details about CompiledMethodTrailers. Would it be a good idea to discard the old trailer when recompiling any method? Concretely, we could send #generate to methodNode rather than #generate:.


Best,

Christoph



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

Re: #recompile:from: does not apply syntax error fixes

Levente Uzonyi
Hi Christoph,

The trailer can hold many different things, but it's main goal is to
make it possible to recreate the source code of a method. Normally (in
case of a regular method with sources and changes files available) it
holds an offset to the sources or changes file. At that offset starts the
source chunk of the method.
So, changing the trailer only makes sense when the source code changes,
and new code is written to the changes file.

#recompile:from: assumes that the source code has not been changed, so
leaving the trailer intact seems reasonable to me.

Should there be an error with the source code during #recompile:from:,
you've got no way to fix it because of the above. The error must be
detected beforehand, and the method must not be recompiled but compiled.


Levente

On Mon, 16 Mar 2020, Thiede, Christoph wrote:

>
> Hi all,
>
>
> you remember Compiler-ct.417? I have been carrying this change around with my image for a few months, and when the migration to Sista was published recently, I got a number of SyntaxErrors from Trunk methods that do not follow the vertical bar rule we agreed on. I'll fix these errors, depending on
> Compiler-ct.417, soon - however, I think there could be a problem with the current #recompile:from: logic. After fixing the Syntax errors while all selectors were being recompiled, the new source code had not been applied to the methods. I think the reason could be that we reuse the old method trailer instead of
> simply starting with a fresh one.
>
>
> But I don't know many details about CompiledMethodTrailers. Would it be a good idea to discard the old trailer when recompiling any method? Concretely, we could send #generate to methodNode rather than #generate:.
>
>
> Best,
>
> Christoph
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: #recompile:from: does not apply syntax error fixes

Nicolas Cellier
Hi all,
I guess that Christoph corrected code directly in the SyntaxError window that pops up. This has an effect on compiledCode, but not on sourceCode...

Le lun. 16 mars 2020 à 23:06, Levente Uzonyi <[hidden email]> a écrit :
Hi Christoph,

The trailer can hold many different things, but it's main goal is to
make it possible to recreate the source code of a method. Normally (in
case of a regular method with sources and changes files available) it
holds an offset to the sources or changes file. At that offset starts the
source chunk of the method.
So, changing the trailer only makes sense when the source code changes,
and new code is written to the changes file.

#recompile:from: assumes that the source code has not been changed, so
leaving the trailer intact seems reasonable to me.

Should there be an error with the source code during #recompile:from:,
you've got no way to fix it because of the above. The error must be
detected beforehand, and the method must not be recompiled but compiled.


Levente

On Mon, 16 Mar 2020, Thiede, Christoph wrote:

>
> Hi all,
>
>
> you remember Compiler-ct.417? I have been carrying this change around with my image for a few months, and when the migration to Sista was published recently, I got a number of SyntaxErrors from Trunk methods that do not follow the vertical bar rule we agreed on. I'll fix these errors, depending on
> Compiler-ct.417, soon - however, I think there could be a problem with the current #recompile:from: logic. After fixing the Syntax errors while all selectors were being recompiled, the new source code had not been applied to the methods. I think the reason could be that we reuse the old method trailer instead of
> simply starting with a fresh one.
>
>
> But I don't know many details about CompiledMethodTrailers. Would it be a good idea to discard the old trailer when recompiling any method? Concretely, we could send #generate to methodNode rather than #generate:.
>
>
> Best,
>
> Christoph
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: #recompile:from: does not apply syntax error fixes

Christoph Thiede

I guess that Christoph corrected code directly in the SyntaxError window that pops up. This has an effect on compiledCode, but not on sourceCode...


Exactly, and that's quite confusing. :)


Von: Squeak-dev <[hidden email]> im Auftrag von Nicolas Cellier <[hidden email]>
Gesendet: Montag, 16. März 2020 23:38:16
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] #recompile:from: does not apply syntax error fixes
 
Hi all,
I guess that Christoph corrected code directly in the SyntaxError window that pops up. This has an effect on compiledCode, but not on sourceCode...

Le lun. 16 mars 2020 à 23:06, Levente Uzonyi <[hidden email]> a écrit :
Hi Christoph,

The trailer can hold many different things, but it's main goal is to
make it possible to recreate the source code of a method. Normally (in
case of a regular method with sources and changes files available) it
holds an offset to the sources or changes file. At that offset starts the
source chunk of the method.
So, changing the trailer only makes sense when the source code changes,
and new code is written to the changes file.

#recompile:from: assumes that the source code has not been changed, so
leaving the trailer intact seems reasonable to me.

Should there be an error with the source code during #recompile:from:,
you've got no way to fix it because of the above. The error must be
detected beforehand, and the method must not be recompiled but compiled.


Levente

On Mon, 16 Mar 2020, Thiede, Christoph wrote:

>
> Hi all,
>
>
> you remember Compiler-ct.417? I have been carrying this change around with my image for a few months, and when the migration to Sista was published recently, I got a number of SyntaxErrors from Trunk methods that do not follow the vertical bar rule we agreed on. I'll fix these errors, depending on
> Compiler-ct.417, soon - however, I think there could be a problem with the current #recompile:from: logic. After fixing the Syntax errors while all selectors were being recompiled, the new source code had not been applied to the methods. I think the reason could be that we reuse the old method trailer instead of
> simply starting with a fresh one.
>
>
> But I don't know many details about CompiledMethodTrailers. Would it be a good idea to discard the old trailer when recompiling any method? Concretely, we could send #generate to methodNode rather than #generate:.
>
>
> Best,
>
> Christoph
>
>
>


Carpe Squeak!