{"id":14711,"date":"2016-05-02T13:00:16","date_gmt":"2016-05-02T11:00:16","guid":{"rendered":"https:\/\/blog.trifork.com\/?p=14711"},"modified":"2016-05-02T13:00:16","modified_gmt":"2016-05-02T11:00:16","slug":"server-side-applications-in-apples-swift","status":"publish","type":"post","link":"https:\/\/trifork.nl\/blog\/server-side-applications-in-apples-swift\/","title":{"rendered":"Server side applications in Apple\u2019s Swift"},"content":{"rendered":"<p>In 2014, Apple announced the release of Swift, a new programming language for all their platforms. Their programming language of choice on iOS and OSX has always been Objective-c, a language which is\u00a0a bit dated (it predates C++) and as it has had new features (and syntaxes) bolted onto it every few years, it carries quite a bit of baggage. It seems I wasn\u2019t the only one with this opinion, as the release of swift was greeted with great enthusiasm, and has been adopted very rapidly.<\/p>\n<p>Swift combines all the features that are fashionable in a general purpose language today, without the feeling that they were bolted on after the fact. While building an iOS client for our customer <a href=\"http:\/\/www.gerimedica.nl\/\">Gerimedica<\/a> in swift, I found myself wishing I could use this language on the server side as well as in the client. At WWDC 2015, Apple announced the intention to open source the language, and release a Linux version, so it looked like it could become a reality. Since december 2015, the sources have been available on <a href=\"https:\/\/github.com\/apple\/swift\">github<\/a>, and builds for <a href=\"https:\/\/swift.org\/download\">OSX and Ubuntu<\/a> are made available roughly twice per month.<\/p>\n<p><strong>PerfectLib<\/strong><\/p>\n<p>A number of groups and companies saw an opportunity to be among the first with something that was obviously going to be big. One of the first was <a href=\"http:\/\/perfect.org\/about.html\">PerfectSoft<\/a>, a startup that aims to be the one big framework for all your server side development in swift. They started building their framework as soon as the open source release of swift was announced, and have been advertising their product everywhere. Because they started development before anyone outside Cupertino had a good idea what the release would look like, it only worked on OSX at first, and it didn\u2019t use the <a href=\"https:\/\/swift.org\/package-manager\/\">Swift Package Manager<\/a>, the intended default build and dependency management tool for swift. At the time, the framework compiled to one big binary, that you had to include in your build manually. They have a beautiful website and good documentation, but it just wasn\u2019t working when I tried it. I intend to try this framework out again at a later date.<\/p>\n<p><strong>IBM<\/strong><\/p>\n<p>The biggest player (other than Apple) to openly jump on the swift bandwagon is IBM. As soon as the open source release of Swift was announced, IBM announced the <a href=\"https:\/\/swiftlang.ng.bluemix.net\/#\/repl\/\">Swift Sandbox<\/a>, their Swift based version of google\u2019s <a href=\"https:\/\/play.golang.org\/\">golang playground<\/a>. It is a web based repl that can be shared online by sharing a URL. Cool, but not extremely useful, as unlike go, swift already comes with a repl. The real significance of this is not the swift sandbox itself, but the message that IBM is interested in this technology and intends to be involved. IBM isn\u2019t the kind of company to back technologies just because they like them, so they either see an opportunity, or a potential strategic interest. At the moment, IBM\u2019s swift related activities seem to be associated with their PaaS solution <a href=\"http:\/\/www.ibm.com\/cloud-computing\/bluemix\/swift\/\">BlueMix<\/a>, so they are likely working on the Swift \/ IBM version of google\u2019s <a href=\"https:\/\/cloud.google.com\/appengine\/docs\/go\/\">app engine<\/a> for go. IBM offers its own web framework for swift: <a href=\"https:\/\/github.com\/ibm-swift\/kitura\">kitura<\/a>. Kitura turns out to be less than trivial to install and for now somewhat bare bones, but as this is IBM, it is worth dedicating another blog post to it at a later date. Also check out <a href=\"https:\/\/swiftpkgs.ng.bluemix.net\/\">their overview<\/a> of the most popular, most active and most essential open source projects on github for swift.<\/p>\n<p><!--more--><\/p>\n<p><strong>Google<\/strong><\/p>\n<p>There have been <a href=\"http:\/\/www.macrumors.com\/2016\/04\/07\/google-possibly-adopting-swift-for-android\/\">rumors<\/a> all over the internet that google would be considering making swift a first class language for android. As far as I can tell, all of these rumors can be traced down to one article on <a href=\"http:\/\/thenextweb.com\/dd\/2016\/04\/07\/google-facebook-uber-swift\/\">thenextweb.com<\/a>, which states that \u2018sources have told&#8230;\u2019 For now, there is no indication that these rumors are anything more than rumors. It\u2019s not clear what would be in it for google, now that their own mobile platform has become so successful. It is already possible to run <a href=\"http:\/\/romain.goyet.com\/articles\/running_swift_code_on_android\/\">swift code on android<\/a>, but there is a very long way to go from there to writing an entire android app in swift.<\/p>\n<p><strong>Zewo<\/strong><\/p>\n<p>The next framework I tried was <a href=\"http:\/\/www.zewo.io\/\">Zewo<\/a>, a project started by Paulo Faria. I immediately liked the architecture: a package based approach, tied together with the Swift Package Manager. You could pick and choose the elements you wanted and simply include the dependency in the Package.swift file, and leave out the parts you don\u2019t need. Let\u2019s build a minimal server side application with Zewo. Installing zewo on Linux turns out to be <a href=\"http:\/\/docs.zewo.io\/index.html\">very easy<\/a>.<\/p>\n<p>Download and install swift from <a href=\"https:\/\/swift.org\/download\/#snapshots\">swift.org<\/a>. Note that these examples use the <a href=\"https:\/\/swift.org\/builds\/development\/ubuntu1510\/swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a\/swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a-ubuntu15.10.tar.gz\">DEVELOPMENT-SNAPSHOT-2016-02-08-a snapshot<\/a>. This is relevant, because at this time, swift 3 is a moving target. It is undergoing rapid development, and every new snapshot released is likely to break your builds, with or without a deprecation warning. Kyle Fuller made <a href=\"https:\/\/github.com\/kylef\/swiftenv\">swiftenv<\/a>, an elegant tool for managing installations of multiple different builds of swift. I recommend using this tool to install and manage development snapshots of swift:<\/p>\n<pre class=\"brush:bash;\">swiftenv install DEVELOPMENT-SNAPSHOT-2016-02-08-a\nln -s ~\/.swiftenv\/shims\/* \/usr\/local\/bin\/<\/pre>\n<p>Make sure <a href=\"https:\/\/en.wikipedia.org\/wiki\/Clang\">clang<\/a> and <a href=\"https:\/\/en.wikipedia.org\/wiki\/International_Components_for_Unicode\">libicu-dev<\/a> are installed.<\/p>\n<pre class=\"brush:bash;\">sudo apt-get install clang libicu-dev<\/pre>\n<p>Install Zewo:<\/p>\n<pre class=\"brush:bash;\">echo \"deb [trusted=yes] http:\/\/apt.zewo.io\/deb .\/\" | sudo tee --append \/etc\/apt\/sources.list\nsudo apt-get update\nsudo apt-get install zewo<\/pre>\n<p>Make a directory for your project, and in that directory type:<\/p>\n<pre class=\"brush:bash\">swift build --init<\/pre>\n<p>This will create the basic structure for a swift application managed by SPM. Paste the following code into Sources\/main.swift:<\/p>\n<pre class=\"brush:java\">import HTTPServer\nimport Router\n\nlet router = Router { route in\n   route.get(\"\/hello\") { _ in\n       return Response(body: \"hello world\")\n   }\n}\n\ntry Server(responder: router).start()\n<\/pre>\n<p>Paste the following code into Package.swift:<\/p>\n<pre class=\"brush:java\">import PackageDescription\n\nlet package = Package(\n   name: \"HelloWorld\",\n   dependencies: [\n       .Package(url: \"https:\/\/github.com\/VeniceX\/HTTPServer.git\", majorVersion: 0, minor: 3),\n       .Package(url: \"https:\/\/github.com\/Zewo\/Router.git\", majorVersion: 0, minor: 3),\n   ]\n)\n<\/pre>\n<p>And compile and link the project by typing:<\/p>\n<pre class=\"brush:bash\">swift build<\/pre>\n<p>The swift build tool will start pulling in dependencies, and will compile and link the project. The build can take a surprisingly long time, which is an issue I will get back to later on.<\/p>\n<p>When the build is done, you can find the executable at<\/p>\n<pre class=\"brush:bash\">.build\/debug\/HelloWorld<\/pre>\n<p>Just run it. No JRE, application server, servlet container or other middleware needed. You should see an ascii art zewo logo and the message that our application is running and responding to port 8080. Let\u2019s try it out:<\/p>\n<pre class=\"brush:bash\">curl http:\/\/localhost:8080\/hello\nhello world<\/pre>\n<p>That\u2019s quite nice for less than 10 lines of code. Let\u2019s add some code to make it a slightly more elaborate REST service:<\/p>\n<pre class=\"brush:java\">import HTTPServer\nimport Router\nimport ContentNegotiationMiddleware\nimport JSONMediaType\n\nlet contentNegotiation = ContentNegotiationMiddleware(mediaTypes: JSONMediaType())\n\nlet router = Router { route in\n   route.get(\"\/hello\") { _ in\n       return Response(body: \"hello world\")\n   }\n   route.get(\"\/hello\/:name\/:location\") { request in\n       if let name = request.pathParameters[\"name\"],\n           let location = request.pathParameters[\"location\"] {\n           let data : InterchangeData = [\n               \"name\" : \"\\(name)\",\n               \"location\" : \"\\(location)\"\n           ]\n           return Response(status: .OK, content: data)\n       }\n       return Response(body: \"hello error world\")\n   }\n}\n\ntry Server(middleware: contentNegotiation, responder: router).start()\n<\/pre>\n<p>Add the following dependencies to Package.swift<\/p>\n<pre class=\"brush:java\">    .Package(url: \"https:\/\/github.com\/Zewo\/ContentNegotiationMiddleware.git\", majorVersion: 0, minor: 3),\n    .Package(url: \"https:\/\/github.com\/Zewo\/JSONMediaType.git\", majorVersion: 0, minor: 3),\n    .Package(url: \"https:\/\/github.com\/Zewo\/InterchangeData.git\", majorVersion: 0, minor: 3),<\/pre>\n<p>Build and run.<\/p>\n<pre class=\"brush:bash\">curl -s http:\/\/localhost:8080\/hello\/rik\/amsterdam | python -m json.tool\n{\n    \"location\": \"amsterdam\",\n    \"name\": \"rik\"\n}<\/pre>\n<p>At last count, there were over 50 <a href=\"http:\/\/docs.zewo.io\/\">Zewo projects <\/a>available, including HTTP(S)client and server, JSON serialization, support for various databases (MySQL, PostgreSQL and MongoDB), File IO, OpenSSL, an implementation of <a href=\"https:\/\/en.wikipedia.org\/wiki\/Mustache_(template_system)\">Moustache<\/a>, an SQL query DSL and ORM, Websockets, support for <a href=\"https:\/\/en.wikipedia.org\/wiki\/ZeroMQ\">ZeroMQ<\/a>, logging, basic authentication and more. Not all these projects are at the same level of completion. As of the time of writing this blog, the HTTPSServer implementation is broken, and MySQL support tends to lag behind because the developers prefer Postgres.<\/p>\n<p><strong>Venice<\/strong><\/p>\n<p>The star attraction of the Zewo framework is <a href=\"https:\/\/github.com\/VeniceX\/Venice\">Venice<\/a>, a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Communicating_sequential_processes\">CSP<\/a> implementation for Swift, based on <a href=\"http:\/\/libmill.org\/\">Libmill<\/a>. Libmill and Venice offer \u2018<a href=\"https:\/\/tour.golang.org\/concurrency\/1\">Go-style concurrency<\/a>\u2019, which is true to a point. The programming model is very similar. It is trivially easy to make huge numbers of lightweight coroutines run concurrently, and context switching is very fast. Unlike go, libmill and Venice run all coroutines in a single thread, at least for now, so this should not be mistaken for a tool to easily parallelize your code. I can recommend <a href=\"http:\/\/blog.golang.org\/concurrency-is-not-parallelism\">Rob Pike\u2019s presentation<\/a> on the subject if the difference isn\u2019t clear.<\/p>\n<p>Here is, for example, an implementation of the famous joke algorithm <a href=\"https:\/\/rosettacode.org\/wiki\/Sorting_algorithms\/Sleep_sort\">SleepSort<\/a> using Venice:<\/p>\n<pre class=\"brush:java\">import Venice\nimport Glibc\n\nlet channel = Channel&lt;Int&gt;()\n\nfor i in 1...100 {\n   let number = random() % 5000\n   co {\n       nap(Duration(number))\n       channel &lt;- number\n   }\n}\n\nfor msg in channel {\n   print(\"received \\(msg) from channel\")\n}\n<\/pre>\n<p>It starts 100 coroutines that each wait a number of milliseconds before writing said number to a shared channel. At the end, the numbers are read from the channel in sorted order. It\u2019s a very easy to use, easy to reason about and lightweight model for concurrent programming.<\/p>\n<p>All of the Zewo networking projects depend on Venice for concurrency. For now, that means they are single threaded. To facilitate parallelism, server sockets are bound with the <a href=\"https:\/\/lwn.net\/Articles\/542629\/\">SO_REUSEPORT<\/a> option, which allows multiple processes to bind to the same port. The OS will then take care of balancing connections between these processes.<\/p>\n<p><a href=\"https:\/\/xkcd.com\/303\/\"><strong>XKCD 303<\/strong><\/a><\/p>\n<p>Why is the build time for our hello world app so long when compared to, for example, the equivalent written in go? Part of the answer is in the different decisions <a href=\"https:\/\/en.wikipedia.org\/wiki\/Chris_Lattner\">Chris Lattner<\/a> and <a href=\"https:\/\/en.wikipedia.org\/wiki\/Rob_Pike\">Rob Pike<\/a> made for the languages they designed. For google, reducing the build times of their projects was one of the main <a href=\"https:\/\/talks.golang.org\/2012\/splash.article#TOC_6\">design priorities<\/a>. From the somewhat bare bones syntax of the language itself to the design of the standard libraries, usability and to some extent functionality has been sacrificed in order to reduce build times. Standard libraries typically don\u2019t contain functions that encourage you to pull in a dependency just to save you from typing or copying a few lines of code. Try looking for a round() function in the math package, for example.<\/p>\n<p>For Apple, a great number of features had a much higher priority than build times: compatibility with existing Objective-C code being one of the most important. If Swift lacked features that existing Objective-C coders expected, or if it couldn\u2019t work well with existing Objective-C code, it would never be adopted. Another major design decision was ease of use, presumably to keep development for iOS from becoming more expensive than android development because of the learning curve of Objective-C compared to Java. I believe they simply reached a point fairly quickly where they decided that compilation times were good enough and other priorities took over.<\/p>\n<p>The compile and link time of the Swift sources isn\u2019t the whole story. Try running a build in verbose mode to see what happens:<\/p>\n<pre class=\"brush:bash\">swift build -v<\/pre>\n<p>There seems to be an awful lot of repetition going on there. Let\u2019s count the top 10 most repeated statements:<\/p>\n<pre class=\"brush:bash\">swift build -v | sort | uniq -c | sort -n | tail -n 10\n    31 \/usr\/bin\/git -C ~\/Hello\/Packages\/URI-0.2.0 config --get remote.origin.url\n    33 \/usr\/bin\/git -C ~\/Hello\/Packages\/Data-0.2.2 config --get remote.origin.url\n    34 \/usr\/bin\/git -C ~\/Hello\/Packages\/CURIParser-0.2.0 config --get remote.origin.url\n    36 \/usr\/bin\/git -C ~\/Hello\/Packages\/Venice-0.2.2 config --get remote.origin.url\n    40 \/usr\/bin\/git -C ~\/Hello\/Packages\/Stream-0.2.0 config --get remote.origin.url\n    42 \/usr\/bin\/git -C ~\/Hello\/Packages\/InterchangeData-0.3.0 config --get remote.origin.url\n    42 \/usr\/bin\/git -C ~\/Hello\/Packages\/MediaType-0.3.1 config --get remote.origin.url\n    44 \/usr\/bin\/git -C ~\/Hello\/Packages\/CLibvenice-0.2.0 config --get remote.origin.url\n    46 \/usr\/bin\/git -C ~\/Hello\/Packages\/IP-0.2.1 config --get remote.origin.url\n    49 \/usr\/bin\/git -C ~\/Hello\/Packages\/System-0.2.0 config --get remote.origin.url\n<\/pre>\n<p>The Swift Package Manager is based on git repositories. Those can be projects on github, or they can be local directories on your build machine, but they are git repositories. Why does SPM ask the remote origin url of every dependency dozens of times, starting \/usr\/bin\/git a total of 558 times for such a simple program? It looks like SPM currently doesn\u2019t work well with the package based design decisions the authors of the Zewo framework made. Every dependency is checked, then every transitive dependency, then every transitive dependency of those etc. A Zewo project typically depends on a number of other Zewo projects, each responsible for one small task. They seem to be <a href=\"https:\/\/github.com\/apple\/swift-package-manager\/pull\/276\">working<\/a> on fixing this problem.<\/p>\n<p><strong>Vapor<\/strong><\/p>\n<p>One final server side Swift framework worth mentioning is <a href=\"https:\/\/vapor.readme.io\/\">Vapor<\/a>, a project started by Tanner Nelson. When I first tried it out, I had a difficult time getting it to work on Linux, but it has been developing very rapidly, and by now it is only a matter of executing the build script. The build script is written in Swift, which illustrates another cool feature of Swift: it can be used both as a compiled language and for scripting. Because of time constraints, a detailed description of the Vapor framework will have to wait for another blog post.<\/p>\n<p><strong>Fragmentation<\/strong><\/p>\n<p>At this time, the software landscape for server side Swift is quite fragmented. In an attempt at keeping the fragmentation from escalating further, the makers of Zewo and Vapor decided to launch <a href=\"https:\/\/github.com\/open-swift\">OpenSwift<\/a>, an effort to establish some standards and protocols that, as long as you follow them, should allow packages from different frameworks to be used together. It would be a good thing if this succeeds, but ultimately everyone will go with standards set by Apple. As of today, there are none, but I suspect there will be either an official Apple framework or an Apple equivalent of the JEE standard that third parties are free to implement. It is possible that Apple considers this not to be their field, in which case there\u2019s a good chance IBM\u2019s offering becomes the defacto standard. Until that happens, if you\u2019re considering starting a server side framework for Swift, it\u2019s worth looking at OpenSwift to make your project interoperate with others.<\/p>\n<p><strong>Conclusion<\/strong><\/p>\n<p>Swift is gaining a great deal of traction. An open source community is rapidly developing around Swift, including a number of projects that do not depend on iOS or OSX. The language seems to have been designed to appeal to as many developers as possible. You can use it in an object oriented style, a procedural style, based on elements of functional programming, or any mix of these paradigms that suits you. It can be used as a compiled language or for scripting. The syntax is immediately familiar and to a large extent readable for any Java or C# developer. Two years after its release on Apple platforms, Swift is already well on its way to pushing Objective-c out of the way for new projects. On the server, there is more competition.<\/p>\n<p>It is almost inevitable that Swift will find success as the server side backend to iOS apps. I don\u2019t see Java or Python being pushed out any time soon, but there is clearly a niche where Swift could be used very effectively, namely for writing microservices. There is no need for a separate JRE or middleware. Your project just compiles to a self contained statically linked binary. Once the tooling for management is there, I can imagine such binaries to be easier to manage and a lot easier on the resources than the equivalent based on Java.<\/p>\n<p><strong>Ready for production?<\/strong><\/p>\n<p>As of May 2016, Swift is not ready for production on the server. After the various frameworks made their projects work with the Swift Package Manager, Apple decided the SPM was not going to be ready on time to make the 2.2 release, so they removed it from the 2.x branch. The SPM will be part of the Swift 3.0 release. This means that the frameworks discussed in this blog all depend on the development snapshots, every one of which is likely to break your build. Swift 3.0 is scheduled for release in the fall of 2016.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In 2014, Apple announced the release of Swift, a new programming language for all their platforms. Their programming language of choice on iOS and OSX has always been Objective-c, a language which is\u00a0a bit dated (it predates C++) and as it has had new features (and syntaxes) bolted onto it every few years, it carries [&hellip;]<\/p>\n","protected":false},"author":100,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[10,127],"tags":[405,48,409],"class_list":["post-14711","post","type-post","status-publish","format-standard","hentry","category-development","category-swift","tag-apple","tag-linux","tag-swift"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Server side applications in Apple\u2019s Swift - Trifork Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/trifork.nl\/blog\/server-side-applications-in-apples-swift\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Server side applications in Apple\u2019s Swift - Trifork Blog\" \/>\n<meta property=\"og:description\" content=\"In 2014, Apple announced the release of Swift, a new programming language for all their platforms. Their programming language of choice on iOS and OSX has always been Objective-c, a language which is\u00a0a bit dated (it predates C++) and as it has had new features (and syntaxes) bolted onto it every few years, it carries [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/trifork.nl\/blog\/server-side-applications-in-apples-swift\/\" \/>\n<meta property=\"og:site_name\" content=\"Trifork Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-05-02T11:00:16+00:00\" \/>\n<meta name=\"author\" content=\"Rik van den Ende\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rik van den Ende\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/trifork.nl\/blog\/server-side-applications-in-apples-swift\/\",\"url\":\"https:\/\/trifork.nl\/blog\/server-side-applications-in-apples-swift\/\",\"name\":\"Server side applications in Apple\u2019s Swift - Trifork Blog\",\"isPartOf\":{\"@id\":\"https:\/\/trifork.nl\/blog\/#website\"},\"datePublished\":\"2016-05-02T11:00:16+00:00\",\"author\":{\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/16257519315b4534d0fe3fdf19528b22\"},\"breadcrumb\":{\"@id\":\"https:\/\/trifork.nl\/blog\/server-side-applications-in-apples-swift\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/trifork.nl\/blog\/server-side-applications-in-apples-swift\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/trifork.nl\/blog\/server-side-applications-in-apples-swift\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/trifork.nl\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Server side applications in Apple\u2019s Swift\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/trifork.nl\/blog\/#website\",\"url\":\"https:\/\/trifork.nl\/blog\/\",\"name\":\"Trifork Blog\",\"description\":\"Keep updated on the technical solutions Trifork is working on!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/trifork.nl\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/16257519315b4534d0fe3fdf19528b22\",\"name\":\"Rik van den Ende\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/841258d1f0de1fc146f09e005e611f2a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/841258d1f0de1fc146f09e005e611f2a?s=96&d=mm&r=g\",\"caption\":\"Rik van den Ende\"},\"url\":\"https:\/\/trifork.nl\/blog\/author\/rik\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Server side applications in Apple\u2019s Swift - Trifork Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/trifork.nl\/blog\/server-side-applications-in-apples-swift\/","og_locale":"en_US","og_type":"article","og_title":"Server side applications in Apple\u2019s Swift - Trifork Blog","og_description":"In 2014, Apple announced the release of Swift, a new programming language for all their platforms. Their programming language of choice on iOS and OSX has always been Objective-c, a language which is\u00a0a bit dated (it predates C++) and as it has had new features (and syntaxes) bolted onto it every few years, it carries [&hellip;]","og_url":"https:\/\/trifork.nl\/blog\/server-side-applications-in-apples-swift\/","og_site_name":"Trifork Blog","article_published_time":"2016-05-02T11:00:16+00:00","author":"Rik van den Ende","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Rik van den Ende","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/trifork.nl\/blog\/server-side-applications-in-apples-swift\/","url":"https:\/\/trifork.nl\/blog\/server-side-applications-in-apples-swift\/","name":"Server side applications in Apple\u2019s Swift - Trifork Blog","isPartOf":{"@id":"https:\/\/trifork.nl\/blog\/#website"},"datePublished":"2016-05-02T11:00:16+00:00","author":{"@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/16257519315b4534d0fe3fdf19528b22"},"breadcrumb":{"@id":"https:\/\/trifork.nl\/blog\/server-side-applications-in-apples-swift\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/trifork.nl\/blog\/server-side-applications-in-apples-swift\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/trifork.nl\/blog\/server-side-applications-in-apples-swift\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/trifork.nl\/blog\/"},{"@type":"ListItem","position":2,"name":"Server side applications in Apple\u2019s Swift"}]},{"@type":"WebSite","@id":"https:\/\/trifork.nl\/blog\/#website","url":"https:\/\/trifork.nl\/blog\/","name":"Trifork Blog","description":"Keep updated on the technical solutions Trifork is working on!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/trifork.nl\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/16257519315b4534d0fe3fdf19528b22","name":"Rik van den Ende","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/841258d1f0de1fc146f09e005e611f2a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/841258d1f0de1fc146f09e005e611f2a?s=96&d=mm&r=g","caption":"Rik van den Ende"},"url":"https:\/\/trifork.nl\/blog\/author\/rik\/"}]}},"_links":{"self":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/14711","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/users\/100"}],"replies":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/comments?post=14711"}],"version-history":[{"count":0,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/14711\/revisions"}],"wp:attachment":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/media?parent=14711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/categories?post=14711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/tags?post=14711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}