← Back to context

Comment by willtemperley

3 months ago

Interesting link, but that's a nearly 7 year old version of Swift (4.2) running on Linux.

I wonder how the performance would be with Swift 6.1 which has improved support for Linux.

Probably much better, given the improvements on the Swift optimizer, but just goes to show "tracing GC" bad, "reference counting GC" good isn't as straighforward as people make it to be, even if they are renowned developers.

  • It's a cherry picked, out-of-date counter-example. Swift isn't designed for building drivers.

    In reality, a lot of Swift apps are delegating to C code. My own app (in development) does a lot of processing, almost none of which happens in Swift, despite the fact I spend the vast majority of my time writing Swift.

    Swift an excellent C glue language, which Java isn't. This is why Swift will probably become an excellent game language eventually.

    • > It's a cherry picked, out-of-date counter-example. Swift isn't designed for building drivers

      Do you have a counter benchmark? The burden is on you here to disprove the data presented. What that benchmark shows is that you spend A TON of time counting references, much more than tracing GC, unless you enter Swifts C++ networking code. I would think games don’t spend most of their time calling into networking code.

      > In reality, a lot of Swift apps are delegating to C code. My own app (in development) does a lot of processing, almost none of which happens in Swift, despite the fact I spend the vast majority of my time writing Swift.

      So what you’re saying is that any language will be good for gaming since they all can delegate to C?

      > Swift an excellent C glue language, which Java isn't. This is why Swift will probably become an excellent game language eventually.

      What makes swift better at calling C than Java? AFAIK Java has a perfectly good and brand new foreign function interface.

      > This is why Swift will probably become an excellent game language eventually.

      I would take this bet that it won’t. Purely on the sheer fact that gaming occurs on Windows and Swift is barely capable there.

      3 replies →

    • It surely is, according to Apple's own documentation.

      > Swift is a successor to the C, C++, and Objective-C languages. It includes low-level primitives such as types, flow control, and operators. It also provides object-oriented features such as classes, protocols, and generics.

      -- https://developer.apple.com/swift/

      If developers have such a big problem glueing C libraries into Java JNI, or Panama, then maybe game industry is not where they are supposed to be, when even Assembly comes to play.