Live data from Hacker News

Ladybird browser to start using Swift language this fall

twitter.com

11–20 of 205 posts

Re: Ladybird browser to start using Swift language this fall

#11
post #4

I would have thought that Ladybird would be using a language that specifically guarantees memory safety which is Rust. But Swift is a very surprising choice but actually makes sense for a browser. The browser story is not great for Rust as we can only point to Servo which isn't ready to be used as a daily driver for millions of users. But Arc Browser is written with a combination of Swift and C++ to run on macOS and…

Swift is memory safe.

The C++ interop thing I think is massive. But isn’t there also the problem that with Rust you can’t have the equivalent of shared pointers, so you can only have a single reference to one object (sorry I don’t really know Rust, just going from how this has been described to me) which apparently makes representing things like DOMs and abstract syntax trees an absolute nightmare?

Re: Ladybird browser to start using Swift language this fall

#12
> Support for non-Apple platforms is also improving, as is the support for other, LSP-based development environments.

Improving, as in ready now or still far in the future?

What does the current state of Swift look like for Linux and Windows? And how well does the LSP server function today?

Re: Ladybird browser to start using Swift language this fall

#13
post #7

============================== Andreas Kling @awesomekling · 44m My general thoughts on Rust: - Excellent for short-lived programs that transform input A to output B - Clunky for long-lived programs that maintain large complex object graphs - Really impressive ecosystem - Toxic community ==============================

I wouldn't say all the Rust community is toxic. Then again, I'm not sure which Rust community he's referring to, I'm sure there are some toxic ones out there.

Re: Ladybird browser to start using Swift language this fall

#14
post #3

One thing I don't understand about Swift is why it uses a private fork of LLVM. Why can't they upstream whatever changes they need?

Because the same also applies to clang, and contrary to what people think, Apple like every other big tech, is only as nice to FOSS as they need to be for their own purposes. Same applies to all C and C++ compiler vendors, that have replaced their proprietary compilers (there are plenty more than just clang/gcc/msvc), with LLVM. Such is the freedom of Apache/MIT/BSD style licenses.

Swift's LLVM fork is open-source, just not upstreamed. No Free Software license requires forks to upstream their changes.

https://github.com/swiftlang/llvm-project

Re: Ladybird browser to start using Swift language this fall

#15
post #4

I would have thought that Ladybird would be using a language that specifically guarantees memory safety which is Rust. But Swift is a very surprising choice but actually makes sense for a browser. The browser story is not great for Rust as we can only point to Servo which isn't ready to be used as a daily driver for millions of users. But Arc Browser is written with a combination of Swift and C++ to run on macOS and…

> specifically guarantees memory safety which is Rust

I think you mean "one of which is Rust".

Re: Ladybird browser to start using Swift language this fall

#16
I had suspected this would happen, I haven’t got into Swift yet (I’m mostly doing embedded C still) but Swift finally seems to have just ticked off some niggles that makes it a much stronger contender. Things like not having official Debian builds (there were Ubuntu etc.), not being able to run under other C libraries like musl (like if you want to run in Alpine Linux containers), not really being able to run embedded etc. basically all being fixed in the last release (or starting the process, like with the embedded subset). Add in the newish C++ interop and it does seem much more attractive now as a pin ergonomic, memory safe, cross-platform language at all levels of the stack!

(This is of course by design, Apple intend to use Swift from everything from firmware of things like the Secure Enclave chip, through to the kernel, through to all the apps, but to be able to bring it in gradually with the interop, so not having to rewrite everything from scratch).

Re: Ladybird browser to start using Swift language this fall

#17
post #12

> Support for non-Apple platforms is also improving, as is the support for other, LSP-based development environments. Improving, as in ready now or still far in the future? What does the current state of Swift look like for Linux and Windows? And how well does the LSP server function today?

I can’t speak to the current state of swift on other platforms directly/in detail. But I would point to the Arc browser being built using swift for both the windows and MacOS versions. They’ve also open-sourced a number of tools they built to make that work

https://github.com/thebrowsercompany

Re: Ladybird browser to start using Swift language this fall

#18
post #7

============================== Andreas Kling @awesomekling · 44m My general thoughts on Rust: - Excellent for short-lived programs that transform input A to output B - Clunky for long-lived programs that maintain large complex object graphs - Really impressive ecosystem - Toxic community ==============================

I wouldn't say all the Rust community is toxic. Then again, I'm not sure which Rust community he's referring to, I'm sure there are some toxic ones out there.

It doesn't matter if only a portion is toxic, because that portion can easily poison the well all on their own for everybody.

Re: Ladybird browser to start using Swift language this fall

#19

One thing I don't understand about Swift is why it uses a private fork of LLVM. Why can't they upstream whatever changes they need?

Because Apple does not direct the LLVM project, and they have their own corporate designs and plans. I'm sure they upstream what changes they think will be accepted, but there's no guarantee upstream would accept what they want or need let alone on the timeline they need it.
Post reply on HN