Conversation
… into claudio/check-ir
…ypD, ClassD and syntactic types
…ntroduced by tailcail.ml
…uivalence check; cleanup code
…s in record types
nomeata
left a comment
There was a problem hiding this comment.
Got some comments. Overall gut feeling is that the ir check could be further refactored to be more of a checker and less of an inference code. Given that you have type annotations on all expressions and subexpressions, you always have all types of the typing rule at hand, so the distinction between checking and inferring should disappear.
In practice subtyping might make that a bit harder than it needs to be. I would not mind an explicit “cast” AST node to contain where subtyping happens.
rossberg
left a comment
There was a problem hiding this comment.
My main question is similar to the one Joachim raised re inference vs checking, especially wrt to even doing multiple passes. Is there a plan for simplifying this in a follow-up?
But I think it makes sense to go with this as a first step.
…ly replacing effect inference on source
nomeata
left a comment
There was a problem hiding this comment.
That’s better, checking against the annotations. But I still find the code structure unnecessary non-local (and it’s probably an artifact of it descending from the type inference).
Since we have the annotations everywhere, there should be no need for a recursive function returning a type (like your infer_exp / check_exp). You have all information locally, i.e. something like this:
check_exp env e = match e.it with
| BinE (ot, exp1, op, exp2) ->
(* recurse *)
check_exp env exp1;
check_exp env exp1;
(* typing rule for this constructor *)
assert (T.sub env.cons ot (E.type e));
assert (T.sub env.cons (E.type exp1) ot);
assert (T.sub env.cons (E.type exp2) ot);
assert (Operator.has_binop t op)
(* no need to return anything *)
You maybe could even have one function (env -> exp -> ()) -> (prog -> ()) that simply traverses the tree, visits each node, updates the environment, and calls its argument, and that would be a non-recursive function that merely checks one AST node in isolation. The latter function is then a hopefully quite direct transliteration of the typing rules.
|
OK, thanks for taking a look. I'll have another go. |
…plify check_ir to avoid explicit dereferencing
nomeata
left a comment
There was a problem hiding this comment.
This is getting very nice, I like it :-)
* modified Ir.ml and desugar.ml to preserve types * tidy * use semantic, not syntactic types in IR * remove inst type from syntax (now redundant) * update tests to reflect new arrange output * simplify note on typ_bind to typ from Con.t ref * simplify pat annotations to typ from note_typ * simply annotation on types to typ from typ_note * simplify annotation on types to typ from typ_note * check_ir.ml: WIP: checking of types (only) * WIP: almost working check-ir * desugar ClassD into TypD and FuncD; fix intial env in call oo check IR * ironing out bugs * fix async lowering to also lower (new) type and kind annotations on TypD, ClassD and syntactic types * rename typbind to typ_bind, conid to con_id * check IR.ActorE and NewObj properly * add element type annotation to Ir.ArrayE and fix broken annotations introduced by tailcail.ml * annoted blocks with type after avoidance to enable checking of ir * updated tests to reflect new type annotations * remove typ_env from IR scope; replace note_typ assigment with type equivalence check; cleanup code * annotate DotE with obj_sort to simplify desugaring (in next commit) * remove con_env from desugar.ml, now that DotE is sort annotated * use Type.compare_field, not lexicographic compare, for ordering fields in record types * trivial code fixes * remove unfold_obj in favour of Type.promote * WIP, simplify check_ir to do less inference using annotations (or, in future, more type info) * ir checker: remove redundant pat code * restore checks on FuncD and DecD * gather block scope in a single pass; remove commented out code * more checking, less inference, cleanup * remove pre field from env * check_ir: fail on first error, no recovery * add check for async body, remove check_lit * spacing * clean up desugarer a little * add IR effect inference and checking of effects in check-ir; eventually replacing effect inference on source * restored ir-checking that was masking failing build * WIP; rewrite check_ir to avoid inference * cleanup * remove infer_pat*; replace by check_pat*; rename other infer_ to type_ * revise typing.ml to (re) annotate rvalues with dereferenced type; simplify check_ir to avoid explicit dereferencing * address joachim's comments and refactor some remaining error as checks * refactor <~ * add comments to T.Non <: ... cases * merge fixes
## Changelog for motoko-base: Branch: next-moc Commits: [caffeinelabs/motoko-base@d1d0e694...b0381a88](caffeinelabs/motoko-base@d1d0e69...b0381a8) * [`0631fe40`](caffeinelabs/motoko-base@0631fe4) Prepares open sourcing ([dfinity-lab/motoko-base#79](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/79)) * [`c1c116aa`](caffeinelabs/motoko-base@c1c116a) Sets up unit tests to use the `matchers` library ([dfinity-lab/motoko-base#106](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/106)) * [`8d074912`](caffeinelabs/motoko-base@8d07491) make conversions public; fix doc ([dfinity-lab/motoko-base#113](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/113)) * [`e78f49a4`](caffeinelabs/motoko-base@e78f49a) Public release: Remove old subdir of examples ([dfinity-lab/motoko-base#114](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/114)) * [`2c9d8286`](caffeinelabs/motoko-base@2c9d828) Small fix for open source ([dfinity-lab/motoko-base#115](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/115)) * [`0ca6c694`](caffeinelabs/motoko-base@0ca6c69) Adds filterMap for arrays ([dfinity-lab/motoko-base#101](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/101)) * [`754eb858`](caffeinelabs/motoko-base@754eb85) Readme: Fix vessel instructions ([dfinity-lab/motoko-base#116](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/116)) * [`ed4fcfb4`](caffeinelabs/motoko-base@ed4fcfb) adds note about requiring `vessel` to run the tests ([dfinity-lab/motoko-base#118](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/118)) * [`d04a0e21`](caffeinelabs/motoko-base@d04a0e2) Cleans up a few comments in List ([dfinity-lab/motoko-base#119](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/119)) * [`fd81ac57`](caffeinelabs/motoko-base@fd81ac5) Adds some documentation to the `HashMap` class. ([dfinity-lab/motoko-base#121](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/121)) * [`d0354489`](caffeinelabs/motoko-base@d035448) Remove WordN.toInt ([dfinity-lab/motoko-base#125](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/125))
## Changelog for motoko-base: Branch: next-moc Commits: [caffeinelabs/motoko-base@d1d0e694...b0381a88](caffeinelabs/motoko-base@d1d0e69...b0381a8) * [`0631fe40`](caffeinelabs/motoko-base@0631fe4) Prepares open sourcing ([dfinity-lab/motoko-base#79](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/79)) * [`c1c116aa`](caffeinelabs/motoko-base@c1c116a) Sets up unit tests to use the `matchers` library ([dfinity-lab/motoko-base#106](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/106)) * [`8d074912`](caffeinelabs/motoko-base@8d07491) make conversions public; fix doc ([dfinity-lab/motoko-base#113](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/113)) * [`e78f49a4`](caffeinelabs/motoko-base@e78f49a) Public release: Remove old subdir of examples ([dfinity-lab/motoko-base#114](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/114)) * [`2c9d8286`](caffeinelabs/motoko-base@2c9d828) Small fix for open source ([dfinity-lab/motoko-base#115](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/115)) * [`0ca6c694`](caffeinelabs/motoko-base@0ca6c69) Adds filterMap for arrays ([dfinity-lab/motoko-base#101](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/101)) * [`754eb858`](caffeinelabs/motoko-base@754eb85) Readme: Fix vessel instructions ([dfinity-lab/motoko-base#116](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/116)) * [`ed4fcfb4`](caffeinelabs/motoko-base@ed4fcfb) adds note about requiring `vessel` to run the tests ([dfinity-lab/motoko-base#118](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/118)) * [`d04a0e21`](caffeinelabs/motoko-base@d04a0e2) Cleans up a few comments in List ([dfinity-lab/motoko-base#119](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/119)) * [`fd81ac57`](caffeinelabs/motoko-base@fd81ac5) Adds some documentation to the `HashMap` class. ([dfinity-lab/motoko-base#121](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/121)) * [`d0354489`](caffeinelabs/motoko-base@d035448) Remove WordN.toInt ([dfinity-lab/motoko-base#125](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/125))
## Changelog for motoko-base: Branch: next-moc Commits: [caffeinelabs/motoko-base@27b7d097...0375b45d](caffeinelabs/motoko-base@27b7d09...0375b45) * [`f9f5de90`](caffeinelabs/motoko-base@f9f5de9) Revert "Remove WordN.toInt ([dfinity-lab/motoko-base#125](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/125))" and reimplement ([dfinity-lab/motoko-base#137](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/137)) * [`09f2f2ec`](caffeinelabs/motoko-base@09f2f2e) Push built documentation to GH pages ([dfinity-lab/motoko-base#78](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/78)) * [`b15c0a0d`](caffeinelabs/motoko-base@b15c0a0) Docs for TrieMap module ([dfinity-lab/motoko-base#128](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/128)) * [`012bacec`](caffeinelabs/motoko-base@012bace) Document more of Trie module; clean up. ([dfinity-lab/motoko-base#130](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/130)) * [`f635a5c7`](caffeinelabs/motoko-base@f635a5c) Document TrieSet module ([dfinity-lab/motoko-base#139](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/139)) * [`08f167de`](caffeinelabs/motoko-base@08f167d) doc comments ([dfinity-lab/motoko-base#141](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/141))
## Changelog for motoko-base: Branch: next-moc Commits: [caffeinelabs/motoko-base@27b7d097...0375b45d](caffeinelabs/motoko-base@27b7d09...0375b45) * [`f9f5de90`](caffeinelabs/motoko-base@f9f5de9) Revert "Remove WordN.toInt ([dfinity-lab/motoko-base#125](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/125))" and reimplement ([dfinity-lab/motoko-base#137](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/137)) * [`09f2f2ec`](caffeinelabs/motoko-base@09f2f2e) Push built documentation to GH pages ([dfinity-lab/motoko-base#78](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/78)) * [`b15c0a0d`](caffeinelabs/motoko-base@b15c0a0) Docs for TrieMap module ([dfinity-lab/motoko-base#128](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/128)) * [`012bacec`](caffeinelabs/motoko-base@012bace) Document more of Trie module; clean up. ([dfinity-lab/motoko-base#130](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/130)) * [`f635a5c7`](caffeinelabs/motoko-base@f635a5c) Document TrieSet module ([dfinity-lab/motoko-base#139](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/139)) * [`08f167de`](caffeinelabs/motoko-base@08f167d) doc comments ([dfinity-lab/motoko-base#141](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity-lab/motoko-base/issues/141))
## Changelog for candid: Branch: Commits: [dfinity/candid@a1dcbad4...3e3ad95a](dfinity/candid@a1dcbad...3e3ad95) * [`119703ba`](dfinity/candid@119703b) [Spec] Relax LEB128 decoding ([dfinity/candid#79](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/79)) * [`10f08432`](dfinity/candid@10f0843) Update prim.test.did * [`b2524816`](dfinity/candid@b252481) parser for test suite ([dfinity/candid#78](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/78)) * [`71bf6e76`](dfinity/candid@71bf6e7) release 0.5.2 ([dfinity/candid#80](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/80)) * [`b9f387e3`](dfinity/candid@b9f387e) test suite for JS ([dfinity/candid#81](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/81)) * [`9e5dc775`](dfinity/candid@9e5dc77) Release ([dfinity/candid#82](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/82)) * [`1df9d2d7`](dfinity/candid@1df9d2d) more candid test data ([dfinity/candid#83](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/83)) * [`9e4156d9`](dfinity/candid@9e4156d) fix newtype ([dfinity/candid#85](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/85)) * [`6880a430`](dfinity/candid@6880a43) display for types ([dfinity/candid#86](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/86)) * [`04b1b068`](dfinity/candid@04b1b06) release ([dfinity/candid#87](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/87)) * [`117c6436`](dfinity/candid@117c643) Refactor Lexer ([dfinity/candid#89](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/89)) * [`0a5789f9`](dfinity/candid@0a5789f) fix value pretty printer ([dfinity/candid#92](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/92)) * [`9f35a5aa`](dfinity/candid@9f35a5a) refactor error ([dfinity/candid#94](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/94)) * [`2e742927`](dfinity/candid@2e74292) Parse annvals in textual format ([dfinity/candid#93](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/93)) * [`0a144c79`](dfinity/candid@0a144c7) use principal from ic-types ([dfinity/candid#84](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/84)) * [`01412b14`](dfinity/candid@01412b1) release ([dfinity/candid#95](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/95)) * [`f540df54`](dfinity/candid@f540df5) release ([dfinity/candid#98](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/98)) * [`798675d8`](dfinity/candid@798675d) Add generic functions to encode/decode around a tuple ([dfinity/candid#99](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/99)) * [`0d26e568`](dfinity/candid@0d26e56) release ([dfinity/candid#100](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/100)) * [`191b6f1f`](dfinity/candid@191b6f1) Reset record_nesting_depth after each value ([dfinity/candid#101](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/101)) * [`8e7be65d`](dfinity/candid@8e7be65) fix record ([dfinity/candid#103](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/103)) * [`159533b2`](dfinity/candid@159533b) Update construct.test.did * [`a6ea0991`](dfinity/candid@a6ea099) add service initialization parameters ([dfinity/candid#88](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/88)) * [`3a1f56fa`](dfinity/candid@3a1f56f) refactor: sort dependencies and add traits for error types ([dfinity/candid#105](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/105)) * [`89df78ee`](dfinity/candid@89df78e) support service constructor ([dfinity/candid#106](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/106)) * [`738d5ed4`](dfinity/candid@738d5ed) fix for actor class codegen ([dfinity/candid#107](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/107)) * [`97ba7a0f`](dfinity/candid@97ba7a0) export init args in js ([dfinity/candid#108](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/108)) * [`d4e00adc`](dfinity/candid@d4e00ad) fix js init export ([dfinity/candid#109](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/109)) * [`c1662abe`](dfinity/candid@c1662ab) [spec] Reverse subtyping ([dfinity/candid#110](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/110)) * [`713595be`](dfinity/candid@713595b) The “reverse variant extension rule” is redundand ([dfinity/candid#113](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/113)) * [`79d49a01`](dfinity/candid@79d49a0) Spec: Opt decoding also from non-opt values ([dfinity/candid#114](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/114)) * [`2cfc0ecf`](dfinity/candid@2cfc0ec) improve pretty printing for values ([dfinity/candid#116](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/116)) * [`8fafe345`](dfinity/candid@8fafe34) Un-rename Soundness document ([dfinity/candid#115](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/115)) * [`8e6fc502`](dfinity/candid@8e6fc50) Bump spec version ([dfinity/candid#112](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/112)) * [`7cedebcb`](dfinity/candid@7cedebc) fix clippy ([dfinity/candid#117](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/117)) * [`a732a639`](dfinity/candid@a732a63) Candid UI Canister ([dfinity/candid#111](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/111)) * [`d97b271c`](dfinity/candid@d97b271) disable pretty printing for large vectors ([dfinity/candid#118](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/118)) * [`aceb7f92`](dfinity/candid@aceb7f9) derive candid type for functions ([dfinity/candid#119](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/119)) * [`c3dc0ad7`](dfinity/candid@c3dc0ad) rename derived code for CDK ([dfinity/candid#120](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/120)) * [`d1f8de7d`](dfinity/candid@d1f8de7) release ([dfinity/candid#121](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/121)) * [`3e3ad95a`](dfinity/candid@3e3ad95) remove multi-line string in test suites ([dfinity/candid#125](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/125))
## Changelog for ic-hs: Branch: master Commits: [dfinity/ic-hs@8384593e...e9132861](dfinity/ic-hs@8384593...e913286) * [`e9132861`](dfinity/ic-hs@e913286) test setting timer in timer callback ([dfinity/ic-hs#125](https://github.com/dfinity/ic-hs/issues/125))
## Changelog for ic-hs: Branch: master Commits: [dfinity/ic-hs@8384593e...e9132861](dfinity/ic-hs@8384593...e913286) * [`e9132861`](dfinity/ic-hs@e913286) test setting timer in timer callback ([dfinity/ic-hs#125](https://github.com/dfinity/ic-hs/issues/125))
A type-checker for IR.
Removes some unused effect annotations from syntax, adds a few more annotations on DotE, BlockE and DecE to enable checking. Lowers classes to object type def followed by constructor definition.
Derived from typing.ml, but could be simplified further.
Passes all existing test when run on desugared ir (the default).