3 ms·
With decades and decades of memory safety lessons in the books, it's hard to imagine how C++ was the language of choice when starting new browser from scratch i
by kavefish 1y ago
With decades and decades of memory safety lessons in the books, it's hard to imagine how C++ was the language of choice when starting new browser from scratch in 2018.
- ironmagma 1y agoAnswer is here, although the article is outdated and the most recent news is that they are rewriting the browser at least in Swift. https://awesomekling.github.io/Memory-safety-for-SerenityOS/ https://awesomekling.github.io/Memory-safety-for-SerenityOS/
- kragil 1y agoHow is it outdated?? Their GitHub has 0,3% Swift code. They said they start once Swift 6 is out. It has been out for months. So either they abandoned Swift or haven’t really started or they are really really slow to start using it. All three options are against the article being outdated, wouldn’t you agree?
- ironmagma 1y agoBecause the article is from 2022 and says that they will use a custom language called Jakt which didn't pan out, it seems. Yes, I am also eager for the Swift rewrite to get off the ground.
- pjmlp 1y agoMostly because the author switched focus to yet another language, and eventually decided to focus on something else instead of programming languages. https://github.com/sophiajt/june https://github.com/sophiajt/june
- circl_lastname 1y agoCurrent blockers to swift usage are found here: https://github.com/LadybirdBrowser/ladybird/issues/933 https://github.com/LadybirdBrowser/ladybird/issues/933 Rising tide lifts all boats, by trying to use Swift seriously, they're finding and helping fix bugs in the compiler
- favorited 1y agoOne of the primary Ladybird devs just gave a lightning talk at CppCon about porting their HTML parser from C++ to Swift. https://www.youtube.com/watch?v=KCRx1jE6DnY https://www.youtube.com/watch?v=KCRx1jE6DnY
- pjmlp 1y agoOne would think the same of C, where exploits trace all the way back to Morris worm in 1988, that is 36 years of thinking the problem are the developers, not the language, with new projects being started every day still. At least C++ has mechanisms to write safer code, provided one makes use of them, even if still there are issues. To use a modern example renaming the JavaScript file extension to a Typescript one, only gets you so far. Then one can make use of Typescript's type system, or switch to Elm to the next level.
- pessimizer 1y ago> One would think the same of C I'm pretty sure that everyone does and did, because almost nobody wrote a browser in C either, never mind in 2018. NetSurf from 2002 is the only one I can find? edit: I should say after the first set, because Lynx and Mosaic are C.
- Jaxan 1y agoWhen they started, the plan was mostly to have fun and see how far you can get when creating an OS from scratch. So picking a language in which they are experienced makes sense in that context.
- circl_lastname 1y agoThe browser was not started with the idea of taking over the main focus of development, it was just another part of an already pretty large hobby OS project
- yencabulator 1y agoFine. With decades and decades of memory safety lessons in the books, it's hard to imagine how C++ was the language of choice when starting new operating system from scratch in 2018.
- adamrt 1y agoIt really isn't that hard to imagine someone starting a fun hobby project in the language they enjoyed and were the most comfortable with.
- yencabulator 1y agoDunno. It really is. Debugging memory corruption bugs in complex one-memory-space systems is very much not fun.
- circl_lastname 1y agoNothing a little printf (or dbgln as it is known as in Serenity-Ladybird land) can't fix