5 ms·
One possible difference is that Apple has signaled that Swift will be the language at some point. As far as I know Google didn't do that with Dart and, in fact
by Zelphyr 12y ago
One possible difference is that Apple has signaled that Swift will be the language at some point. As far as I know Google didn't do that with Dart and, in fact, couldn't without getting buy-in from all the other browser vendors.
- kybernetyk 12y ago> One possible difference is that Apple has signaled that Swift will be the language at some point Have they? Then I really hope they add some easy form of C++ interop to swift in a future release. There's so much C++ code out there in the Mac/iOS world that rewriting it to swift (or even just wrapping it in C) would make no economic sense.
- astigsen 12y agoSince you can use Objective-C (and therefore also Objective-C++) libraries directly in Swift, it actually has quite a nice integration. Objective-C++ is a far better interface layer than something like FFI or having to write C wrappers for everything (as you see in most other languages).
- dottrap 12y agoNitpick: Objective-C and C are terrific for interoperation. FFI works pretty well with Obj-C and C too because it is all based on C binary compatibility and predictable symbol mangling. This is how previous Apple language bridges like PyObjC and RubyCocoa worked. C++ and thus Objective-C++ has always been a disaster for FFI or anything that depends on binary compatibility or predictable symbol name mangling. Obj-C++ has a lot of ugly areas partly because of this. Kudos to Apple to making it work as well as it does. Swift is terrific that it also seems to interoperate with C/Obj-C nearly seamlessly (bridging headers), but it is no surprise that the Swift documentation immediately says it doesn't support C++ and you must build C interface wrappers. * Edit: reclarified comment
- sjwright 12y ago> Have they? Pretty much; Apple doesn't tend to release big things like this on a whim. At minimum they've certainly signaled that Swift will be treated as a first-class language on par with Objective C, and has every likelihood to replace ObjC for most use cases.
- lukifer 12y agoI think the context of the replaced languages also matters. Objective-C is de facto Apple-only to start, whereas Javascript is currently the largest run-everywhere language, mostly due to an accident of history that Dart is not likely to replicate.
- apetrovic 12y agoI actually hope Apple won't abandon Objective C and continue to improve it. I'd like to have languages from both sides of the spectrum (dynamic ObjC vs strongly typed Swift).
- sjwright 12y agoI can't imagine ObjC is going anywhere, much like how ObjC didn't cause plain C or C++ to disappear. There's far too much established code out there, in third party applications and Mac OS X itself, so support will remain. Besides, it's not like Swift is necessarily ideal in all cases. For example it might remain relevant for C library bridging code to be written in ObjC, even if the application itself is Swift at the core.
- aikah 12y agoI totally agree,Dart should be first class on Android for instance.Or what the point creating a whole new language.To run it in the browser?it will never win in that field.Dart is a good language,Dart engine could be an alternative to V8 in nodejs too.
- pjmlp 12y agoFully agree. The Chrome dashboard tasks now show DartVM integration is being worked on. Most likely it will be a ChromeOS language and that is it. From the keynote, even with ART it seems Android official languages are still Java and C++ and it won't change in the near future.