News for hackers. Stuff that matters.
Re:Servo announces grant from the NLnet Foundation by wredue on Thursday November 09, 2023 @09:56AM (#38205767)
Possibly memory safe (possibly. Helix, for example, recently had a build that was crashing due to memory safety problems) doesn’t explicitly mean “great security”.
Re:Servo announces grant from the NLnet Foundation by jedisct1 on Thursday November 09, 2023 @10:23AM (#38206138)
Not even memory safe.

It has many "unsafe" and "transmut", and this is without the bazillion external dependencies it also depends on.

Re:Servo announces grant from the NLnet Foundation by jiripospisil on Thursday November 09, 2023 @12:21PM (#38207900)
I mean they currently have 12 unsafes and 4 transmutes (who knows how many in dependencies). I wouldn't say it's many when the code base is clocking at around 53k of Rust. Compared to languages such as C/C++/Zig, which provide no safety at all, it's still an improvement to at least know where to look when address sanitizer is screaming at you (see the bug I linked to in the sibling comment).
Re:Servo announces grant from the NLnet Foundation by wredue on Thursday November 09, 2023 @05:28PM (#38212293)
Both zig and modern C++ have safety that is generally good and catches swathes of issues.

I’ve been writing zig for a couple months now and have only once accidentally leaked in a test, and haven’t once accidentally messed up a buffer.

Not saying you can’t, because zig definitely has escape hatches, but idiomatic zig has proven quite easy to stay safe without even thinking about it.

No. Neither is as pedantic as rust, but zig has been a joy to work in compared to either C++ or Rust in my opinion.

Re:Servo announces grant from the NLnet Foundation by jiripospisil on Friday November 10, 2023 @07:09AM (#38217900)
I agree that there's a lot to like about Zig (the module system and error management are the two I mainly consider superior to Rust's approach for example) but I wouldn't say it's easy to stay safe without thinking about it. Quite the contrary actually.

Rust sometimes forces you to add annotations which certainly can get unwieldy at times (I think this in particular trips a lot people because sometimes they know what they want to tell the compiler but don't know how to express it in Rust speak and thus anger ensues). Zig, on the other hand, doesn't require any of that and makes code look simple and arguably more pleasant in comparison, but it doesn't mean the "contract" between objects goes away. It's just not expressed in code and checked by the compiler but rather by the person writing the code.

Take [0] for example. The compiler (at least in the current stage, it's at 0.11 after all) is perfectly happy with code which returns a pointer to a stack allocated memory from a function. The fix is to remember that you need to pass the argument via pointer and not let the compiler decide for you. But what if the programmer forgets or somebody else is working on the code?

[0] https://github.com/ziglang/zig/pull/17419

Re:Servo announces grant from the NLnet Foundation by jiripospisil on Thursday November 09, 2023 @12:12PM (#38207749)
Are you talking about this? Interesting read and caused by one of the unsafe+transmute the sibling comment is talking about.

https://github.com/helix-editor/helix/pull/7227

Re:Servo announces grant from the NLnet Foundation by wredue on Thursday November 09, 2023 @01:06PM (#38208480)
It was recent. I just updated to Sonoma and then after recompiling everything, helix was crashing whenever I switched modes due to reading past the buffer.

Sorry I can’t be any more help on specifics than that. I am WAY beyond fiddling with my tools when they give me trouble. I just moved back to neovim.

Re:Servo announces grant from the NLnet Foundation by slikrick on Friday November 10, 2023 @09:30AM (#38219301)
if you don't have time to look into it then you shouldn't just blindly spout incorrect information, just saying.