"Swift as C++ Successor in FoundationDB" by Konrad Malawski (Strange Loop 2023)

Поділитися
Вставка
  • Опубліковано 5 жов 2024
  • Programming languages often prioritize either performance or ergonomics. Swift offers a unique modern type-safe low-ceremony approach taking the best of both worlds that scales from mobile apps to high-performance systems where previously memory-unsafe languages would be used. It also interoperates seamlessly with C and C++.
    In this talk, we show how we successfully adopted Swift in FoundationDB, a distributed database struggling to modernize its C++ codebase. Swift's interoperability features allowed the team to incrementally move single functions, or entire types, to Swift. This transition was done without generating any bindings and while preserving the existing semantics.
    FoundationDB uses a custom actor runtime, which enables reproducible simulation testing. Again, Swift's flexible concurrency and distributed actor model enabled an incremental side-by-side approach by having Swift concurrency seamlessly execute on the existing scheduling infrastructure.
    Konrad Malawski
    Swift Team, Apple
    @ktosopl
    Konrad works in the Swift team at Apple, where he focuses on foundational server-side Swift libraries and concurrency features of the language. He was part of the design and implementation of Swift’s structured concurrency and actor model, as well as the distributed actors language feature and cluster library. He also maintains server-side observability libraries for logging, metrics and distributed tracing. Previously, he worked on Akka at Lightbend/Typesafe, where he maintained core pieces of the ecosystem, including the clustering, event sourcing, streaming and HTTP libraries. He also made significant contributions to the reactive-streams specification and TCK which later became the foundation of the JDK’s java.util.concurrent.Flow types.
    ----
    Recorded Sept 21, 2023 at Strange Loop 2023 in St. Louis, MO.
    thestrangeloop...

КОМЕНТАРІ • 17

  • @lwouisYT
    @lwouisYT 11 місяців тому +12

    Great presentation, thank you!

  • @mooncop
    @mooncop 11 місяців тому +6

    glad that swift successors keep coming, despite some initial setbacks! 🦆+ 1

  • @gofudgeyourselves9024
    @gofudgeyourselves9024 11 місяців тому +13

    Rust language founder also worked on swift

  • @funkijote
    @funkijote Місяць тому

    Wow really great talk! I’m coming from a JS/TS background and this was really helpful in understanding some things about both C++ (a language I’ve only a cursory understanding of) and Swift (same level), and just systems programming language concepts in general.

  • @guyor4761
    @guyor4761 11 місяців тому +7

    The backtrace support is very impressive

  • @Ch0rr1s
    @Ch0rr1s 11 місяців тому +12

    I love that talk.
    i never had any contact with swift - mostly because it was "apple app language" in my mind.
    interesting. Maybe i have to give it a try.
    but i also kinda feel like Konrad may take over the world until then :D

    • @evoboy67
      @evoboy67 11 місяців тому +6

      I recommend learning Swift, at least play with it and get to know some of the language concepts and decisions in Swift. It’s pretty neat IMHO, from things like progressive discourse and safety by default to having clear and easy distinction between reference and value types and semantics, abstract generic algorithms and protocol oriented programming. Swift and Rust have many things in common, e.g safety by default, but some key decisions in the Swift Language make it so much more expensive while reducing complexity compared to Rust, e.g an easy foot gun is accidentally creating leaky abstractions. It’s worth to mention my bias, my nerdy heart finds it rather beautiful language ❤ just take a look at the standard library, e.g protocols like Sequence and Numeric

  • @AdrianBoyko
    @AdrianBoyko 11 місяців тому +6

    Predecessor language is C or C++? Are they forbidden to mention Objective-C?

  • @robchr
    @robchr 9 місяців тому +3

    Are they using Swift in the Kernel?

  • @chovuse
    @chovuse 11 місяців тому +1

    Nice presentation. But the code Syntax could have been larger.

  • @guyor4761
    @guyor4761 11 місяців тому +1

    22:55 I like the rust lingo better - impl Trait for Struct

  • @michaelnajera7958
    @michaelnajera7958 11 місяців тому +22

    “[swift] is equally supported on other platforms” that is not entirely accurate.

    • @encapsulatio
      @encapsulatio 10 місяців тому +6

      Can you elaborate? Just how worse is developing in Swift on Linux? What about successfully cross compiling Sift software on Windows, Linux, Android?

    • @marcinkliks6522
      @marcinkliks6522 9 місяців тому +14

      It has the same release train for all platforms and they all receive all the patches. There are some differences between platforms but it’s not a big deal imo

  • @Morimea
    @Morimea 11 місяців тому

    12:58 "lets talk little bit about language model" - flashbacks

  • @jp263
    @jp263 8 місяців тому +2

    C++ interop seems simpler than C (which i think requires an ObjC bridge?)