Has any programming language defined a data-definition subset which is truly lossless and truly a subset? Something like JSON is to Java, but with rigor. The forward compatibility problem is more subtle than it seems, e.g. as Eric Lippert describes:https://ericlippert.com/2009/05/11/reserved-and-contextual-keywords/ …
-
-
-
Replying to @pervognsen @TimSweeneyEpic
Which is what you get back from (read). But it's not clear to me what exactly you mean by lossless here.
2 replies 0 retweets 0 likes -
Replying to @pervognsen @TimSweeneyEpic
Do you mean that every native data type should be losslessly expressible in the data definition subset? What about cyclic structures?
3 replies 0 retweets 0 likes -
Replying to @pervognsen
Yes to all! If the value exists, it should be able to persist as text, and be reloaded while preserving (the language-appropriate kind of) equality. Including finitary value-cyclic structures, and mutable pointer-cyclic structures e.g. in an entity-component system.
1 reply 0 retweets 1 like -
Replying to @TimSweeneyEpic
That's where the existing languages I know of fall short. They might support a binary format with that guarantee, but not a literal syntax. Common Lisp comes closest with its
#n= and #n# reader syntax but it has the aforementioned limitations, but it'd be easy to support.1 reply 0 retweets 0 likes -
Replying to @pervognsen @TimSweeneyEpic
You could do away with scoping (a bad idea) or separate the introduction of a scoped name from the binding of a datum to that name. Ugly syntax mimicking Common Lisp, but as an example:
#foo{ {'a': {'b':#foo=['c']}, 'd': #foo#} #}1 reply 0 retweets 1 like -
Replying to @pervognsen @TimSweeneyEpic
You could have forward references as long as the name has been introduced at that point, and the rule is that all names must have been bound by the time the scope is exited at the corresponding #}
1 reply 0 retweets 0 likes -
Replying to @pervognsen @TimSweeneyEpic
The forward references mean that you need to support backpatching/fix-ups, but I don't see a way around that if you want to support the general case.
1 reply 0 retweets 2 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.