Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Math superset of JSON? #66

Closed
dy opened this issue Oct 8, 2021 · 13 comments
Closed

Math superset of JSON? #66

dy opened this issue Oct 8, 2021 · 13 comments

Comments

@dy
Copy link

dy commented Oct 8, 2021

Is there a subset in between Jessie and JSON?
image
Something that takes JSON primitives and enables calc operations, Math superset of JSON?
That JSON+ops syntax is (almost) cross-platform: Rust, Go, C++, C#, Python, Perl? could support that.
That could be a tiny useful thing for any template engines, template instantiation proposal, evaluable/calc strings (like css calc), and other playgrounds.

@erights
Copy link
Contributor

erights commented Oct 9, 2021

There is! Justin , defined at https://github.com/agoric-labs/jessica/blob/master/lib/quasi-justin.js.ts

@michaelfig @dckc do we have anything else on Justin?

@dckc
Copy link
Contributor

dckc commented Oct 9, 2021

No, that's the only material I know on Justin.

@dy
Copy link
Author

dy commented Oct 9, 2021

That's perfect! Is that sort-of compilable, there's no js dist, right? I'm foreseeing its use for at least 2 projects, I wonder if that can be bundled as a compact dependency.

@erights
Copy link
Contributor

erights commented Oct 9, 2021

That parser should verify that a Justin program is syntactically valid, though we are not currently using that parser or parsing framework in production. Having verified that it is valid Justin syntax, since Justin is a subset of SES, you could then use the SES shim to run it as a SES program. You can use the SES Compartment mechanism to craft the lexical environment that your Justin program sees. I just realized there's one more thing to show you:

https://github.com/Agoric/agoric-sdk/blob/master/packages/marshal/src/marshal-justin.js

tested by

https://github.com/Agoric/agoric-sdk/blob/master/packages/marshal/test/test-marshal-justin.js

This does its round trip tests by evaluating the generated justin program as a SES program in a custom SES environment.

@dckc
Copy link
Contributor

dckc commented Oct 11, 2021

That's perfect!

OK, I take it this issue is addressed.

... there's no js dist, right?

no, we don't have a package for all and only Justin. It would be a welcome contribution!

If you want the scope of this issue expanded to include such a package, feel free to re-open this.

@dckc dckc closed this as completed Oct 11, 2021
@dy
Copy link
Author

dy commented Oct 15, 2021

Just an update. A variation of justin as a separate package here.

@erights
Copy link
Contributor

erights commented Oct 15, 2021

What does and doesn't it have in common with Justin?

@JDvorak
Copy link

JDvorak commented Oct 16, 2021

Just an update. A variation of justin as a separate package here.

Where did it go? This was what I had been looking for for awhile now, as I just need this smaller subset and would prefer a smaller library for it.

@dy
Copy link
Author

dy commented Oct 16, 2021

I can't opensource it for now unfortunately, besides some aspects are not finished , sorry, had to remove it. I can add you to repository developers if you prefer.

@JDvorak
Copy link

JDvorak commented Oct 16, 2021 via email

@dy
Copy link
Author

dy commented Nov 2, 2021

Ok, for these who's interested - there's Justin extension for subscript microlanguage.

@JDvorak
Copy link

JDvorak commented May 18, 2023

I am so appreciative of this specific extension, thank you again.

@dy
Copy link
Author

dy commented Feb 21, 2024

Btw it's called Justin because there's no keyword operators, just in.

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

No branches or pull requests

4 participants