Live data from Hacker News

Interoperability: Swift’s Super Power

browsercompany.substack.com

41–50 of 74 posts

Re: Interoperability: Swift’s Super Power

#41

Earlier quoted context omitted.

Yes, exactly. Interoperable doesn't mean much if it is not properly cross platform. I've tried Dart for a project, and it worked OK, but in my opinion TypeScript is clearly the way to go in the foreseeable future.

Typescript is a safe bet. I think for mobile apps Flutter is a better tech stack than React Native though and can survive if Google doesn’t give up on it.

"if" exactly, Google has a tendency to drop projects out of nowhere, or to suddenly change course on it.

Another big "no" factor with Flutter for me is that it's its own ecosystem and language; React Native ties in with the greater React ecosystem and the even greater Node ecosystem, which gives you a lot of libraries, code examples, maintenance and improvements. Second, hiring is a major factor. You can assign most current-day web developers onto a RN project with little problems, whereas Flutter is a new language and skill set.

Re: Interoperability: Swift’s Super Power

#43

Earlier quoted context omitted.

Typescript is a safe bet. I think for mobile apps Flutter is a better tech stack than React Native though and can survive if Google doesn’t give up on it.

"if" exactly, Google has a tendency to drop projects out of nowhere, or to suddenly change course on it. Another big "no" factor with Flutter for me is that it's its own ecosystem and language; React Native ties in with the greater React ecosystem and the even greater Node ecosystem, which gives you a lot of libraries, code examples, maintenance and improvements. Second, hiring is a major factor. You can assign most…

Sure it’s a valid concern. I’m building my own app so hiring isn’t a concern for me. So far I’ve found the Flutter library ecosystem to be more than adequate for my needs and I’m finding it a far more pleasant and productive platform than React Native to work in.

I always found RN very easy to get started with but over time as features get added and dependencies evolve RN apps become increasingly difficult to update and maintain.

Also React is one of those easy to learn but difficult to master technologies. I’ve interviewed a lot of people claiming to know React that I wouldn’t trust to build anything complex. There are just so many footguns.

Re: Interoperability: Swift’s Super Power

#45
post #27

Earlier quoted context omitted.

Yes, exactly. Interoperable doesn't mean much if it is not properly cross platform. I've tried Dart for a project, and it worked OK, but in my opinion TypeScript is clearly the way to go in the foreseeable future.

Typescript is limited by V8 capabilities, and the constraints of a dynamic language JIT. To achieve best perfomance one needs to write C++ code as native modules. Interoperable means a lot even inside Apple ecosystem, bringing all those C, Objective-C and now C++ code with ease into Swift projects. Using Metal from Swift, althought implemented in Objective-C and C++, is already a productivity boost compared to anythi…

I'd note that I've seen cases where the V8 JIT was sufficiently good that thunking to C++ and back meant that the performance difference was minimal.

But that was for 'js library backed by C++' shaped cases whereas for performance critical app-specific code you probably want 'C++ library that presents a JS interface at the top level.'

Re: Interoperability: Swift’s Super Power

#46
post #27

Earlier quoted context omitted.

Typescript is limited by V8 capabilities, and the constraints of a dynamic language JIT. To achieve best perfomance one needs to write C++ code as native modules. Interoperable means a lot even inside Apple ecosystem, bringing all those C, Objective-C and now C++ code with ease into Swift projects. Using Metal from Swift, althought implemented in Objective-C and C++, is already a productivity boost compared to anythi…

If you are on the Apple platform only, Swift is great, and I enjoyed using Metal myself. But eventually I accepted how much it limited what I can do as a developer. So, I prefer TypeScript now. I am not touching C++ or stuff like that, if I need performance, I compile to web assembly, hopefully soon from my own language :-)

Web Assembly and performance on the same sentene is an oxymoron.

Re: Interoperability: Swift’s Super Power

#47

Based on the title I really thought this would about the SWIFT (messaging system) and interoperability (Interledger protocol). I really need to stop reading crypto articles. Its taking over my tech side.

We clearly need namespaces for product names :)

Re: Interoperability: Swift’s Super Power

#48
post #8

On the same note, watch Apple's talk at CppCon 2023, "Introducing a Memory-Safe Successor Language in Large C++ Code Bases" https://www.youtube.com/watch?v=lgivCGdmFrw

This was an awesome talk. I really wish he went more into their plans to put Swift in the kernel and the bullet point of expecting the language to "scale down to a minimal runtime" (~7:41).

Re: Interoperability: Swift’s Super Power

#49
post #17

Hmm...Swift never struck me as a particularly interoperable design. Really rather the opposite. It has weird and super-specific calling conventions, requires mangled identifiers, is uber-static, uses Swift syntax for its "module" files etc. And it turns out... "Instead, Swift embeds a copy of clang, the C and C++ compiler," ...well gosh, you can brute force "interoperability" by simply creating the union of all the l…

Don’t forget that this interoperability was put in place to support a specific engineering goal: to make it possible to slowly (over decades, probably) transition from 4 different languages (C, ObjC, C++, ObjC++) at every level of Apple’s stack towards a single memory-safe successor language. Would you recommend they wait for some weird Java-esque 100% Pure implementation within the compiler itself before they can be…

Wow, I'm only three minutes in, but it's a good talk. Among other parts of Apple's ecosystem (especially Webkit would make sense to move to Swift for memory safety), imagine if they start incrementally moving llvm/Clang over to Swift using this, that would be very interesting.

Re: Interoperability: Swift’s Super Power

#50
post #48
post #8

On the same note, watch Apple's talk at CppCon 2023, "Introducing a Memory-Safe Successor Language in Large C++ Code Bases" https://www.youtube.com/watch?v=lgivCGdmFrw

This was an awesome talk. I really wish he went more into their plans to put Swift in the kernel and the bullet point of expecting the language to "scale down to a minimal runtime" (~7:41).

There's some elaboration in this forums post on "Embedded Swift": https://forums.swift.org/t/embedded-swift/67057
Post reply on HN