Skip to content

[interpreter] wast.js build appears to be broken #1506

@takikawa

Description

@takikawa

There currently appear to be several issues with the wast.js build mode for the reference interpreter.

One is that Makefile steps for wast.js are a bit broken due to some changes from around Nov 2021. This is relatively easy to fix and the build can proceed to running Bucklescript. (see this commit for a fix: 4148f10)

The Bucklescript build, however, doesn't work for me. It looks like, among other things, Bucklescript doesn't support nullary variants introduced in Ocaml 4.07. It also looks like Bucklescript has rebranded as Rescript and is de-emphasizing the OCaml support (though they are attempting backwards compat). Recent OCaml release notes have stopped mentioning Bucklescript/Rescript as well: https://v2.ocaml.org/releases/4.14.0.html#Alternative-Compilers

Here's an excerpt of build errors that I get:

==== Compiling ====
bsb: [40/226] src/ast.ast
FAILED: src/ast.ast
File "/home/asumu/spec/interpreter/_build/jslib/src/ast.ml", line 44, characters 2-6:
Error: Syntax error
bsb: [41/226] src/lib.ast
FAILED: src/lib.ast
File "/home/asumu/spec/interpreter/_build/jslib/src/lib.ml", line 3, characters 0-6:
Error: Syntax error
bsb: [42/226] src/lib.iast
FAILED: src/lib.iast

I'm curious if the bsb build works for anyone else.

Given the above, I am wondering if it could make sense to use Js_of_Ocaml instead to provide the wast.js build mode. I'll upload a draft PR that implements this approach (I haven't extensively tested it, but it works for some simple encode/decode examples) to show what it would look like.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions