I’ve been meaning to try out swift for a while. I finally got some motivation to push it to the top of the “things to learn” queue today, when a coworker announced an upcoming seminar at work, all about learning perfect, which is one of the leading web frameworks written in swift.
I wrote a pretty simple blog, with a route that loads a static file, and a second route that loads up a bunch of markdown “posts” stored as flat files. It’s basically a crappy prototype of wintersmith, but with client-side markdown parsing.
My reactions to swift:
- I don’t think I can use any classes with an
NSprefix in perfect, but most google searches about swift advise you to use one at one point or another.
- Perfect provides a lot of functionality that I would expect to be built into the standard library. For example, perfect’s library includes classes for file and directory manipulation. This makes sense if my theory in (1) is true.
- Some swift packages are available as cocoa pods, and others are available as swift packages, and I don’t think perfect works with cocoa pods.
- What I’ve seen of perfect is reminiscent of how routing works in gin, express, and fastroute. This part seemed totally natural to me. It seems like most platforms and frameworks are settled on the API for that.
- Swift is pretty verbose. So much so, that I think that there would be a high learning curve for a web developer used to primarily working in interpreted languages like ruby or js.
Another thing I found while working on this is that I stil love vue.js. It’s just lovely.