Will Unity Ever Support Apple's Swift?

Just a simple question really. I’m curious as to if Unity will ever implement Apple’s Swift Language? If not, why?

1 Like

First of all you’d have to tell us why. I can see no benefit in doing so.

Really it could just be another language to use for people who feel they want to migrate from Xcode to Unity. Just something else besides C# and Javascript.

Honestly I think it would be cool to see a node based visual scripter native inside Unity. I have NO idea why that’s not a thing yet.

Im not a swift programmer myself. It would be cool for unity to support more languages but that comes at a cost as compiling will be slower with more languages.

No, it comes at a cost of breaking Unity if you want IL2CPP. A better angle would be Unity having some sort of pluggable interface at a future date…

2 Likes

I’d like to see Swift replace Unityscript. The syntax is similar enough that porting existing code wouldn’t be hard, and it’s a fully-developed language, whereas Unityscript development unfortunately stopped some years ago. In any case, there’s no reason why adding languages would have any effect on compiling times.

–Eric

6 Likes

I think Swift would be an awesome addition to Unity. Plus it would be a perfect sales pitch to current Xcode developers.
http://feedback.unity3d.com/suggestions/swift-support

As long as it spits out standard DLLs I don’t see how it would effect IL2CPP. It’s about creating a .Net Swift compiler.

2 Likes

If you can build or find a compiler from swift to .NET IL, then you are good to go.

1 Like

… but it’s not for everyone and it’s going to stress Unity in a number of areas: language features, documentation, examples, tutorials and so forth.

It is also incredibly niche. But that doesn’t make it worthless, it just means Unity can’t make a decision to do it just for swift. It needs to allow people to use their own choices at their own risk and responsibility, some kind of glue. That makes everyone happy. Loads of people have their preferred language that’s always going to be best for them.

I wasn’t imply that Unity should support it. Just that it’s already possible if someone loves the language that much.

I see Swift as a combo of Python and Javascript. Both languages which I don’t like that much lol. Im still willing to try swift though. Also, as hippocoder said, it would really create a problem where documentation and tutorials would suddenly become obsolete. If anything, Unity should create some sort of Javascript to Swift converter and include both Swift and Javascript. Over time, Unity will just ease Swift into the engine and remove Javascript at Unity 6 when the converter is mature and works with a high success rate.

However I would love to try out Swift and see what all the fuss is about :wink:

I did and it’s not for me :slight_smile: Might appeal to people who loved blitzbasic and fancy a flexible way to work. For me, I just need what is guaranteed to work

Say Unity would added Swift support… Unity-Swift could become a derivate so far from the original swift… that programmers with swift knowledge would not even benefit from it.

Just like UnityScript derivates from Javascript so much, to an extend that no one with Javascript experience does really benefits from learning UnityScript instead of C#…

Personally, I’m really happy with C# and I could care less if UnityScript support is eventually drops. (And even lesser if about adding more languages like swift.) In fact I would be worried that adding another language, means less time developing/fixing new features.

i rather see a focus on features and docs, instead of supporting more languages. C# just makes sense if your working in mono/.net

No idea why you think that would happen. Has Unity C# deviated so far from the original C#? No, not at all. Unityscript is a custom language, and not Javascript. The idea of Swift in Unity is for it to be Swift, not a custom language.

That’s nice. This topic isn’t for people who are really happy with C#.

–Eric

2 Likes

I was drawing a parallel to the many new comers that think going with UnityScript because they have Javascript experience is the best route to go. A lot of people, at first, think that UnityScript is Javascript. I’m not saying it is. But I certainly was one of them in my beginning. Hey I guess naming it Javascript and giving it the .js extensions doesn’t help either.

When is giving my opinion not allowed in here?
If there is no place for argumentation in here: this wouldn’t be a forum.
And I didn’t stop at I’m really happy with C#, Goodnight… My paragraph was basically an argument on why I would not see the arrival of a new programming language in Unity too well:

To get back on topic and answer the original question: No I do not think that Unity will ever support Apple’s Swift.

I’m not sure I understand all the implications but it seems to me IL2CPP almost solves this. There are a number of languages which can be used to create .net IL: C#, F#, IronPython, IronRuby, etc… if we can compile from IL to CPP, then wouldn’t any language that can create .net IL be supported by Unity? In that case, someone just needs to write a .net IL compiler for Swift, which personally, I think has a decent chance at happening. (Sorry for the link to a chm file but apparently Microsoft thought it would be easier to archive it’s old TechNet magazine articles in this antiquated format)

I’d rather see the Unity devs use their time to develop a native Blueprints like visual scripting tool which will have more utility then a niche syntax.

Not really. I think at the beginning it was supposed to be “almost Javascript” though. But the point of Swift in Unity is that it would be Swift, not “a new language sort of vaguely similar to Swift”.

You don’t need IL2CPP for anything; that’s an unrelated step that works on code that’s already converted to CIL. “All” you need is a Swift → CIL compiler. Such as the Boo → CIL and Unityscript → CIL compilers that already exist. You can already use other languages in Unity such as F# by compiling into DLLs, but that’s not really an ideal way to work.

–Eric

So it very much makes sense to not support swift but instead support the LanguageX → CIL step. If I recall one of the Unity guys did express this on skype and had a good discussion on it.

Speaking of which can you just bite the bullet and join Unity and mods on slack? it’s quite trouble free I assure you… and we’d love to have you :stuck_out_tongue:

1 Like