Live data from Hacker News

Apple TV Markup Language

developer.apple.com

51–60 of 74 posts

Re: Apple TV Markup Language

#52
post #18

I believe this XML+JS thing was the only way to write apps for the old Apple TV. Various postings on the internet seem to suggest this from way back; the old SDK was probably only ever available to a select few handpicked appletv channel partners. What's new in the new tvOS SDK is that you can also write native apps in Objective-C/Swift, with a main() function that starts up UIKit, and with access to most of the norm…

Correct. You could actually modify the HTTP proxy settings and trusted certificates on the device and run your own applications using a man in the middle attack. Plex had a version that supported this:

https://github.com/iBaa/PlexConnect

Re: Apple TV Markup Language

#53
post #2

So it's just HTML? Is there a reason (legal or otherwise) that they can't just use HTML?

I think the heavy reliance on these templates is a good clue. Apple TV's interaction model is a lot about swiping around from tappable element to tappable element. Arbitrary layouts will make this a miserable experience. Apple probably wants to establish a number of layout patterns that they believe will yield a good experience.

Re: Apple TV Markup Language

#54

Curious on why they chose an XML-like syntax rather than something like JSON

XML is a markup language that can describe formatted document structure well, json is best suited for things like data. For instance, this would be pretty painful to describe in json: Hello, dave Conversely, this is pretty painful to describe in XML: name dave

Good point, forgot about the display portion of this application

Re: Apple TV Markup Language

#55
post #18

I believe this XML+JS thing was the only way to write apps for the old Apple TV. Various postings on the internet seem to suggest this from way back; the old SDK was probably only ever available to a select few handpicked appletv channel partners. What's new in the new tvOS SDK is that you can also write native apps in Objective-C/Swift, with a main() function that starts up UIKit, and with access to most of the norm…

Correct. You could actually modify the HTTP proxy settings and trusted certificates on the device and run your own applications using a man in the middle attack. Plex had a version that supported this: https://github.com/iBaa/PlexConnect

For anyone wondering about this, I've been using it for a while and it works great - the Trailers app now loads the Plex UI for me. I've barely had to touch it since the initial setup.

Re: Apple TV Markup Language

#56
post #2

So it's just HTML? Is there a reason (legal or otherwise) that they can't just use HTML?

Would you really want full blown hypertext markup styled with css on your apple tv?

Just imagine all of the garish designs that would pop up.

It's better to restrict what is allowed in a custom markup language so that apple has better control over how it is rendered.

Re: Apple TV Markup Language

#58
post #3

Earlier quoted context omitted.

It's not like HTML except for being XML which looks a lot like SGML. It's significantly more limited and more specific to the task than HTML. HTML comes with a lot of baggage that makes it unsuitable for a really specific use case.

It's not like HTML except for being XML which looks a lot like SGML. XML does not only look a lot like SGML, it is a proper subset of SGML: XML is an application profile or restricted form of SGML, the Standard Generalized Markup Language [ISO 8879]. By construction, XML documents are conforming SGML documents. http://www.w3.org/TR/xml11/

Interesting, I didn't realize they claimed XML was an SGML subset. I thought you couldn't express XML empty tags in an SGML DTD.

Re: Apple TV Markup Language

#59
post #20

If any of the authors are reading, you really ought to consider putting this into an XML namespace. It can just be a mysterious invocation to most users today, but if you need to extend this in the future (inline SVG? inline XHTML?), it'll save your bacon to have done it in the first version.

Why would anyone add complexity to the syntax when you can make it simpler by removing the XML namespace? If you need to add namespaces, then you have already failed.

At this point in development, it would manifest by adding the attribute

    xmlns="http://apple.com/TVML/1.0"
(or similar) to the top-level tag.

And absolutely nothing else has to change.

For that matter, even ignoring the issues of being able to embed foreign content later, just sheer versioning is a good enough reason to add that. And once you agree versioning is a good idea, why not do it via namespace? It's not like

    version="1.0"
is materially different or shorter.

If you're expressing a certain crabbiness about this being in XML in the first place, you'd have to take that up with Apple. But once you're using XML, you ought to take advantage of what comes with it.

Re: Apple TV Markup Language

#60
post #45

Earlier quoted context omitted.

Implementing this with WebKit would be massive overkill; I'd say it's quite unlikely it's implemented with it.

If you implemented a web-like runtime from the ground up, you're saying you would write it from scratch? The runtime has JavaScript support, it does not have a brand new interpreter. The runtime has CSS support, it does not have a brand new interpreter. The runtime has HTML/XML syntax. Why would they write a brand new interpreter?

Because the XML syntax maps directly onto UI components; introducing an HTML canvas is vastly more complicated than that.

Mappping XML to a small subset of UI objects is so simple you don't really need to pull in an entire browser runtime for it.

Post reply on HN