this post was submitted on 01 Jul 2024
530 points (93.7% liked)
Technology
60062 readers
3662 users here now
This is a most excellent place for technology news and articles.
Our Rules
- Follow the lemmy.world rules.
- Only tech related content.
- Be excellent to each another!
- Mod approved content bots can post up to 10 articles per day.
- Threads asking for personal tech support may be deleted.
- Politics threads may be removed.
- No memes allowed as posts, OK to post as comments.
- Only approved bots from the list below, to ask if your bot can be added please contact us.
- Check for duplicates before posting, duplicates may be removed
Approved Bots
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Epic fail
Not sure if you are trying to be funny, but if not: enlighten us?
Sure :)
There are a lot of downsides of C++ compared to more modern languages that make it not a great choice if you're starting a web browser from scratch
So tl;dr: a browser but in C++ will take much longer to develop, have fewer features, more bugs, less concurrency and and more security vulnerabilities
Thanks for laying out your concerns. As a C++ developer who does not know the other languages you speak of (I assume Rust, Go), I can agree to some of your points, but also some of them I see differently:
C++ can be complex, because it has a lot of features and especially the newer standards have brought some syntax that is hard to understand or read at times. However, those elements are not frequently used, or if they are, the developer will get used to them quickly & they won't make development slow. As a matter of fact, most development time should be spent on thinking about algorithms, and thinking very well before implementing them - and until implementation, the language does not matter. I do not think that language complexity leads to increased bugs per se. My biggest project is just short of 40k lines of code, and most of the bugs I produced were the classical "off by one" or missing range checks, bugs that you can just as well produce in other languages.
C++ no longer requires you to do manual memory management - that is what smart pointers are for, and RAII-programming.
I can't make a qualified comment on that, due to lack of expertise - you might be right.
You're somewhat repeating point 1) here with slow development. But you raise a good point: web standards have become insane in terms of quantity and interface sizes. Everyone and their dog wants to reinvent the wheel. That in itself requires a very large team to support I would say. As stated for point 1), I do not agree development in C++ has to be slower
True, as someone who just suffered from problems introduced on windows (cygwin POSIX message queues implementation got broken by Win10, and inotify does not work on Windows Subsystem for Linux) I can confirm that while the C++ standard library is not much of a problem, the moment you interface with the host OS, you leave the standard realm and it becomes "zombieland". Also, for some reason, the realtime library implementation on MacOS is different, breaking some very simple time-based functions. So yeah, that's annoying to circumvent, but can be done by creating platform specific wrapper libraries that create a uniform API. For other languages, it appears this is done by the compilers, which is probably better - meaning the I/O operations got taken into those language's core features
I am highly doubtful of people relying on garbage collection - a programmer that doesn't know exactly when his objects come into existence, and when they cease to exist is likely to make much bigger mistakes and produce very inefficient code. The aforementioned smart pointers in C++ solve this issue: object lifetime is the scope of the smart pointer declaration, and for shared pointers, object lifetime expires when the last process using it leaves the scope in which it is declared. For concurrent programming, I do not know if you mean concurrency (threads) or multiple people working on the same project. While multi-threading can be a bit "weird" at first, you have a lot of control over shared variables and memory barriers in C++ that might enable a team to produce a browser that is much faster, which I believe is a core requirement towards modern browsers
As for your tl;dr: definitely not "less concurrency", that makes no sense. The other points may or may not be true, keeping in mind the answers I gave above.
Appreciate you taking the time to reply in such detail! Some good insights thank you
You had some valid points as well - I enjoy a good constructive exchange, thank you! :)
C++ is a very old, extremely complex language. There are arguably objectively better modern alternatives, such as Rust.
I agree that Rust is the way to go, but calling something "arguably" & "objectively" in the same breath is a bit of a paradox innit?
Well, it was more to recognize that there is no inherently better programming languages in theory, they all do the same stuff. And some languages are "better" at some stuff just due to the libraries available and nothing to do with the language itself. But yea I do think Rust is an objectively better language than C++.
Rust is great, but anybody developing something should have the ability to choose whatever programming language they prefer. If you want it made with rust, make it yourself.
Of course, but it still makes sense to think carefully about the advantages of disadvantages of the tools you use when starting any project.
I am not the one who said "epic fail".
Sorry, replied in the wrong comment level apparently.
Not everyone with the knowledge to identify this mistake is in a position to personally correct it. Do you have the time and resources to personally build a browser from scratch? No? Why do you assume a random commenter does?
It doesn't change the fact that Rust is similarly performant and much safer and will thus be faster to develop and less bug-prone. It's not a difficult assessment to make. If you want to explain why they're wrong you can talk about the issue on its merits, but you didn't choose to, presumably because you can't.
Their choice of programming language isn't a 'mistake'. It isn't something that is 'corrected'. It's a development choice, nothing more. That's the point. And if some 'random commenter' doesn't like that choice, that's their problem to fix - not the developers who are actually making the project.
You said they "should have the ability to choose whatever programming language they prefer". I have good news for you.
You have correctly identified that the developers are responsible for their own decisions. They are, you will be very relieved to hear, quite free to make as many poor decisions as they will. Nobody is going to force them to stop.
Other people are more than capable of identifying that those decisions are mistakes. Now, that could be argued with, you could explain how it's not a mistake.
But you haven't. You just said they should be allowed to do it, but nobody was arguing that they needed to be stopped, just that it was a bad decision.
Edit: this person didn't actually say that first quote, but the line of argument proceeded from there, and they did nothing to distance themselves from that point.
I just don’t think it’s fair to tell somebody with over 20 years of experience with C++ that their decision to use C++ in their next project is a ‘fail’.
Learning a new language will probably not be faster than using one you’re already deeply familiar with.
I’m not sure why you’re asking me about the merits of C++ over rust, that wasn’t my point. I was simply advocating for personal choice.
Also, my first sentence was literally praising rust, but I guess I didn’t deepthroat it enough for you to notice? Presumably because you’ve taken the thought of somebody advocating for anything other than rust as a personal attack.
Criticism doesn't take away personal choice though. I don't know why that's hard for people to grasp.
If were just a personal project that they're building entirely on their own then sure, go nuts and do whatever you want. But they're trying to gain adoption, asking for contribution, and wanting to replace other browsers. At that point it's no longer just a personal choice if you're asking the community to invest their time and money into it with you
It originally started as just a fun side project.
But even if it hadn’t, are you suggesting we should no longer start big/community projects in C++?
Picking an unsafe language has the added benefit of distancing yourself from the toxic rust-or-die crowd, who can’t seem to mind their own damn business.
Taken from the wikipedia page on rust:
Four out of five founding companies are evil to the bone, with only Mozilla being somewhat reputable. That does not give me much confidence, sadly.
How am I not surprised?
At least that. However, I don't care enough for the time being to spend my morning on reading what exactly they implemented.
The Rust Foundation very deliberately does not control the development of Rust. There has been issues with the moderation team in the past but I think they're actually resolved today. And let me just assure you that Rust is not the only language project with problems and the fact that they have been talked about and discussed in the open and resolved is a sign of maturity and trust, not a bad thing.
I suppose there are problems in many teams, yes - the majority of humanity is just not mature enough to treat each other professionally :/
Still - 4 out of the 5 founding companies being pure evil does not fill me with confidence :/
The language existed long before the foundation. The foundation is purely there to support the language.
The language choice was because Ladybird started as a component of SerenityOS, which is also written in C++. With this separation, they are free to gradually introduce other language(s) into the codebase, and maybe eventually replace C++ entirely, piece by piece.
In Hackernews thread about this, the head maintainer mentioned that they have been evaluating several languages already, so we'll see what the future brings.
In the meantime, let's try to be mature about it, what do you say?
The dev has 30 years of experience with c++ and a lot of it was on browsers.
He tried to incorporate rust with the help of "JT", one of the original rust designers/devs and according to Andreas it didn't work that well due to the web being too objet oriented or something like that. They both worked together (well, mostly "JT") to create a new safe programming language called "yakt" that transpile to c++, but the project is currently pretty much dead because nobody is really working on it anymore.
The web being too object oriented for rust? Assuming that made sense, who wrote the dang language? If that's true I'm even less confident they know what they're doing then I was before.
You're doubting someone's ability to create a web browser knowing that they specialize in browser development since the early 2000s?
If this isn't enough to have confidence in them then nothing will.
Using my decades of experience in how programming and compilers works and the fact Mozilla has used it to great effect and how it is being used for parts of the Linux kernel.... Yeah just a general statement it doesn't make any sense.
Maybe they aren't effective at designing software with the paradigms of the language or they don't like it but the given explanation doesn't track.
I am pretty sure it was about how it was difficult for them to do oop with rust, but I reckon it was long ago and my programming knowledge is minimal.
Found it:
https://rl.rootdo.com/r/rust/comments/yuxb8a/serenityos_author_rust_is_a_neat_language_but
I vaguely remember the talk about needing oop for the web being on discord and not twitter, so the twitter post is likely a reaction that.
Reading all of that it sounds mostly like a dev who has spent 20 years doing things the C++ way wasn't comfortable learning something new. Like basically they've been using horrible design patterns that Rust bans because they're horrible, and instead of learning better approaches they just say Rust is bad
It could be. But then again, he did have the help of a Rust designer/core dev. I believe they even wrote the first iteration of the "Jakt" compiler in Rust before rewriting it in Jakt itself, so Andreas isn't against using Rust.
So someone who wrote their own functional operating system and browser from scratch which he is now targeting the public with, is not comfortable learning something new?
You are all assuming that the project will be c++ only when the authors haven't said anything about the matter. Who knows if they aren't open to moving to rust? The project is originally in c++, not only but, because that's what the target OS supported. There are examples of other browser moving from c++ to rust (Firefox) who says they can't do the same?
I'm not sure 10 years old are allowed on the internet. Isn't it time for Coco and bed?
I agree that Rust would be an interesting choice for this project but there's a reason why this particular project is done in C++
I wouldn't go around accusing people of being 10 years old when your English skills are worse than a 10 year old's. Glass houses and all that.
English is not my first language. I saw the mistake and left it here. You fixated on that simple mistake instead of answering the main point
Your main (or at least first) point was to throw childish insults around, so you got the same in return
Let's be honest, we both were childish :)
Oh good that settles it, no further questions your honour
Rust or bust
Then build a browser in rust...
Servo exists
That's a web rendering engine, not a web browser application. You need a lot of stuff other than the engine to make a browser.
The engine is where like 95% of the complexity lies though. Maybe more.