Code-free
Code-free

Swift 2: SIMD

Single Instruction, Multiple Awesome

Russ Bishop
June 24, 2015

Swift 2 brings updated support for SIMD (Single Instruction Multiple Data). What exactly does that mean?

SIMD Primer

Lanes

Each CPU vendor has their own unique snowflake versionÂș but the premise is the same: process data in parallel chunks. Each SIMD instruction operates on a group of values organized into what are called "lanes". . . .

Read More

Swift 2, Beta 2

Quick Recap

Russ Bishop
June 23, 2015

A quick recap for those who haven't parsed the release notes yet:

New Features

  • Enum cases with values can be used as a function; basically the compiler automatically creates a function that accepts parameters matching the case's values and returns that enum case with the values filled in.
  • Non-mutating methods of structs, enums, and . . .

Read More

Swift 2

The overview

Russ Bishop
June 19, 2015

As everyone is no doubt aware Swift 2 was announced at WWDC. I'm going to do a series of posts on the changes but for now let's just cover the major points:

General changes

  • Global and free-standing functions now follow the same parameter label rules as methods. The # external name syntax is gone.
  • Multi-payload enums basically allow . . .

Read More

On Being a Less Horrible Monster

Reabstraction eats the world

Russ Bishop
June 09, 2015

This is an update on a previous post.

First, @jckarter pointed out that swift_func_object is an artifact of the implementation. Swift is reabstracting the function to promote it to the most generic form (it's how a ()->Int can be passed to something expecting ()->Void). It turns out that Swift lifts functions to the maximally . . .

Read More

On Being a Monster

Don't do this. Seriously.

Russ Bishop
June 01, 2015

Edit: There are some important developments, please make sure you check them out.. You shouldn't have tried to use this code before but now it's just completely unnecessary.

Original:

This is horrible and you should never never do this under any circumstances. There are plenty of bear traps in software engineering. You needn't put . . .

Read More

More Swift Attributes

Use this one weird trick

Russ Bishop
May 28, 2015

Swift has a variety of little documented (or undocumented) attributes just sitting there waiting to be used. Let's look at a few of them:

@inline

This attribute gives the compiler inlining hints. The valid values are __always and never. I don't think I'd use this one (especially __always) unless I was absolutely certain I needed . . .

Read More

discoveryd is garbage

Russ Bishop
May 05, 2015

Craig Hockenberry points out that discoveryd is a piece of absolute garbage. Marco chimes in. Many others have been having similar issues.

I just wanted to add my name to the list.

At home, I can almost never successfully make AirDrop work between my iOS devices and Mac, or between my wife's Mac and mine. It is so unreliable that I . . .

Read More

Archive
  Subscribe by Email and Never Miss a Post