logoalt Hacker News

meiseltoday at 12:43 AM8 repliesview on HN

Why did Ladybird even attempt this with Swift, but (I presume) not with Rust? If they're going to go to the trouble of adding another language, does Rust not have a better history of C++ interop? Not to mention, Swift's GC doesn't seem great for the browser's performance.


Replies

mlinksvatoday at 12:49 AM

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."

show 2 replies
diathtoday at 1:49 AM

> Why did Ladybird even attempt this with Swift, but (I presume) not with Rust? I

Probably the same reason why Rust is problematic in game development. The borrow checker and idiomatic Rust do not go well together with things that demand cyclic dependencies/references. Obviously there are ways around it but they're not very ergonomic/productive.

jll29today at 1:21 AM

Andreas Kling said Rust lacks OO, which he says is useful for GUI coding.

He even made an attempt at creating his own language, Jakt, under SerenityOS, but perhaps felt that C++ (earlier with, now without Swift) were the pragmatic choice for Ladybird.

show 1 reply
lukehtoday at 12:50 AM

Swift actually has excellent C++ interop [1] (compared to other languages, but, I guess, not good enough for Ladybird).

[1] https://www.swift.org/documentation/cxx-interop/

show 1 reply
password4321today at 1:19 AM

It will be interesting to see any further justification; I believe Rust was rejected previously because of the DOM hierarchy/OOP but not sure IIRC.

20240810 https://news.ycombinator.com/item?id=41208836 Ladybird browser to start using Swift language this fall

bergheimtoday at 12:57 AM

I so wholeheartedly agree. You are making a new web browser - akin to a new OS - and you want it open source for everybody but you choose swift not rust?

show 1 reply
carefree-bobtoday at 1:09 AM

The ladybird developers tried Rust and Swift both and voted to adopt Swift.

elcritchtoday at 1:42 AM

Also I believe one of the core LadyBird devs was an ex Apple employee on WebKit which has been using Swift as well.

show 1 reply