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

DJS #249

Open
4 of 13 tasks
sergey-shandar opened this issue Aug 19, 2023 · 0 comments
Open
4 of 13 tasks

DJS #249

sergey-shandar opened this issue Aug 19, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@sergey-shandar
Copy link
Contributor

sergey-shandar commented Aug 19, 2023

  • rename fjson to djs (data javascript), File extensions: .d.cjs, .d.mjs, .d.js.
  • use JS tokenizer
  • identifiers {a:5}
  • big int
  • module.exports = ...
  • constants const a = [3];module.exports = { a: a, b: a }.
    • Deserialization. Make sure we build the correct DAG. Test: const obj = deserialize('...'); if (obj.a !== obj.b) { throw "" }
    • Serialization. const _0=[3];module.exports={a:_0,b:_0}
  • import const a = require('c.d.cjs');module.exports = { a: a, b: a}. Deserialization only.
  • ES6 import import a from 'c.d.mjs';export default { a: a, b: a}.
  • short form const a = 5;module.exports = { a }

Optional, for fun, syntax sugar:

  • comments. Ignore them. Not an error.
  • double/single quote strings
@sergey-shandar sergey-shandar added the enhancement New feature or request label Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants