Improve Aggregation
type:none
This MR improves a few this in the Aggregation pass :
- Use of
add_prefix
andinternal_get_name_and_counter
which should be avoided. - Scope data are stored in a map for faster lock up
- Deduplication of all binder inside a module is changed by the deduplication of module binder before aggregating
- The current pass works in two step: Ast_typed -> list of locally defined decl -> Ast_aggregated. The new pass work in one step : Ast_typed to Ast_aggregated (and a preprocessing before). Therefore all functions are direct mappers.
- Expose function that doesn't take the local module as parameters.
- Separate the deduplication in an independent self-pass for redability.
- Homogenisation with the other pass
Side-effect : this change triggered a bug in the monomorphisation self-pass that is solved in the MR.
Merge request reports
Activity
mentioned in merge request !1490 (closed)
assigned to @pewulfman
mentioned in merge request !1524 (merged)
added 121 commits
-
cef10b6a...1cb6ddd0 - 104 commits from branch
dev
- 77329f5f - add type_abstraction
- f871edc7 - wip:change cameligo abstraction; problem in typechecking
- 5c9bfafb - Fix type-checking & promote
- d67b05a6 - move detection of free polymorphic variable to the abstractors
- 0da7380f - remove dead code
- 934b348c - Move non-annotated test case to positives
- 46a09e00 - Fix regression
- c251a7b8 - fix some regression
- 826b4e25 - add test for big lambda
- f3f9233f - add self-ast-core pass
- 649d222f - add changelog
- 9ba6a91d - make variable uncompatible
- ab1cfca1 - change representation of generated variable
- 80b80634 - PP_annotated
- 6f764cc7 - remove trailling error
- ffefe1ee - add regression test
- 91696cae - aggregation done; remove_aliases break shadowing
Toggle commit list-
cef10b6a...1cb6ddd0 - 104 commits from branch
- Resolved by Pierre-Emmanuel Wulfman
I can really explain why, but I got the impression that the current aggregation pass is too complex.
Possibly, but I will believe it when I see it.. Right now all the matchings tests (where a lot of shadowing is happening) are breaking. Hint:
- All the generated variable here should be fresh, but when I make them fresh everything breaks big time
- I feel the module/record accesses case is the source of this
Also, it removes module aliases, which i don't think the pass should do.
I believe you meant that aggregation was not replacing module aliases by a let aliase ? if yes, we can agree on that. But then I will argue against the
remove_alias
self pass?However, the monomorphisation pass doesn't work when there is too much indirection between the variable and the definition of the polymorphic function (or maybe I just don't propagate the types correctly)
That sounds extremely fishy. Whatever a pass does, it should preserve the soundness of the program it runs on. Your aggregation pass introduce type inconsistency that you are then partially " "fixing" " in remove_alias
added 1744 commits
-
91696cae...df561552 - 1740 commits from branch
dev
- f9bcbc4a - PP_annotated
- 2ecbc962 - remove trailling error
- eee4127b - add regression test
- bbdbb49e - aggregation done; remove_aliases break shadowing
Toggle commit list-
91696cae...df561552 - 1740 commits from branch
added 109 commits
Toggle commit listadded 120 commits
-
ad1f1ac9...2157dbd0 - 111 commits from branch
dev
- 0041dc5b - PP_annotated
- b45d629e - remove trailling error
- b6c080af - add regression test
- 978842e9 - aggregation done; remove_aliases break shadowing
- f5226067 - don't succeed. Redesign
- 2fb0da9b - wip
- f6e2b636 - reraise error
- adeee189 - fix bug due to incorrect library
- 6c5009c9 - clean up monomorphisation
Toggle commit list-
ad1f1ac9...2157dbd0 - 111 commits from branch
added 69 commits
-
6c5009c9...d5fd8ad6 - 60 commits from branch
dev
- 85e63111 - PP_annotated
- 9a26a903 - remove trailling error
- 7fab3192 - add regression test
- b4000123 - aggregation done; remove_aliases break shadowing
- c5e68465 - don't succeed. Redesign
- 49fe1db6 - wip
- f5cd2ba2 - reraise error
- b16c84ff - fix bug due to incorrect library
- 0b20d323 - clean up monomorphisation
Toggle commit list-
6c5009c9...d5fd8ad6 - 60 commits from branch