Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

AdonisSMU

macrumors 604
Original poster
Oct 23, 2010
7,297
3,047
Are there any plans to use SWIFT as a backend technology rather than just a FE technology? The reason I say this is because C# and .net being used on the backend probably significantly helped with its adoption.
 

chown33

Moderator
Staff member
Aug 9, 2009
10,740
8,416
A sea of green
If the backend is OS X, I don't see why not.

One problem with Swift is it's currently an Apple-only language. If/when that changes, then Swift will work on more backends. Otherwise it won't. Simple as that.
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,558
6,058
Are there any plans to use SWIFT as a backend technology rather than just a FE technology? The reason I say this is because C# and .net being used on the backend probably significantly helped with its adoption.

...

C# doesn't seem like a particularly popular language:

http://blog.codeeval.com/codeevalblog/2014#.U5YTJBakAeI
https://github.com/blog/99-popular-languages
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

So I don't think I'd base decisions on how to proceed with the language based on what C# does. Mimicking C, Java, or Python might be a good idea (and Python is often used as a backend).
 

Ap0ks

macrumors 6502
Aug 12, 2008
316
93
Cambridge, UK
C# doesn't seem like a particularly popular language:
You're kidding right? C# is one of the most popular languages in the Windows world. The first two links are too biased to open-source friendly languages so don't give an accurate picture whereas the third link shows C# right alongside C & C++ so not sure what makes you say it's not popular.
 

AdonisSMU

macrumors 604
Original poster
Oct 23, 2010
7,297
3,047
You're kidding right? C# is one of the most popular languages in the Windows world. The first two links are too biased to open-source friendly languages so don't give an accurate picture whereas the third link shows C# right alongside C & C++ so not sure what makes you say it's not popular.

C# is very popular and many devs use it. That's why I brought it up. TIOBE Index has C#(#5) listed right behind C++(#4). Apple could put a dent in the PHP, Python, Java backends by making SWIFT accessible in this way as well. Or maybe a enterprising developer needs to build the capability to have a SWIFT web server.
 

Ap0ks

macrumors 6502
Aug 12, 2008
316
93
Cambridge, UK
C# is very popular and many devs use it. That's why I brought it up. TIOBE Index has C#(#5) listed right behind C++(#4). Apple could put a dent in the PHP, Python, Java backends by making SWIFT accessible in this way as well. Or maybe a enterprising developer needs to build the capability to have a SWIFT web server.
As far as I'm aware there's nothing stopping you from using Swift to create a backend server, the only issue is that at present it'll need to be run on OS X which isn't a hugely popular server OS.

I don't think the popularity of C# has increased because it can be used in the backend and the frontend, but more because people loathe Visual Basic and Microsoft have really pushed the use of C# in their technologies like .Net. It's all about the ecosystem really, Apple don't need to be more popular than any other language as long as they have developers creating apps for iOS & Mac OS using Swift. CloudKit should cover things for the majority of basic backends and other developers will just use a tool best suited to the task.
 
Last edited:

AdonisSMU

macrumors 604
Original poster
Oct 23, 2010
7,297
3,047
As far as I'm aware there's nothing stopping you from using Swift to create a backend server, the only issue is that at present it'll need to be run on OS X which isn't a hugely popular server OS.

Gotta start from somewhere... People managed to make a crappy Java backend surely SWIFT devs can make a SWIFT backend.
 

Cromulent

macrumors 604
Oct 2, 2006
6,802
1,096
The Land of Hope and Glory
Gotta start from somewhere... People managed to make a crappy Java backend surely SWIFT devs can make a SWIFT backend.

If all you want to do is run web applications written in Swift then it is pretty easy to do. Just write a FastCGI or SCGI server in Swift and run Nginx as your HTTP server connecting to the Swift backend.

You could write an SCGI server for Swift in no time at all if you really wanted too. Here's the spec to get you started.

http://www.python.ca/scgi/protocol.txt

Nginx supports SCGI and FastCGI out of the box so really its not a big issue. The bigger issue that you don't seem to have considered is the Swift API for accessing a database server. You'd likely want to take the C API for PostgreSQL (or perhaps MySQL if you are really masochistic) and then writing a Swift wrapper for it. That might well take a little longer but to get something simple to work with it shouldn't take that long.

And that is all you really need to write backends in Swift.
 

mozumder

macrumors 65816
Mar 9, 2009
1,283
4,416
i could use a version of Django written in Swift, interaction with Final Cut Pro X exporting and Aperture's Raw conversion capabilities...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.