Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Current status of interpreter and asking for advice #4

Open
sabine opened this issue Oct 16, 2019 · 3 comments
Open

Current status of interpreter and asking for advice #4

sabine opened this issue Oct 16, 2019 · 3 comments
Labels
question Further information is requested

Comments

@sabine
Copy link

sabine commented Oct 16, 2019

Hello,

I'm looking at the interpreters of several WASM extensions (the ones that we think we could use in order to compile OCaml to WASM efficiently) to understand the current state of their implementations.

The purpose of this, from my side, is to understand how to combine the interpreters of different extensions into one WASM interpreter for a specific set of extensions. The reason I do this is to understand and find an intermediate representation for compiling OCaml to WASM (ideally one where, with low effort, we can have an interpreter in order to run tests). I believe there is something here for me to learn which could help in specifying an exception semantics for the intermediate representation of an OCaml WASM backend.

I see that, in this repository, there are multiple branches that have some code and that there seems to be a static and a dynamic semantics for exceptions. What is the current state of affairs? Anything I should read or look at (apart from the papers in the bibliography)?

@dhil
Copy link
Collaborator

dhil commented Jan 21, 2020

Hi @sabine,

First of, I would like to emphasise that this project/repository is not the official development place for the wasm exception handling. The official repository is here: https://github.com/WebAssembly/exception-handling. Although, I believe this project is ahead of the official repository in terms of implementation progress.

I see that, in this repository, there are multiple branches that have some code and that there seems to be a static and a dynamic semantics for exceptions. What is the current state of affairs?

The primary aim of this repository is to explore design considerations for implementations of effect handlers in wasm. As our starting point, we use the exception handling proposal for wasm -- as exception handling hadn't been implemented by the time we began looking into effect handlers for wasm, we decided to implement the reference interpreter for exception handling. The branch exception-handlers contains the source code for this implementation (it has been composed by the branches exn-{syntax,static-semantics,dynamic-semantics}).

The reason I do this is to understand and find an intermediate representation for compiling OCaml to WASM (ideally one where, with low effort, we can have an interpreter in order to run tests).

It is my understanding that many of the various wasm reference interpreters eventually should converge (once ratified). This reference interpreter is based on the reference-types and multi-value proposals. I would probably advice you to figure out which proposals/features you need and then merge them into one interpreter that you can use for your experiments.

@dhil dhil added the question Further information is requested label Jan 21, 2020
@sabine
Copy link
Author

sabine commented Jan 23, 2020

Although, I believe this project is ahead of the official repository in terms of implementation progress.

Looking at the official repository, I think you are right. There has been some activity recently, but it is still behind, thus this project currently seems more useful.

As our starting point, we use the exception handling proposal for wasm -- as exception handling hadn't been implemented by the time we began looking into effect handlers for wasm, we decided to implement the reference interpreter for exception handling.

Ah, that's interesting. Thanks for pointing out the relevant branches. :)

The approach in this repository looks particularly interesting, because it aims to provide a more abstract formalism in which exceptions can be implemented. Sometimes, looking at things from an abstract (but not too abstract) perspective is helpful to find simple solutions.

@dhil
Copy link
Collaborator

dhil commented Jan 23, 2020

Looking at the official repository, I think you are right. There has been some activity recently, but it is still behind, thus this project currently seems more useful.

I have offered to upstream the code in the exception-handlers branch to the official repository. I expect they will decide whether to use this code during the February 2020 wasm meeting.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants