Skip to content

Fix, complete and unify the JSON outputs with the different backends#1045

Open
AltGr wants to merge 3 commits into
masterfrom
jsosoon
Open

Fix, complete and unify the JSON outputs with the different backends#1045
AltGr wants to merge 3 commits into
masterfrom
jsosoon

Conversation

@AltGr

@AltGr AltGr commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

At the moment, this just implement JSON output in the Python backend and fixes some small things in the OCaml one

NOTE: stacked on top of #1031

@AltGr AltGr force-pushed the printersunited branch from e4609c3 to 3a44675 Compare June 1, 2026 16:30
@AltGr AltGr changed the title Fix, complete and unify the JSON outputs with the differnet backends Fix, complete and unify the JSON outputs with the different backends Jun 2, 2026
Base automatically changed from printersunited to master June 2, 2026 08:50
AltGr added 2 commits June 5, 2026 09:36
and some fixes to the JSON output of the OCaml backend as well
The Encoding module will still be useful when we want to handle deserialisation: we'll need to:
- tweak it to work with runtime types instead of compiler types
- move it to the runtime (and add yojson to the runtime links, but it's fairly small with no extra deps; better than recoding our own parser with bugs and bad error handling)
@AltGr

AltGr commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Ah, that's annoying: CI fails in closure-conversion mode because of:
{"r":{"f":"<function>"}} vs. {"r":{"f":["<function>",[]]}}

Testing the interpreter / OCaml backend in closure conversion mode is hackish anyway¹... a nice validation while we could get it passing, but it might be time to disable it from CI if it's becoming more of a burden.

  • the closure conversion is well tested already by the C backend
  • if we remove the -O from this test it's already pretty broken anyway.

¹ the interpreter dynamically detects if it has a closure instead of a function for application, and some other tweaks; but the runtime operators are still not designed to take closures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants