IUCompilerCourse / Essentials-of-Compilation

A book about compiling Racket and Python to x86-64 assembly
1.28k stars 140 forks source link

Chapter 6 fixes to python ed #100

Closed proglang closed 2 years ago

proglang commented 2 years ago

clarifications and minor corrections

proglang commented 2 years ago

Actually, there is an issue that perhaps didn't come out that clearly.

In CIf, a let-construct appears. It disappears again in CLoop and gets replaced by a begin-expression in CTuple. I don't see a clear strategy behind this. One can argue that let is no longer need when begin appears. But CLoop should have let, right?

You could also consider starting with begin right away in place of let.

On 02.12.21 02:03, Jeremy G. Siek wrote:

@.**** approved this pull request.

Thanks!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/IUCompilerCourse/Essentials-of-Compilation/pull/100#pullrequestreview-820953483, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACW5DPUMOZOKQKWVXKHYCETUO3AUXANCNFSM5JFPWRPA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jsiek commented 2 years ago

On Thu, Dec 2, 2021 at 3:59 AM Programming Languages Uni Freiburg < @.***> wrote:

Actually, there is an issue that perhaps didn't come out that clearly.

In CIf, a let-construct appears.

'let' appears in L^mon_If but then gets translated away in CIf.

It disappears again in CLoop

looks like there's a typo in L^mon_While. It should include 'let'. The reference implementation still uses 'let'.

I've been macro-ifying the grammars, which is helping to prevent these kind of inconsistencies, but I haven't gotten to the L^mon grammars.

and gets replaced by a begin-expression in CTuple. I don't see a clear strategy behind this. One can argue that let is no longer need when begin appears. But CLoop should have let, right?

You could also consider starting with begin right away in place of let.

I like that suggestion.

Cheers, Jeremy

On 02.12.21 02:03, Jeremy G. Siek wrote:

@.**** approved this pull request.

Thanks!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/IUCompilerCourse/Essentials-of-Compilation/pull/100#pullrequestreview-820953483>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACW5DPUMOZOKQKWVXKHYCETUO3AUXANCNFSM5JFPWRPA . Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>

or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/IUCompilerCourse/Essentials-of-Compilation/pull/100#issuecomment-984423912, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5IGPFCBPB2LUP2HMSPZLDUO4YQTANCNFSM5JFPWRPA .