Pragmatism in today's world

Wrapping variadic functions for use in Swift

As I noted in my post about getting libcurl working with Swift, curl_easy_setopt() is a variadic function which means that Swift will not import it. If you try to use it you get this error: error: 'curl_easy_setopt' is unavailable: Variadic function is unavailable curl_easy_setopt(handle, CURLOPT_VERBOSE, true) ^~~~~~~~~~~~~~~~ CCurl.curl_easy_setopt:2:13: note: 'curl_easy_setopt' has been explicitly marked unavailable here public func curl_easy_setopt(curl: UnsafeMutablePointer, _ option: CURLoption, _ varargs: Any…) -> CURLcode ^ It's mildly annoying as curl_easy_setopt only… continue reading.

Using a C-library in Swift

I'm still enjoying playing with Swift and am beginning to quite like the language. At the moment, I've only ever written with it on Linux, so I'm sure I'm making my life harder than if I was using OS X where it's more mature. On the flip side, if I ever use Swift professionally, it's most likely going to be on a Linux server as a microservice or a command line app at the other… continue reading.

Swift around the web

To get started with messing around with Swift, IBM have created a Swift Sandbox on the web, so you can run Swift on Linux within a browser to play with it. Interesting stuff as it appears that IBM are interested in Swift on server. Also interesting is the Perfect application server for creating server side API applications. I've also found these resources helpful: The Swift Programming Language book (epub) Erica Sadun' Twitter & blog Jesse… continue reading.

An Ansible playbook for Swift

I've been learning Swift recently and now that it's Open Source, I'm looking at using it on my Linux server. Firstly however, I wanted to run it within a Vagrant box locally and as I provision all my boxes via Ansible, I created a simple playbook and am recording it here in case its useful to anyone else! The installation instructions are easy to follow, so I simply replicated them as a set of actions.… continue reading.