Discussion: Do you know JSON?
Do you know JSON?
Daniel LeuckWed Aug 31 13:15:48 HST 2005
- Previous message: Do you know JSON?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ top page ]
Hi Christophe,
Thank you for this link. I did not run across JSON is my research. It
looks like it has similar design goals and syntax. Interesting stuff.
I think the main differences are:
1. Because Jason constrained to being a subset of Javascript some of the
syntax doesn't look quite as natural. For example:
{"menu": {
"id": "file",
"value": "File:",
"popup": {
"menuitem": [
{"value": "New", "onclick": "CreateNewDoc()"},
{"value": "Open", "onclick": "OpenDoc()"},
{"value": "Close", "onclick": "CloseDoc()"}
]
}
}}
In JSON would probably be written in SDL as:
menu "File" id="file" {
popup {
"New" onclick="CreateNewDoc()"
"Open" onclick="OpenDoc()"
"Close" onclick="CloseDoc()"
}
}
The SDL syntax is simpler and uses less punctuation while still expressing
the same thing. Note that the popup children are anonymous tags which all
take the name "content". Its safe to use SDL identifiers (in this case
attribute keys) for Javascript methods such as the event handlers because
any valid Javascript identifier is a valid SDL identifier.
2. SDL has identifiers used for tag names and attribute keys. These map
naturally to XML tag names and attribute keys.
3. SDL has namespaces
4. SDL has many more literal types which are useful for common scientific
and business applications.
I will review JSON in more detail. It is definitely an interesting
language.
Cheers,
Dan
> -----Original Message-----
> From: Christophe [mailto:christophe.avare at free.fr]
> Sent: Wednesday, August 31, 2005 8:54 AM
> To: sdl-users at ikayzo.org
> Subject: Do you know JSON?
>
> Daniel,
>
> I was reviewing some simple declarative languages and found your project
> interesting.
>
> But, there already exist a "standardized" way to achieve almost what you
> intent to do called JSON (i didn't found it or Javascript in your
> language review):
>
> http://www.crockford.com/JSON/index.html
>
> This syntax and the numerous language already supported are gaining
> populary because it is mainly used by the AJAX developers (if such a
> term means anything) to efficiently transmit structured data between the
> browser and the server.
>
> Do you think sdl have some genuine advantage over JSON?
>
> Regards
> --
> Christophe
- Previous message: Do you know JSON?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ top page ]










