Skip to content

An interpreter for the IR#143

Merged
crusso merged 4 commits intomasterfrom
joachim/interpret-ir
Feb 5, 2019
Merged

An interpreter for the IR#143
crusso merged 4 commits intomasterfrom
joachim/interpret-ir

Conversation

@nomeata
Copy link
Contributor

@nomeata nomeata commented Feb 5, 2019

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.

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.)
@nomeata
Copy link
Contributor Author

nomeata commented Feb 5, 2019

Ok, the remaining differences (which are visible as */ok/*.diff-ir.ok files) are due to the fact that the desugaring pass does not handle class identities properly. This anticipates #81.

@crusso crusso self-requested a review February 5, 2019 11:37
Copy link
Contributor

@crusso crusso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@crusso crusso merged commit 5ffac8c into master Feb 5, 2019
@nomeata
Copy link
Contributor Author

nomeata commented Feb 5, 2019

thought the re-use of scopes for the initial environments, though convenient, may be confusing

It mirrors what we do for the type environment. I don’t mind a different type, maybe even called “env”, in interpret.mli, as long as it does not have the unused fields it has before (or is simply abstract).

@nomeata nomeata deleted the joachim/interpret-ir branch February 5, 2019 13:48
dfinity-bot added a commit that referenced this pull request Dec 5, 2020
mergify bot pushed a commit that referenced this pull request Dec 5, 2020
dfinity-bot added a commit that referenced this pull request Feb 28, 2023
## 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))
dfinity-bot added a commit that referenced this pull request Mar 1, 2023
## 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))
dfinity-bot added a commit that referenced this pull request Mar 2, 2023
## 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))
mergify bot pushed a commit that referenced this pull request Mar 2, 2023
## 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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants