5 ms·
At the game studio I work at, they use XML for all scripting tasks: gameplay scripts and UI scripts. As in, XML nodes are "game script commands" which are exec
by palish 16y ago
At the game studio I work at, they use XML for all scripting tasks: gameplay scripts and UI scripts.
As in, XML nodes are "game script commands" which are executed sequentially.
- Udo 16y agoThat's kind of like XSLT, a language with an XML syntax. I can see how that is an appealing use of XML since it basically is a nice representation of a high-level syntax tree. I believe you have come up with a rare example where XML is decidedly better suited than JSON! However, the majority of XML use cases are for document-interchanging applications and the way those are being handled requires massively bloated toolchains of poorly inter-operating software.
- eru 16y agoIf you want a language with a JSON-like syntax, consider using JavaScript. (If you want a language with a uniform syntax, that's easy to parse, choose some form of Scheme or Forth.)
- Udo 16y agoI believe though the point was that I kept wondering what it is specifically that XML does better than JSON, since the article didn't specify. And so it occurred to me that one way to make use of XML's inherent complexity is indeed to represent an instruction tree. But the question here is not what language is best, or even that JSON can used for the same purpose, it was merely the "discovery" of an inherent XML feature that would make reasonable developers prefer it for a certain task. The whole point is moot, however, since XML is actually intended for structured information interchange, regardless of any recent efforts to portray it otherwise, and that's a task which has been thoroughly taken over by JSON in the last few years. > If you want a language with a JSON-like syntax, consider using JavaScript. You're probably right in making this joke though, since JSON is based on JavaScript it certainly owes its popularity mostly to the browser environment.
- simonw 16y ago"it certainly owes its popularity mostly to the browser environment" I don't think that's a given. JSON is useful because it provides a clear, compact syntax for the most commonly useful data structures - lists, dicts, strings, numbers and booleans. That's certainly why I switched to it over XML (and serialised PHP objects).
- vog 16y agoLuckily, embedding more useful languages like Lua, Python or Scheme is becoming more and more common.
- DanHulton 16y agoDear God. Why not just... use a scripting language? I hear LUI is pretty popular as a DSN these days.
- palish 16y ago'Cause I didn't write it, I just work here. :)