Noze.io in 2018
Just a small update on the state of Noze.io in 2018. What we might be able to do. Or not. And other things of interest.
Swift 4
The only real thing we did in 2017 was adjust Noze.io to compile with
Swift 3 as well as with Swift 4, which was finally released in 2017.
The lack of changes is mostly because Noze.io is kinda feature complete
wrt the features that are possible w/ the current iteration of the
Swift language.
And that feature set didn’t change w/ Swift 4.
In Outlook: Swift 4 or 5 we looked at the features Swift 4 might bring:
- Asynchronous Programming
- Reflection
- Enhanced Generics
None of that arrived. Back then “The big goal for Swift 4 seems to be ABI compatibility”, but even that didn’t happen 😬
Instead with Swift 4 we got those:
- Codable, an extremely limited but compiler supported way to encode Swift types as JSON/other formats
- keypathes
- minor changes to collections and Strings
- multiline string literals
- minor changes in SPM, cross compilation toolchains
Codable is going to allow some hacks to workaround the missing reflection in ZeeQL, but apart from simple demos, it provides little value to production endpoint implementations. More importantly Codable has zero provisions for streaming (neither in nor out).
Keypathes may be neat, but to be useful for our purposes they again lack the necessary reflection capabilities. It is unclear yet how they can benefit server side swift frameworks (there are some interesting projects around them, but they all seem to hack around the lack of reflection). Also, they are not integrated w/ Codable. 🤦♀️
Collection changes are nice, but minor, multiline strings can be pretty cool for fast hacks.
A hidden gem is the support for cross compilation toolchains. Those allow you to build for example Raspberry Pi binaries on a Mac (or even the reverse 😜)
This leaves us with:
Outlook: Swift 5 or 6
What about upcoming Swift versions? The big goal for Swift 5 seems to be ABI compatibility, which is important but less relevant on the server.
There are three things of interest with regards to a future Swift version:
- Asynchronous Programming
- Reflection
- Enhanced Generics
And we covered them a year ago: Outlook: Swift 4 or 5. Same applies.
Note: To be fair, the soon to be released Swift 4.1 brings one generics enhancement: Conditional Conformance. But we’d like to see a generic protocols :-)
Plans
The expectation is that Swift 5 is probably not going to bring us significant enhancements, but focuses on just ABI. As a result, Noze.io probably won’t change much in 2018.
Contributions are still welcome of course! 😁
Other efforts
We have been active in a set of other efforts:
Swift Server APIs Work Group
In October 2017 the server working group released the HTTP Server API 0.1.0. It is a synchronous implementation contributed by IBM. The API itself is actually asynchronous and designed by Johannes Weiss at Apple.
We have been the first to step forward and did an Apache based implementation of the API using mod_swift: Apache Swift HTTP Server API 0.1.0
To improve things in the core implementation we then submitted an GCD based, Asynchronous Implementation of the API. This is still hanging around, probably this isn’t go to be merged.
Then we started a blog series about using the API, more articles may come!:
- Using the Swift Server API 0.1.0 (write a simple endpoint using just the API)
- µExpress (write an Express-like micro-framework with routes and stuff - in just about 200 lines of code)
Right now the Swift Server Work Group seems to be pretty dead again. Everyone seems to drive forward their own APIs instead of working together on a joint one. The reasonable assumption: 🤑 interests at work 😉
We’ve seen Swift core people showing old WebObjects pictures. May that imply?:
We’ll see, maybe that means there will be big news in 2018 …
mod_swift & ApacheExpress
In May 2017 we split mod_swift ✂️ ApacheExpress. mod_swift turned into a small standalone project. And a much enhanced ApacheExpress is becoming its own, separate, project.
This makes available mod_swift to other server side swift projects, which can easily integrate with it. As we demonstrated with our Apache Swift HTTP Server API 0.1.0.
Stay tuned wrt ApacheExpress. Some really cool stuff may get released in 2018, work in progress. The old ApacheExpress demo is still live, including the glorious TodoMVC implementation, the only one which supports CalDAV/CardDAV and by that the iOS/macOS Reminders app.
ZeeQL
ZeeQL is our ORM for Swift. It is very much like EOF and CoreData, with a lot of additional stuff thrown in. Expect to see a nice version of ZeeQL in 2018 which shamelessly abuses Codable to replace the missing reflective capabilities in Swift.
PL/Swift
PL/Swift is just a demo project. It allows you to enhance the PostgreSQL database server using Swift functions (which are then directly available to PG SQL!) Rarely makes sense in the real world. Why? Because we can.
Summary
Leaving alone everything else, one thing is for sure: 2018 is going to be the year of Swifter!
… also, we wish everyone, well most of you, a Happy New Year and Happy Nozing!