Archive for December 12, 2016

Monday, December 12, 2016

The Opportunity of Swift on the Server

Stephan Knitelius (via Chris Lattner):

Java and other languages that compile to Java byte code run on the JVM. In a world of Docker containers the JVM is just yet another layer eating up resources. The claim “write once run any where” is just as true for a Swift applications packaged into a Docker container as for a Java Application running on top of a JVM.

Running an application in JVM, that is running in a Docker container, that is running on a virtual host seems rather ludicrous. Swift compiling to native machine code, has the advantage of a rather small memory footprint. When running hundreds or thousands of instances, as many tech companies do, even saving a couple of MB on memory footprint generates real business incentive.


Also garbage collection comes at a high cost. Employing concurrent mark and sweep algorithms, it still requires more memory and CPU cycles then immediately assigning and releasing memory as needed.

Sourcery: Template-Based Code Generation for Swift

Krzysztof Zabłocki (tweet):

Swift is a beautiful language that powers a lot of great iOS apps. Unfortunately it features very limited runtime and no meta-programming features. This has led our projects to contain a lot of duplicated code patterns, they can be considered the same code, just with minimal variations.


Insanity is a tool that scans your source code, applies your personal templates and generates Swift code for you, allowing you to use meta-programming techniques to save time and decrease potential mistakes.

Soroush Khanlou:

Codegen is gonna become a crucial part of Swift development in not very long.

Update (2016-12-12): Martin Pilkington:

I can’t help but feel that code generation is a code smell. Shows a language/API weakness.

Update (2016-12-13): Krzysztof Zabłocki:

Insanity has been renamed to Sourcery, and we just released 0.3.0 version, old links / remotes should work fine.

Mac Users Switching to Surface

Brian Hall (9to5Mac, MacRumors, Hacker News):

Our team gets so excited about meeting new Surface users and hearing their feedback, and we get to meet a lot more this holiday season! From Surface Pro, to Surface Book, to Surface Studio, to Surface Hub, we’re having our best holiday ever.


More people are switching from Macs to Surface than ever before. Our trade-in program for MacBooks was our best ever, and the combination of excitement for the innovation of Surface coupled with the disappointment of the new MacBook Pro – especially among professionals – is leading more and more people to make the switch to Surface, like this. It seems like a new review recommending Surface over MacBook comes out daily.


I’m one of the people that switched from a MacBook Pro to the new Surface Book.

The entire experience was dreadful for me.


As far as the actual product goes - I found the trackpad to be lacking. It just felt a bit buggy and non-responsive at times. I have yet to find a trackpad as solid as the ones that Apple ship. This became more apparent of time after using the product. Aside from the trackpad I don’t have too many complaints, except for things that are of personal preference (I can’t say I like the design / functionality of the snake hinge). I also realized, as mainly a pro user, that I don’t have much use / need for the touch screen or tablet portion of the device.

Which Macs Are People Using?

I’ve been thinking about the Mac lineup lately. When will Apple updates its desktop computers? And, when it does, should I switch back to using a desktop as my primary computer? There’s been a lot of talk lately about how notebooks have really taken over and how Apple doesn’t update the Mac mini and Mac Pro very often because they don’t sell well. This may be true (and also partly a self-fulfilling prophecy). However, I can say that people definitely do use them. Here are some recent statistics from my customers:

40%MacBook Pro
10%Mac Pro
8%MacBook Air
6%Mac mini

Of course, these numbers are not representative of the Mac market as a whole. My customers are probably slightly more technical than Mac users in general, though not as much as you would think. All I know for sure is that they represent people who pay for software and have great taste.

Starting at the top, I think most people would have expected the MacBook Pro and iMac to dominate. You might not expect to see 10% using Mac Pros, when the Mac Pro hasn’t been updated since 2013. The number for the Mac mini is probably better than you would expect, too, considering that it’s rarely talked about and surely many of them are used as servers. There’s actually a 50:50 split between notebooks and desktops. Apple has got to be selling more notebooks now, but desktops probably stay in use longer.

The numbers for the MacBook seem really low to me. The 2% (1.68% before rounding) includes both the MacBook One and the plastic MacBook that was discontinued in early 2012. The 12-inch MacBook never seemed attractive to me—overpriced and underpowered, not to mention the keyboard—but I would have expected to see more people using it. There are already 1.49% using the new MacBook Pros with Touch Bar, despite shipping delays. It’s frustrating that Apple sees the MacBook One as a worthwhile niche but doesn’t want to make a high-end MacBook Pro with a larger display, more RAM, a real keyboard and trackpad, etc.

A few more notes:

Update (2016-12-12): Seth Willits:

My customers: Prosumer app very close to yours, though MBA and MP are switched. Pro app: 70% MBP, iMac 15%. Same order below.