-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uniquify all Sprite preterms in [Chk-Lam] #197
Conversation
Here is another attempt at resolving #139. Introducing λ-abstractions may result in disastrous name capture, as #testAlphaClash demonstrates. This proposed fix uniquifies all λ-abstractions at [Chk-Lam] time.
I need bit more time to have a closer look, but 2 nitpicks:
Will have a closer look tomorrow, but so far I like it. |
This is an artefact of monkey-copying from upstream, searching for a compromise between maximizing similarity with the upstream (in case we need to investigate something, we bump into "wait a sec, how did this work in Haskell?") and writing sensible Smalltalk (especially when there is code duplication, like in the case you mentioned above the same code path is shared when traversing both subclasses). A big part of the problem is #62 , in Haskell it's possible to have a kind of "automatic visitors": if a complex object responds to the same visitation protocol as its constituents, the visitor can automatically recurse into each constituent, this is called |
Useful indeed. I am not sure what to do in our situation. MachineArithmetic has become a rather large codebase, and it's not following the ^ convention. If we try to start following it now, my fear is that it may cause even more confusion: when I am looking at a particular sender of |
I see. Do we want to unify it?
OK, forget it for now. This needs much broader conversation about how to host our code in ST80 (or ST15/ST20). We're not the first ones to have this problem, NewSpeak had it in its early stages too. This is an engineering problem but I feel it needs addressing sooner than later or things become much worse. |
I think the real fix would be to somehow resolve #62 (which is not today). As to fixing the symptom, we had this conversation with jmv a couple of weeks ago, didn't we? |
Consider following, admittedly pathological, code:
This typechecks in upstream sprite but not once this PR is applied.
into
(note the last If I change out |
Following should fix the above issue:
|
Hmm... I think in this "pathological" case (actually the pathology in your inner
into
However, one onion-layer outside of this, in the |
Yeah, you're right. I was too quick. Something like:
This should handle following as well:
|
I am asking myself if even that is enough. Shouldn't be there two uniquify's, one in EFun and the other in ELet? |
BTW, this seemingly-boring-bug is turning into an incredibly exciting area, due to https://arxiv.org/pdf/2001.10490.pdf |
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR shingarov#197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes shingarov#139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR shingarov#197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes shingarov#139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR shingarov#197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes shingarov#139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR shingarov#197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes shingarov#139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR shingarov#197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes shingarov#139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR shingarov#197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes shingarov#139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
This commit α-renames all variables in a separate step prior elaboration in order to avoid name clashes as demonstrated by `#testAlphaClash`. This is similar to PR #197 but differ in several ways: * perform renaming as a separate step, not as part of [Chk-Lam]. * renames all lets, not just function parameter binds * renames everything in single top-down traversal. Fixes #139 (well, not quite yet)
IIRC, we agreed this PR will be replaced by #199 once I fix the "too aggresive renaming" issue. |
Here is another attempt at resolving #139.
Introducing λ-abstractions may result in disastrous name capture, as #testAlphaClash demonstrates.
This proposed fix uniquifies all λ-abstractions at [Chk-Lam] time.