Archive for March 7, 2018

Wednesday, March 7, 2018

Apple to Discontinue iTunes LP

Zac Hall:

Apple appears to be finally pulling the plug on its iTunes LP format this year. For music sold in the iTunes Store, iTunes LP has served as a useful but not popular digital solution for including a rich multimedia experience with digital music.

Like physical records and CDs, iTunes LP content can include lyrics, photos, and liner notes as well as access to video — but the format has never been optimized for iPhone and iPad. The special iTunes format has been around for almost ten years but only around 400 albums have used it.

I’m not quite sure whether iTunes LP was a bad idea or simply one that neither Apple (aside from Steve Jobs?) nor the music producers actually had much interest in. How else to explain that Apple never brought it to iPad?

Nick Heer:

But, these days, those extras don’t require a specific packaged format. Videos are streamed for the one or two times most people watch them, and lyrics are just a scroll away for many Apple Music tracks. The world moved beyond iTunes LP. And the remaining things it offered — like exquisite artwork on gorgeous poet, and that sense of a packaged product — simply can’t be replicated effectively on a screen.

Previously: Eliminating iTunes Store Music Downloads, No iTunes Extras on Apple TV or iOS.

Update (2018-03-08): Ruffin Bailey:

I think this signals less “whether iTunes LP was a bad idea” (though the skeuomorphism Jobs loved is slowly dying our from the ’OSes) than “someone’s paying attention to scaling down iTunes”. I think they’re slowly moving towards killing music sales, no matter what Sellers at AWT thinks. ;^D


Cesium’s author points out that playing music on your own phone is increasingly difficult via Apple Music in iOS 11.

Deckset Leaves the Mac App Store

Unsigned Integer (via Ilja A. Iwas, 9to5Mac):

The main reason for us to leave the App Store is greater flexibility in pricing. For example, we are now able to offer a 50% discount to students, teachers and other members of educational institutions. That is something we simply couldn’t do before, and we feel it’s essential to reflect the realities of how and why people use Deckset.

There also is a 20% discount for teams buying either 5 or 10 copies of Deckset in bulk.


Since Deckset will now live independently of the Mac App Store (and hence, its tedious submission and review process) we will also be able to release updates much more frequently.

Brett Terpstra:

I first wrote about Deckset back in 2014. Since then I’ve continued to love it as an alternative to Keynote, using it whenever I can for presentations.

Getting the Current NSBundle

Nicolas Bouilleaud:

  1. Use backtrace() to find the function pointer of the caller;
  2. Use dladdr() to find the executable image path containing this function;
  3. Find the loaded bundle with this executable path.


With this, I can finally write Bundle.current everywhere, instead of Bundle.main or Bundle(for: AnyClass).

Update (2018-03-12): Leo Natan:

Very cool, but this is an error prone approach due to inlining and optimizations.

For performance, __builtin_frame_address()/__builtin_return_address() either directly in Swift if possible or in a C shim function would work quite well. Same risks as original approach.

A Lot Can Happen in a Decade

Craig Hockenberry:

It’s the ten year anniversary of the original iPhone SDK.


Discoveries happened quickly. It took just a matter of weeks before the filesystem was exposed. A couple of months later, the entire native app experience was unlocked. Development toolchains were available and folks were writing installers for native apps.


There were a lot of surprises in that early version of UIKit. It took forever to find the XML parser because it was buried in the OfficeImport framework. And some important stuff was completely missing: there was no way to return a floating point value with Objective-C.

There were also strange engineering decisions. You could put arbitrary HTML into a text view, which worked fine with simple tags like <b>, but crashed with more complex ones. Views also used LKLayer for compositing, which was kinda like the new Core Animation in Mac OS Leopard, but not the same.

Craig Hockenberry:

Still, it’s easy to see why today’s apps are much more sophisticated. They run code hundreds of times faster.

They also have screens that are a bit larger than 320 × 480 :-)

Guilherme Rambo:

I decided to compare SpringBoard from iPhoneOS 1 to SpringBoard on iOS 11.3 (b4). Binary size back then: 691KB. Now: 11,5MB. Classes back then: 145. Classes now: 1418. The only thing I could find that’s not changed are two instance variables on the SpringBoard class.

Constructing Human-grade Parsers

Joe Groff (tweet):

Parsing is one of the most thoroughly explored topics in computer science, but building parsers that give high-quality diagnostics and user feedback is still largely folk art. Here are some observations on how parsers can be constructed in a way that makes it easier to recover from parse errors, produce multiple diagnostics in one pass, and provide partial results for further analysis even in the face of errors, providing a better experience for user-driven command line tools and interactive environments.


Thinking about it a different way, we want parsing to always succeed at producing some kind of structured result. The result can contain error nodes inside it, but the error nodes don’t have to replace the entire result. How do we make a parser that always succeeds, and how exactly do we recover when we find a parse error? We can look at both problems from the perspective of designing the grammar. Effectively, we want to take a grammar and extend it to make it total, so that every string matches a rule, by adding rules for erroneous inputs.


If you’re designing a grammar from scratch, it’s also good to think about how your grammar can be parsed in a recoverable way, by considering what kinds of errors or incomplete edits users may make, and what kinds of synchronization points you can design into the grammar so that a parser can recover from malformed input.

Joe Groff:

Yeah, even though whitespace isn’t formally significant most people well-indent their code in practice. I think recent GCC uses indentation as a hint to match up imbalanced { } pairs; Clang and Swift should do the same

Andy Gocke:

My first rule: don’t use a generated parser. The effort in making a hand-written recursive descent parser will pay itself off many times over in maintenance.

Parser combinators are awesome for getting something working, but tend to produce a lot of allocations. For a production compiler, I think the amortized cost of rolling your own is so low I wouldn’t look for a library to help.