Could you technically use Swift as a programming language for building a website / web app?
Update: Looks like a lot of people are working on this.
Official support from Apple: https://swift.org/server-apis/
Swift.org - Swift System is Now Open Source.
Swift is a successor to both the C and Objective-C languages. It includes low-level primitives such as types, flow control, and operators. It also provides object-oriented features such as classes, protocols, and generics, giving Cocoa and Cocoa Touch developers the performance and power they demand.
Possibly to the surprise of some, it is also possible to write and run Swift code on Windows 10 systems. Swift can be described in much the same way as many of today's newer programming languages. Terms such as modern, clean, fast, and safe are all used to describe Swift.
Is Swift a frontend or backend language? The answer is both. Swift can be used to build software that runs on the client (frontend) and the server (backend).
In theory, of course.
Any program that can output plain text can also be used for CGI(Common Gateway Interface) which includes Swift as well.
Therefore, yes, you can use Swift for web programming. However, currently, there are no additional libraries(like there are in PHP or EJB/JSP) to make this process easy for you. Take a look at some popular web frameworks for Swift such as Vapor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With