Live data from Hacker News

Ladybird browser to start using Swift language this fall

twitter.com

101–110 of 205 posts

Re: Ladybird browser to start using Swift language this fall

#101
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 ==============================

Choosing between Rust or Swift is a false dichotomy. Switching programming language (or game engine) mid-course is a well known suicidal move. Who is asking them to use a different programming language? I am not a C++ fan, but it is a lot less risky to stick to it than switching, and this is true for any large projects ran by experts.

It was probably a condition of getting funding.

In the NGO world using or funding greenfield C/C++ is a great way to make yourself a social pariah I bet.

A corporation wouldn't care, because they're driven by what makes dollars and cents.

But in non-profits (which Ladybird chose to be part of) it's all about ideology.

The only way to get an exemption is if you're doing AI which he isn't.

Re: Ladybird browser to start using Swift language this fall

#102
I did wondered how long would it take for a Rust zealot to take over this thread, it is already ongoing...

That being said, this is a rather odd decision. Why would you go so much out of your way to add yet another compiling stage, yet another language that, far as I can tell, is not getting much traction in this space?

Re: Ladybird browser to start using Swift language this fall

#104
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…

> I would have thought that Ladybird would be using a language that specifically guarantees memory safety which is Rust. Rust isnt the only compiled language that provides memory safety by default. Swift does as well.

Does Swift enforce memory safety in concurrent code also, i.e. preventing thread-unsafe data access in safe code? That's a really hard problem that Rust tries to address mostly successfully, and many other languages don't.

Re: Ladybird browser to start using Swift language this fall

#105

For those who are worried, Andreas is a thoughtful dude. This decision was not made on a whim. Also, they’re not doing a massive rewrite: > The Swift team is also investing heavily in C++ interop, which means there's a real path to incremental adoption, not just gigantic rewrites. To me, the Tweet does a good job justifying the decision. I’m rooting for Ladybird, and I hope this decision pays off. A modern browser in…

I strongly disagree. This is not a justified decision, they just feel like it based either on vague and speculative reasons, or because they are funded to do so, I would not be surprised if they had discussions with the Swift marketing team.

Then build your own browser in Rust, start contributing to Servo, and who cares when a volunteer writes a browser in any language?

Write a browser in COBOL for all I care. If it’s open source, it’s still a gift.

Re: Ladybird browser to start using Swift language this fall

#106

I know Andreas is a prolific coder, but this seems weird to have a pretty functional (but far from complete) browser written in C++ and then casually say, eh, "We are going to rewrite it in another language" in the same way one might say "We've decided to change the branding logo"? I know that is a run-on sentence, but I need to get my exercise.

Depends on the approach. There's an odd benefit to C++ being the starting language; C++ is ancient and because of that you can make it interop with most other languages; in this case, the switch to Swift will probably simply mean replacing C++ modules (likely starting with the ones that cause the most memory bugs) with Swift modules and gradually switching things out since Swift has C++ interop[0].

It's less a "rewrite from the ground up" and more a "this is the main language we'll be using from now on".

As for the reason to stop using C++; honestly what reason isn't there by now. The only reason to still use C++ in this day and age is if you're targeting very non-standard hardware or are developing videogames. The language is memory unsafe in a way that almost every other language isn't (like, even if you don't pick a language with an overly worrywart borrow checker, C++ is remarkably worse at memory management), the standard library is awful and it's stuck with the chain and ball of being a superset of C on it's leg, meaning that every reason why you wouldn't use C also applies to C++ (minus the "C isn't OOP" one).

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

Re: Ladybird browser to start using Swift language this fall

#107

Earlier quoted context omitted.

Choosing between Rust or Swift is a false dichotomy. Switching programming language (or game engine) mid-course is a well known suicidal move. Who is asking them to use a different programming language? I am not a C++ fan, but it is a lot less risky to stick to it than switching, and this is true for any large projects ran by experts.

C++ is a loaded gun, strapped to your body and aimed at your foot, with infinite bullets automatically firing every second, that requires you to constantly exert 25 lbs of force to tilt the gun and avoid hitting your foot. Most of the time, you’ll be successful. However, nobody seeing your plight would be shocked if your foot eventually gets blown up. To claim this state of affairs is just fine because you’ve done it…

Well, there are indeed many ways to shoot yourself with C++, this is why having C++ experts on the team is a good thing. They are supposed to know how to avoid the traps and avoid being lured into the worst parts of C++ and OOP design style.

I have seen very good C++ projects using only the minimal amount of bullshit features, Omar Cornut's Dear Imgui comes to mind as an example.

As Swift beginners, they are less likely to avoid the bad idioms, but this is the kind of thing you only discover late, when the codebase is large enough.

Re: Ladybird browser to start using Swift language this fall

#108

I know Andreas is a prolific coder, but this seems weird to have a pretty functional (but far from complete) browser written in C++ and then casually say, eh, "We are going to rewrite it in another language" in the same way one might say "We've decided to change the branding logo"? I know that is a run-on sentence, but I need to get my exercise.

I don't think this is a complete rewrite, though. Swift is specifically being picked for C++ interop so they can use their existing code. Andreas has stated from the start that any new language chosen has to consider an incremental approach of adoption into their codebase.

Re: Ladybird browser to start using Swift language this fall

#109
post #89
post #55

Earlier quoted context omitted.

As someone that likes Rust, but is decades away from the days I identified myself with any specific language, the Rust Evangelism Strike Force are the ones that spoil the party. That is exactly the way to put off people, that initially could even be welcoming to hear about what the language is all about.

> Rust Evangelism Strike Force I realize this is not what people generally are referring to when they complain about the Rust community, but this is the part that annoys me. Feels like every damn day I see people preaching the Good News of Rust, pointing to things as being the unique and sole property of their preferred language. Except those things have been around for ages, in other languages. Memory safety? Invent…

> Golang Evangelism Strike Force

Concurrency? Invented by Go! (quickly corrected by Elixir/Erlang strike force, but these, just like Golang, have worse throughput than a particular C family language I have a soft spot for).

Apologies, could not help myself as this response is amusing if sadly accurate (I do like Rust, but blind hostile evangelism tends to create the opposite to the desired outcome).

Re: Ladybird browser to start using Swift language this fall

#110

Earlier quoted context omitted.

It's not specific to Rust at all, I remember hearing the same kind of talks when learning Java because I found OOP confusing. And in fact most people saying that are right: most of the time people complain about stuff because they haven't internalized how it's suppose to work (as I was). Don't get me wrong, there are plenty of valid criticism of Rust or Java (and OOP in particular), but at the same time in practice m…

> It's not specific to Rust at all, I remember hearing the same kind of talks when learning Java because I found OOP confusing. You're right, but that doesn't excuse it. And most languages don't have this as their first bullet point in their code of conduct >We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender identity and expression, sexual orien…

> the leaders of the Rust community should do something about it.

You should read the reaction of the Rust community leaders to the quoted article, and you'll see that they share your opinion that something must be done.

At the same time when you have people in the community saying politely and cheeringly that “you'll get over it when you've internalized the rules” what are you supposed to do as a mod? It obviously doesn't infringe the code of conduct even though it seems to have offended the author of the article.

Also, when what the people get pissed of about a community is “they don't want to admit it doesn't work” it's had to say that the toxicity is “people are still experiencing toxicity on the level of other communities that don't have a code of conduct”, by any means…

The goal of a CoC is to make sure nobody gets bullied or harassed, not that nobody will ever get annoyed by other people. You can't make sure you don't have idiots in your community, all you can do is making everyone behaving in a civil manner, which is already hard enough.

Post reply on HN