Port WordPress from PHP to Swift

Note: This is still a draft. I will be editing it as I continue to discuss it with the community, and as I get time to fill in more details.

Apple is open-sourcing the super popular Swift programming language this year. With the language now available on Linux and probably windows shortly after that, it is only a matter of time before many projects written in flavors of C will be ported to Swift. Even PHP could eventually be written in Swift. But, why wait?

We could port the subset of PHP functions that WordPress plugins and themes use along with porting WordPress core. If we do it right, a simple script could convert plugin and theme code to (not-very-efficient) Swift code. Then as plugin authors learn Swift they can make there code more efficient by using native functionality instead of the interface functions we created for the transition.

There are probably nuances of how a ternary is treated that will make using a search and replace code conversion very difficult, but I wouldn’t it be awesome if it worked? I am quite literally thinking of creating a library of functions that allow running WordPress in Swift. After the conversion is done, we can continue developing WordPress in Swift and start taking advantage of its native capabilities.

Ok, your turn. Tear the idea apart, and I will update to make it more feasible.

Leave a Reply

Your email address will not be published. Required fields are marked *