Archive for January 13, 2017

Friday, January 13, 2017

Swift 3 Protocols

Brent Simmons:

I first learned protocol-oriented-programming with Objective-C, and I was very pleased to see the Swift team emphasize this style.

But, at least at this writing at the end of 2016, I still run into problems when I use this style of programming in Swift.

Dave Abrahams:

Protocols (a.k.a. concepts) are not just bags of syntax; unless you can attach semantics to the operations, you can’t write useful generic algorithms against them. So we shouldn’t have DefaultConstructible for the same reason we shouldn’t have “Plusable” to represent something that lets you write x + x.

Via Ole Begemann (tweet):

Yet, by conforming a type to Equatable you also guarantee that your implementation follows the protocol’s semantics, which are listed in its documentation.


One problem with a generic init() requirement without additional context is that T() means very different things for different T[…]


The fourth argument against the DefaultConstructible protocol is that it clashes with Swift’s policy to not initialize values to “zero” or some other default. In contrast to many other languages, Swift doesn’t zero out memory for variables — the compiler forces the programmer to initialize every variable with an explicit value.

Joshua Emmons:

I’ve found these two papers particularly enlightening:

Safari Can’t Play New 4K YouTube Videos

Mike Wuerthele (via Rosyna Keller):

The shift appears to have taken place on Dec. 6, according to a Reddit thread delving into the issue. Google has been pushing the open and royalty-free VP9 codec as an alternative to the paid H.265 spec since 2014, but has never said that it would stop offering 4K video on the YouTube site in other formats, like the Apple-preferred H.264.

Videos uploaded to the service prior to Dec. 6 in 4K resolution can still play back in full 4K resolution on Safari from the YouTube homepage. Additionally, Mac users utilizing Chrome still have the ability to play back new videos in 4K, as Safari is the only holdout among the major browsers that doesn’t support the codec.

Update (2017-01-23): Rob Griffiths:

Google seems to now be using the open and royalty-free VP9 codec for 4K videos viewed on its YouTube site, but reverts to the H264 codec when those same videos are embedded on other sites.


I installed a bunch of browsers (some of which I’d never heard of before), and tested each to see which supported VP9 and which did not.


David Smith (tweet):

This situation gave me the idea for a little side project, PodSearch, empowering the same quick podcast recall for anyone. The concept was simple. Take a few of my favorite podcasts and run them through automated speech-to-text and make the result searchable.


I found that even though this an awful transcription, it is actually pretty good for keyword searching. Is Shutting Down

Dalton Caldwell (Hacker News, Slashdot):

Ultimately, we failed to overcome the chicken-and-egg issue between application developers and user adoption of those applications. We envisioned a pool of differentiated, fast-growing third-party applications would sustain the numbers needed to make the business work. Our initial developer adoption exceeded expectations, but that initial excitement didn’t ultimately translate into a big enough pool of customers for those developers.

Clark Goble:

Big benefit of ADN was having enough characters to comments on links and requotes. Hard in Twitter. Tone often comes off wrong.

Riccardo Mori:

But after a few weeks something clicked. I was loving the place. I thought the first interactions and mutual follows would involve people I knew (and knew me) from Twitter; instead I was welcomed by others I didn’t know from anywhere. A sense of ‘community in the making’ was quite palpable.

And things only got better from there. I’m speaking about my experience, of course. ADN felt like the early days of Twitter, possibly even better. A basic feature like having 256 characters available in a post, instead of Twitter’s 140, turned out to make a huge difference. Conversations lasted longer, got deeper, and with longer posts, people could explain themselves in a much better way than the average quipping in Twitter’s exchanges. Private messages, too, could be longer (2048 characters). The whole atmosphere was different than Twitter’s.

The closest alternative is probably Gab, although that does not seem to have native apps nor any traction in Mac/iOS tech circles.

More interesting are the decentralized alternatives, which include Manton Reece’s new

Today, most writing instead goes into a small number of centralized social networking sites, where you can’t move your content, advertisements and fake news are everywhere, and if one of these sites fails, your content disappears from the internet. Too many sites have gone away and taken our posts and photos with them.

I want to encourage more independent writing. To do that, we need better tools that embrace microblogs and the advantages of the open web. We need to learn from the success and user experience of social networking, but applied to the full scope of the web.

I first set out to build a new service just for microblogs. It has a timeline experience like a social network, with replies and favorites, but it’s based on RSS, with the main posts pulled from independent sites.

I’ve backed his Kickstarter.

Previously: State of the Union.

Update (2017-01-13): Nick Heer:

The biggest difference between and is that the latter can be self-hosted, and is entirely decentralized. If Reece were to stop development of in ten years, existing installations would continue to work as long as the programming languages that power it remain compatible.

Update (2017-01-23): cgiffard:

“We are starting an archival project for and would love your input and assistance.” — Archive Team

Update (2017-01-25): Jonathan LaCour:

Manton, too, believes that the future of the open web is bright, and is throwing his own efforts behind the launch of a new, open platform for microblogging—like Twitter, but distributed, and owned by its users. We’d like to make it as easy as possible to launch a WordPress-powered microblog on DreamHost that integrates well with Manton’s upcoming service. In order to support that mission, DreamHost is kicking in a $5,000 pledge to the Kickstarter.


If we succeed in our mission and vision, along with Manton, you’ll no longer just be a username belonging to a faceless organization. You’ll be able to build your digital presence as the open web intended: with your own domain, the freedom to move from one provider to another, and the assurance that your data belongs to you, and no one else.