News for hackers. Stuff that matters.
Re:JSON vs. XML with Douglas Crockford by adamgordonbell on Thursday April 06, 2023 @09:58AM (#35468386)
Scala had XML literals as part of the language!

Apparently Philip Wadler was the person who told them needed it, because the future was XML.

( Walder is big Haskell/PL person)

Re:JSON vs. XML with Douglas Crockford by bryik on Thursday April 06, 2023 @10:38AM (#35468884)
That's surprising! Wasn't it Philip Wadler who said "The essence of XML is this: the problem it solves is not hard, and it does not solve the problem well."

http://harmful.cat-v.org/software/xml/

Re:JSON vs. XML with Douglas Crockford by tuukkah on Thursday April 06, 2023 @10:06AM (#35468475)
Was it far from JSX?
Re:JSON vs. XML with Douglas Crockford by chimeracoder on Thursday April 06, 2023 @05:53PM (#35475051)
It was almost literally JSX (except with Scala syntax instead of Javascript, of course).

An XML literal in Scala would have been:

  // XML literals (to be dropped)
  val mails1 = for (from, to, heading, body) <- todoList yield
    <message>
      <from>{from}</from><to>{to}</to>
      <heading>{heading}</heading><body>{body}</body>
    </message>
  println(mails1)
This was replaced with "XML string interpolation", which

  // XML string interpolation
  val mails2 = for (from, to, heading, body) <- todoList yield xml"""
    <message>
      <from>${from}</from><to>${to}</to>
      <heading>${heading}</heading><body>${body}</body>
    </message>"""
  println(mails2)
Re:JSON vs. XML with Douglas Crockford by orthoxerox on Thursday April 06, 2023 @11:38AM (#35469869)
VB.NET still has them. I remember doing a project with an XML database (ugh) back in college when the version with the literals was released. I was ecstatic.
Re:JSON vs. XML with Douglas Crockford by tracker1 on Thursday April 06, 2023 @01:32PM (#35471651)
ActionScript 3 as well as the E4X support in Mozilla's Browser+JS/XUL engine for a while (removed now afaik).

Around that time it was pretty nice passing around XML, as I was forced to work with VB.Net which also had an XML literal syntax on the backend and Flash/AS3 on the UI.

I had built a POC with E4X that was VERY similar to React/Redux over a decade before React, but the other browser vendors didn't have it... At the time IE and Chrome were shifting towards JSON.

Re:JSON vs. XML with Douglas Crockford by taeric on Thursday April 06, 2023 @01:53PM (#35471898)
The irony, to me, is how it is viewed as a bit of a mistake that they had XML in Scala. Hard to square that with how instrumental JSX was in getting some of the modern JavaScript frameworks as far as it has.
Re:JSON vs. XML with Douglas Crockford by hajile on Thursday April 06, 2023 @05:06PM (#35474448)
If the web spec had a JSON analog for HTML, I think you'd see a lot less love for JSX.
Re:JSON vs. XML with Douglas Crockford by taeric on Thursday April 06, 2023 @05:19PM (#35474631)
Maybe? Though, I suspect JSX just got lucky with when it got popular. There were plenty of mixed HTML/Script things in the past. Most of them met a lot of resistance.