Clean json generation - #1102
Merged
Merged
Conversation
Collaborator
Author
|
if you're happy with this I'll update Aeneas and Eurydice |
Nadrieril
reviewed
Apr 22, 2026
Nadrieril
reviewed
Apr 22, 2026
Nadrieril
reviewed
Apr 22, 2026
Nadrieril
reviewed
Apr 22, 2026
Nadrieril
reviewed
Apr 22, 2026
Nadrieril
reviewed
Apr 22, 2026
Nadrieril
left a comment
Member
There was a problem hiding this comment.
That's so much better :') Looks great to me
N1ark
force-pushed
the
clean-json
branch
2 times, most recently
from
April 24, 2026 11:35
af6828e to
3367ed0
Compare
Move files to first decl
N1ark
force-pushed
the
clean-json
branch
2 times, most recently
from
April 24, 2026 17:00
72d1dbf to
16055a1
Compare
This was referenced Apr 24, 2026
Nadrieril
reviewed
Apr 27, 2026
| None => false, | ||
| Some(ty) => self.type_to_ocaml_ident_raw(ty).0 == "translated_crate", | ||
| } | ||
| self.current_item == Some("translated_crate".to_string()) |
Member
There was a problem hiding this comment.
No need to fix this but fyi self.current_item.as_deref() == Some("translated_crate") exists :)
Member
|
Let's goooo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR sets up the codebase to enable the addition of a new serialisation format, using serde's postcard format.
This cleans up a lot of ad-hoc behaviours in serialisation: the crate's type is now entirely derived, and it's deserialiser entirely generated too, with only a tiny wrapper to get a more nicely shaped crate out of it.
More precisely:
generate-ml/main.rs(previously 1400 lines) into several modules:to_ocaml_tyfor the generation of OCaml types,of_jsonfor the generation of the JSON deserializer, andutil.Generated_FullAst.ml(exposed inGAst.ml), which contains the "root" types of the AST that weren't generated before:translated_crateandbody(and I also moved some related types in there)_OfJsonfiles, to simplify translationPrint_files, to also simplify thingsI tried splitting the commits to be as reviewable as possible; note that OCaml does not compile from commit 4 (Add
FullAst) to commit 10 (Merge allOfJson), since making everything compile in one go would have been too big of a commit.ci: use AeneasVerif/aeneas#959
ci: use AeneasVerif/eurydice#397