top | item 11145472

Swifton: Ruby on Rails-inspired web framework for Swift

98 points| necolt | 10 years ago |github.com | reply

67 comments

order
[+] autoreleasepool|10 years ago|reply
It seems that, outside of what's used in Cocoa, the Swift language is pretty volatile right now. I would hesitate to commit to a large project that didn't involve the App Store.
[+] sdegutis|10 years ago|reply
I think the hope of projects like these is partly to try to advance interest in Swift which draws in more users who then help contribute to making the language more cross-platform, and partly to be f1rst in the project's niche when the language finally crosses that barrier, so that it becomes the de facto standard. (Think Compojure for Clojure, in the same problem domain.)
[+] PakG1|10 years ago|reply
My personal hope is that a lot of the long-term risk is mitigated due to IBM's partnership with Apple and alleged goals to use Swift in enterprise. Admittedly, that may not deal with the short-term risk.
[+] bsaul|10 years ago|reply
Seems to me like the real challenge in those framework (excepting performance, of course) will be in the orm component. Having a library that can query a db in a typesafe way is a must.

Another will be in the concurrency patterns ( promises ? Coroutines ?, etc).

But i get a great hope that they will succeed. Having a strong open source community will help. In fact, i'm so fed up with the sad state of uikit right now, that i see a brighter future for swift on the server side than on the client. Maybe an android sdk for swift would be a great idea...

[+] jowiar|10 years ago|reply
The challenge with any type safe language is interacting with the outside world -- internal consistency is easy, but figuring out how to mediate the non-typesafe outer world is always a bit of a fight. Slick is one swing at the typesafe ORM, but I'm not sure it gets it quite right.

For concurrency, I'd be very intrigued if streams were the first-class concurrency approach -- It's been interesting working with Akka Streams in Scala. They make 90% of concurrency-related things easy and 10% of things seem to be fighting leaky abstractions, but I'd be curious if they were built into the language early on as primitives whether the leaks would go away.

[+] seivan|10 years ago|reply
I actually like GCD, so I hope concurrency doesn't make it to the language, or if it does tries to stay as close as it can to GCD api design.
[+] kawsper|10 years ago|reply
I wonder if something like Realm.io will be adopted more widely https://realm.io/docs/swift/latest/

They seem to have adoption in some bigger companies, but I don't know if any of them are using the Swift version yet.

[+] JamoneK|10 years ago|reply
Have you heard of Zewo and SwiftAndroid?
[+] protomyth|10 years ago|reply
I wish Apple had not ditched NeXT's EOF. It would make a fine open source project these days.
[+] hagmonk|10 years ago|reply
The project banner depicting a damsel in distress on the railway tracks is going to make some people twitch. I'd avoid that distraction by picking something gender neutral. My 2c.
[+] PKop|10 years ago|reply
It's fun. You don't have to get offended. It's just a silly picture. No one was harmed in it's making.

Stop wasting people's time, let them focus on productive aspects of the project.

[+] mrits|10 years ago|reply
It is Swift on Rails. If it was Kanye on Rails no one would be offended to see a picture of a man on the railroad.
[+] henryw|10 years ago|reply
It's Taylor Swift. Come on.
[+] whiddershins|10 years ago|reply
Parent comment is just trying to be helpful, and people are down voting it. The comment points to a legitimate concern so ... like all advice, take it or leave it, but I think it would be gracious to say thanks rather than pile on.

Also you really can't legally use the image of a performer without their permission, if you care abut such things.

[+] staticelf|10 years ago|reply
I don't think anyone cares about if a small minority twitches. You don't have to please everyone. In fact, you cannot.
[+] jakobegger|10 years ago|reply
For me this was an instant turnoff -- it's really hard for me to take a project serious if that's how they present themselves.

Good software stands on its own, and doesn't need corny jokes like this.

[+] seivan|10 years ago|reply
You could have made it better by using protocols for the actions. So the methods for adding routes would ensure that the methods for new and update exists using a where clause checking protocol conformance.

There is potential here, I like a "full" package like "Omakase", granted its built using Swifts strength and a pipeline model like Express.js and/or Rails and its rack middlewares.

[+] necolt|10 years ago|reply
Seivan, thanks. Yes, Rails "Omakase" is driving Swifton development.

I'm not sure that protocols will help here, because Swifton supports before/after filter. Could you explain more your idea about how protocols could help here to implement actions with filters?

[+] Razengan|10 years ago|reply
I am mainly a hobbyist/newbie that recently started to learn Ruby, and Ruby on Rails. While I like them both, I would prefer to just work in Swift.

How soon does HN expect a Swift-based framework that is comparable to the maturity of Rails, or other powerful frameworks for that matter? Do you think Apple might jump in and introduce one of their own?

[+] herbst|10 years ago|reply
Years, if ever. Things like Rails are very major based on the experience of thousands of developers.
[+] coldcode|10 years ago|reply
So many of these now. I wonder which one will eventually become the node of Swift.
[+] fleshweasel|10 years ago|reply
Node isn't a JavaScript framework so much as a platform to run JavaScript on. Express is maybe more analogous to Swifton here.
[+] aroman|10 years ago|reply
Not which; if any, I think.

Node's tight coupling to JavaScript seems like more of an exception than a rule — look at Java, Ruby, Python, etc.

[+] yeskia|10 years ago|reply
There's a lot of strings being thrown around for a type-safe language.
[+] Pxtl|10 years ago|reply
Hooray for being stringly typed.
[+] vortico|10 years ago|reply
Is Swift still OS X-only, or can I use this on Linux?
[+] supster|10 years ago|reply
> A Ruby on Rails inspired Web Framework for Swift that runs on Linux and OS X.
[+] steveklabnik|10 years ago|reply
The open source release provided the ability to build Swift on Linux.
[+] jernfrost|10 years ago|reply
There seems to be so many web frameworks popping out for Swift, how does this compare with other languages such as C#, Scala and Go?
[+] muhmi|10 years ago|reply
So, why would you write systems requiring concurrency and fault tolerance in Swift? What happens when a request explodes? Can it do hot code loading?