Skip to content

Conversation

@ammkrn
Copy link
Contributor

@ammkrn ammkrn commented Jan 1, 2026

When ready, will close #3 (also see that issue for relevant discussion).

The format is described in format_ndjson and the README has been updated accordingly, along with the recommended command for invocation; the old README recommended invoking lake exe, which will not correctly set up the lake env in the most common use case, something like exporting mathlib.

format_ndjson.md Outdated
Expr.lit (Literal.strVal)
```
{
"lit": {
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not seem to be what your program currently actually prints?

| .lit (.natVal i) => return .mkObj [("natVal", s!"{i}")]
| .lit (.strVal s) => return .mkObj [("strVal", s)]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I've pushed a correction for the format specification.

format_ndjson.md Outdated
"levelParams": Array<integer>,
"type": integer,
"value": integer,
"hints": Array<"opaque" | "abbrev" | integer>
Copy link
Contributor

Choose a reason for hiding this comment

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

This is also incorrectly documented afaict?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ditto.

Corrects two errors in the format specification for string literals and
reducibility hints.
Correct a typo of `deBruijnIndex`
@ammkrn
Copy link
Contributor Author

ammkrn commented Jan 9, 2026

The open comments should be resolved, and I believe I addressed the remaining points in #10

+ Namespaces backreferences from a generic "i" to "in", "il", and "ie" for name, level, and expr.

+ Abbreviates some json attribute names
@nomeata
Copy link

nomeata commented Jan 9, 2026

Thanks!

(Seeing how slow lean4export is I’m inclined to rewrite the exporter to use simple string interpolation into hardcoded JSON lines, at least for everything that only contains numbers, but that can wait until other dust has settled.)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC] Switch to JSON

3 participants