Comment by mlinksva

6 days ago

https://x.com/awesomekling/status/1822236888188498031 https://x.com/awesomekling/status/1822239138038382684 "In the end it came down to Swift vs Rust, and Swift is strictly better in OO support and C++ interop."

Did they consider using Nim? It has great C++ interop, OO and same ARC memory management as in Swift.

> In the end it came down to Swift vs Rust, and Swift is strictly better in OO support and C++ interop

Why not D?

  • Why not rust? It's popilar, in wide adoption, with wide support, without the baggage of C++. What'e the downside?

    • Well they already chose Swift over Rust because they said:

      > Swift is strictly better in OO support and C++ interop

      So I guess from their point of view that’s why not rust.

      I don’t have a horse in the race.

      I was genuinely interested in why they didn’t even consider D given they already ruled out rust for those particular reasons, for which it seems D would fulfill nicely.

> Swift is strictly better in OO support and C++ interop

Fascinating.

They've shown the idea it is better on C++ interop is wrong.

I don't know enough to say Rust has same OO support as Swift, but I'm pretty sure it does. (my guess as a former Swift dev: "protocol oriented programming" was a buzzy thing that would have sounded novel, but amounted to "use traits" in rust parlance)

EDIT: Happy to hear a reply re: why downvotes, -3 is a little wild, given current replies don't raise any issues.

  • Rust has straightforward support for every part of OOP other than implementation inheritance, and even implementation inheritance can be rephrased elegantly as the generic typestate pattern. (The two are effectively one and the same; if anything, generic typestate is likely more general.)

    • > Rust has straightforward support for every part of OOP other than implementation inheritance

      Except the only thing that makes OOP OOP: Message passing.

      Granted, Swift only just barely supports it, and only for the sake of interop with Objective-C. Still, Swift has better OO support because of it. Rust doesn't even try.

      Not that OOP is much of a goal. There is likely good reason why Smalltalk, Objective-C, and Ruby are really the only OOP languages in existence (some esoteric language nobody has ever heard of notwithstanding).

      19 replies →

    • I think we have seen enough since the best example of a Rust browser that is Servo, has taken them 14 years to reach v0.0.1.

      So the approach of having a new language that requires a full rewrite (even with an LLM) is still a bad approach.

      Fil-C likely can do the job without a massive rewrite and achieving safety for C and C++.

      Job done.

      EDIT: The authors of Ladybird have already dismissed using Rust, and with Servo progressing at a slow pace it clearly shows that Ladybird authors do not want something like that to happen to the project.

      7 replies →

  • They demonstrated that swift's c++ interop isn't good enough, but does it follow that rust's is better? Genuinely asking, as I don't have experience with that. I would imagine that if they rejected it for that reason originally they forsaw even more severe issues.