5 ms·
I love how a library just adds in a JSON literal syntax to the language and it's not even worth noting.
by fmakunbound 5y ago
I love how a library just adds in a JSON literal syntax to the language and it's not even worth noting.
- bmitc 5y agoThis is done all the time in Elixir without fanfare, and you don’t even need to use a DSL. One just uses maps and lists that basically map one-to-one to JSON.
- fmakunbound 5y agoI have not looked at Elixir. It is possible for the user to extend its syntax?
- nesarkvechnep 5y agoYes.
- bmitc 5y agoYes, Elixir has macros.
- reikonomusha 5y agoThen you're not really adding syntax, just re-using existing syntax.
- bmitc 5y agoThat was my point, that you can have “literal” JSON in the language without special syntax, which is preferred since it can be processed with all the built in language functionality. By the way, Elixir does have macros.
- reikonomusha 5y agoUnderstood, but the fanfare is coming from the fact one can take a language without JSON, or SQL, or infix notation, or ..., and add it as a library. It means the language itself is flexible enough to support future paradigms and standards at the code level without a language redesign. I agree it's nice when something as common today as JSON is built in to a language. But for something like Common Lisp, whose roots are now nearly 40 years old, the fact it can easily support JSON literals is nothing short of amazing.
- deleted 5y ago[deleted]