Hacker News new | ask | show | jobs
by klibertp 2724 days ago
I didn't read the article, but intuitively, from the quote you posted, I'd say it's about having JSON(or close to)-literals in the language and/or having Map/List types with semantics close to that of JS. For example, in Python dict and list literals are perfectly valid JSON if you remember not to use single quotes (' vs. "), and the semantics are also pretty close to JS. In Elixir this is not the case: the Map syntax could pass for JSON if you squint hard enough:

    %{key: "val", key2: [1, 2, 3]}
but the semantics here are actually something like this in JS:

    {Symbol("key"): new Int8Array(/*utf-8 encoded*/ "val"), Symbol("key2"): new LinkedList([1, 2, 3])}
you can get rid of the `Symbol()` part in the translation, but then the literal becomes:

    %{"key" => "val", ...}
so, basically, the gap between JSON and Elixir is wider, both syntactically and semantically, than it is in some other popular languages.