4 ms·
I would love to see Swift for Android programing. I'm already using Kotlin, a language very close to Swift, for programming our Android apps. But I find Swift n
by blumomo 11y ago
I would love to see Swift for Android programing. I'm already using Kotlin, a language very close to Swift, for programming our Android apps. But I find Swift niftier than Kotlin.
- burntcookie90 11y agoIn what way? I've recently started writing in Swift and I find it to be less powerful than Kotlin. One such feature that's missing: extension expressions. Allows things like `let` and `with` from the kotlin stdlib
- Alphasite_ 11y agoWhat exactly are extension expressions, do you mean extension methods? If so, Swift does support them. I actually miss interface extensions in Kotlin, but thats a java cross compatibility issue.
- burntcookie90 11y agolook at the signature for `with` inline fun <T, R> with(receiver: T, f: T.() -> R): R it takes a lambda that is scoped to the receiver type `T`. This means the lambda runs in the scope of whatever is passed in as a receiver. with(list) { add(item) add(item) } This essentially lets you create DSLs for whatever. Another thing that's bit me in butt recently is that `Protocol`s aren't concrete types, unlike an `interface` in Java/Kotlin.
- s369610 11y agohttp://www.elementscompiler.com/elements/silver/ http://www.elementscompiler.com/elements/silver/ free one here
- niutech 11y agoIf you want Swift on Android, have a look at Eclipse Xtend: http://futurice.com/blog/android-development-has-its-own-swift http://futurice.com/blog/android-development-has-its-own-swi...