Skip to content

Restore js_of_ocaml web interpreter#955

Merged
AltGr merged 5 commits intomasterfrom
web-interpreter
Feb 16, 2026
Merged

Restore js_of_ocaml web interpreter#955
AltGr merged 5 commits intomasterfrom
web-interpreter

Conversation

@rprimet
Copy link
Contributor

@rprimet rprimet commented Feb 3, 2026

Supersedes #952 in part (other PR to come in catala-book for the web playground)

@rprimet rprimet self-assigned this Feb 3, 2026
@rprimet rprimet force-pushed the web-interpreter branch 2 times, most recently from 83687b2 to cb369c7 Compare February 3, 2026 12:48
Copy link
Contributor

@denismerigoux denismerigoux left a comment

Choose a reason for hiding this comment

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

OK for me, the overlap with #954 is very small and we should merge this first.

Copy link
Contributor

@AltGr AltGr left a comment

Choose a reason for hiding this comment

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

Nice work ! I have a few nitpicks, as always, but this feels pretty solid.

(:standard -linkall))
(js_of_ocaml
(flags
(:standard --effects=cps)))
Copy link
Contributor

Choose a reason for hiding this comment

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

I am curious why the flag, I don't believe we make any use of effects at the moment ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was due to a build warning:

Warning [missing-effects-backend]: your program contains effect handlers; you
     should probably run js_of_ocaml with option '--effects=cps'

I guess this implies that effects are being used by some library?

Comment on lines +45 to +47
"zarith_stubs_js" {>= "v0.17.0"}
"js_of_ocaml" {>= "6.0"}
"js_of_ocaml-ppx" {>= "6.0"}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make these optional dependencies ? (Open question...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll defer to you on this!

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding these tests. I'm a little worried about their maintenance though; ideally at some point we should be able to run on the scope tests in tests/ ; although this can only cover "positive" cases, not verify proper error cases.

Another solution would be to turn them into catala-test-cli, but that would require a liitle bit of additional support for clerk runtest to be able to run node catala_web_interpreter.js, feed it with the program as input and retrieve the output.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with your remark about the maintenance burden however these tests also exercise behaviors that are specific to the web version (e.g. the web interpreter API, error position reporting, user-supplied multiple files) and were sometimes written after uncovering a bug, so that may be reasonable?

There is now a loop for running (a subset of) scope tests in tests/ ; note that doing this however required a few changes in messages.ml / mli (because of unix / jsoo behavior differences) so a further review would be useful ; the nice thing is that we now surface warnings in the JS API which will help displaying them nicely in the playground editor (previously warnings were disabled and only errors were reported)

Co-Authored-By: Louis Gesbert <louis.gesbert@inria.fr>
@rprimet
Copy link
Contributor Author

rprimet commented Feb 12, 2026

@AltGr Thanks for the nice and thorough review!

@rprimet rprimet force-pushed the web-interpreter branch 3 times, most recently from 7bfe209 to e49265d Compare February 12, 2026 20:18
@AltGr AltGr merged commit 96fadb5 into master Feb 16, 2026
6 checks passed
@AltGr AltGr deleted the web-interpreter branch February 16, 2026 11:18
@github-project-automation github-project-automation bot moved this from In Progress to Done in Catala - language & tooling Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants