Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This likely stems from the proposers building on existing "in-the-wild" development patterns: it's become a convention for DSLs in the JS development community.

Consider similar for a larger amount of data:

  <script type="custom-dsl">{ "very": { "large": "json", "object": "with", "many": "keys" }</script>
Even sticking strictly to JSON (the DSL can be any syntax), this has a few advantages to SGML-style attributes:

1. Supports nesting to any depth

2. Easier to deserialize from an in-memory object in the most common server-side languages

3. Supports easy developer/hacker copypasta into a JS file for debugging.

4. Broader/better expand/collapse support in text editors (in the case of very large lists)

---

> I'd have to look up every time I wanted to use it

I'd likely have to look up the HTML attribute names just as much - I recall having to do this a lot at first with the viewport meta when it was introduced - the only real hurdle to get over with this is to internalise the following pattern (which, as mentioned, some in the JS community are already familiar with):

  <script type="dsl-name">DSL SOURCE</script>


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: