Conversation
it turns out that outside `Interpret`, all fields of `Interpret.env` are always empty, with the exception of `val_env`. So it is silly and confusing to even expose that in `interpret.mli`. No user of `Interpret` needs to know about the `labs`, `rets` or `async` fields. This makes the interface a bit more narrow.
this is currently a pretty straight-forward copy of `interpret.ml` to the new IR. The test suite ensures that we get identical output with either `Interpret` or `Desugar`+`Interpret_ir` (and I checked that the test suite would report the differences if there were any). This is still uses the CPS style, and I think this is unavoidable if we want to be able to interpret our code at any stage of the pipeline, including before and after the await-translation. Also, for code resuse in `Value` (which assumes a CPS’ed function type). Fixes #141.
this makes the output from the two interpreters match in more cases (otherwise the error messages would have different source locations.)
|
Ok, the remaining differences (which are visible as |
crusso
left a comment
There was a problem hiding this comment.
Looks good to me, thought the re-use of scopes for the initial environments, though convenient, may be confusing - a scope is the output of checking/evaluating a declaration, not a general environment and it's really just a coincidence that we can use them for our initial environments.
Otherwise, looks good to me.
It mirrors what we do for the type environment. I don’t mind a different type, maybe even called “env”, in |
## Changelog for candid: Branch: master Commits: [dfinity/candid@b2b37456...b25d7361](dfinity/candid@b2b3745...b25d736) * [`b25d7361`](dfinity/candid@b25d736) Coq formalization of IDL-Soundness ([dfinity/candid#143](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/143))
## Changelog for candid: Branch: master Commits: [dfinity/candid@b2b37456...b25d7361](dfinity/candid@b2b3745...b25d736) * [`b25d7361`](dfinity/candid@b25d736) Coq formalization of IDL-Soundness ([dfinity/candid#143](http://r.duckduckgo.com/l/?uddg=https://github.com/dfinity/candid/issues/143))
## Changelog for ic-hs: Branch: master Commits: [dfinity/ic-hs@927d8152...6ddff2e4](dfinity/ic-hs@927d815...6ddff2e) * [`54dcdd0c`](dfinity/ic-hs@54dcdd0) .github/workflows/release.yml: only sync github pages on linux ([dfinity/ic-hs#143](https://github.com/dfinity/ic-hs/issues/143)) * [`81ac2e9c`](dfinity/ic-hs@81ac2e9) .github/workflows/release.yml: fix github-pages-deploy-action version ([dfinity/ic-hs#144](https://github.com/dfinity/ic-hs/issues/144)) * [`09a7b445`](dfinity/ic-hs@09a7b44) fix broken link in README ([dfinity/ic-hs#145](https://github.com/dfinity/ic-hs/issues/145)) * [`b393d8cb`](dfinity/ic-hs@b393d8c) .github/workflows/release.yml: skip coverage job on darwin ([dfinity/ic-hs#146](https://github.com/dfinity/ic-hs/issues/146)) * [`55870466`](dfinity/ic-hs@5587046) split haskell modules to reduce memory usage ([dfinity/ic-hs#142](https://github.com/dfinity/ic-hs/issues/142)) * [`6ddff2e4`](dfinity/ic-hs@6ddff2e) add httpbin implementation in Rust, bump nixpkgs, and sync universal_canister with ic monorepo ([dfinity/ic-hs#138](https://github.com/dfinity/ic-hs/issues/138))
## Changelog for ic-hs: Branch: master Commits: [dfinity/ic-hs@927d8152...808ba08b](dfinity/ic-hs@927d815...808ba08) * [`54dcdd0c`](dfinity/ic-hs@54dcdd0) .github/workflows/release.yml: only sync github pages on linux ([dfinity/ic-hs#143](https://github.com/dfinity/ic-hs/issues/143)) * [`81ac2e9c`](dfinity/ic-hs@81ac2e9) .github/workflows/release.yml: fix github-pages-deploy-action version ([dfinity/ic-hs#144](https://github.com/dfinity/ic-hs/issues/144)) * [`09a7b445`](dfinity/ic-hs@09a7b44) fix broken link in README ([dfinity/ic-hs#145](https://github.com/dfinity/ic-hs/issues/145)) * [`b393d8cb`](dfinity/ic-hs@b393d8c) .github/workflows/release.yml: skip coverage job on darwin ([dfinity/ic-hs#146](https://github.com/dfinity/ic-hs/issues/146)) * [`55870466`](dfinity/ic-hs@5587046) split haskell modules to reduce memory usage ([dfinity/ic-hs#142](https://github.com/dfinity/ic-hs/issues/142)) * [`6ddff2e4`](dfinity/ic-hs@6ddff2e) add httpbin implementation in Rust, bump nixpkgs, and sync universal_canister with ic monorepo ([dfinity/ic-hs#138](https://github.com/dfinity/ic-hs/issues/138)) * [`808ba08b`](dfinity/ic-hs@808ba08) split Multiple controllers tests ([dfinity/ic-hs#149](https://github.com/dfinity/ic-hs/issues/149))
## Changelog for ic-hs: Branch: master Commits: [dfinity/ic-hs@927d8152...bdaaa321](dfinity/ic-hs@927d815...bdaaa32) * [`54dcdd0c`](dfinity/ic-hs@54dcdd0) .github/workflows/release.yml: only sync github pages on linux ([dfinity/ic-hs#143](https://github.com/dfinity/ic-hs/issues/143)) * [`81ac2e9c`](dfinity/ic-hs@81ac2e9) .github/workflows/release.yml: fix github-pages-deploy-action version ([dfinity/ic-hs#144](https://github.com/dfinity/ic-hs/issues/144)) * [`09a7b445`](dfinity/ic-hs@09a7b44) fix broken link in README ([dfinity/ic-hs#145](https://github.com/dfinity/ic-hs/issues/145)) * [`b393d8cb`](dfinity/ic-hs@b393d8c) .github/workflows/release.yml: skip coverage job on darwin ([dfinity/ic-hs#146](https://github.com/dfinity/ic-hs/issues/146)) * [`55870466`](dfinity/ic-hs@5587046) split haskell modules to reduce memory usage ([dfinity/ic-hs#142](https://github.com/dfinity/ic-hs/issues/142)) * [`6ddff2e4`](dfinity/ic-hs@6ddff2e) add httpbin implementation in Rust, bump nixpkgs, and sync universal_canister with ic monorepo ([dfinity/ic-hs#138](https://github.com/dfinity/ic-hs/issues/138)) * [`808ba08b`](dfinity/ic-hs@808ba08) split Multiple controllers tests ([dfinity/ic-hs#149](https://github.com/dfinity/ic-hs/issues/149)) * [`bdaaa321`](dfinity/ic-hs@bdaaa32) bump cachix/install-nix-action to v20 ([dfinity/ic-hs#150](https://github.com/dfinity/ic-hs/issues/150))
## Changelog for ic-hs: Branch: master Commits: [dfinity/ic-hs@927d8152...bdaaa321](dfinity/ic-hs@927d815...bdaaa32) * [`54dcdd0c`](dfinity/ic-hs@54dcdd0) .github/workflows/release.yml: only sync github pages on linux ([dfinity/ic-hs#143](https://github.com/dfinity/ic-hs/issues/143)) * [`81ac2e9c`](dfinity/ic-hs@81ac2e9) .github/workflows/release.yml: fix github-pages-deploy-action version ([dfinity/ic-hs#144](https://github.com/dfinity/ic-hs/issues/144)) * [`09a7b445`](dfinity/ic-hs@09a7b44) fix broken link in README ([dfinity/ic-hs#145](https://github.com/dfinity/ic-hs/issues/145)) * [`b393d8cb`](dfinity/ic-hs@b393d8c) .github/workflows/release.yml: skip coverage job on darwin ([dfinity/ic-hs#146](https://github.com/dfinity/ic-hs/issues/146)) * [`55870466`](dfinity/ic-hs@5587046) split haskell modules to reduce memory usage ([dfinity/ic-hs#142](https://github.com/dfinity/ic-hs/issues/142)) * [`6ddff2e4`](dfinity/ic-hs@6ddff2e) add httpbin implementation in Rust, bump nixpkgs, and sync universal_canister with ic monorepo ([dfinity/ic-hs#138](https://github.com/dfinity/ic-hs/issues/138)) * [`808ba08b`](dfinity/ic-hs@808ba08) split Multiple controllers tests ([dfinity/ic-hs#149](https://github.com/dfinity/ic-hs/issues/149)) * [`bdaaa321`](dfinity/ic-hs@bdaaa32) bump cachix/install-nix-action to v20 ([dfinity/ic-hs#150](https://github.com/dfinity/ic-hs/issues/150))
this is currently a pretty straight-forward copy of
interpret.mltothe new IR. The test suite ensures that we get identical output with
either
InterpretorDesugar+Interpret_ir(and I checked that thetest suite would report the differences if there were any).
This is still uses the CPS style, and I think this is unavoidable if we
want to be able to interpret our code at any stage of the pipeline,
including before and after the await-translation. Also, for code resuse
in
Value(which assumes a CPS’ed function type).Fixes #141.