Better HN
topnewbestaskshowjobs
Log inSign up

cantrelate

3 karma · joined Sep 2, 2024 (2y ago) · 5 submissions

Submissions

comment 1y ago · link · parent

As a side note, Zephyr RTOS (hosted at the Linux Foundation) already supports writing applications in Rust https://github.com/zephyrproject-rtos/zephyr-lang-rust

comment 2y ago · link · parent

Looks like we will get that borrow checker after all :) "The affine type system makes it easier to relocate objects without breaking type safety. Pattern matching, which is safe and expressive, interfaces with the extension’s new choice types. Borrow checking,[borrow-checking] the most sophisticated part of the Safe C++, provides a new reference type that flags use-after-free and iterator invalidation defects at compile time." https://safecpp.org/P3390R0.html

comment 2y ago · link · parent

> So what happens if you just try to work with what you have? Then you basically end up where existing static analysis tools are - they can catch some lifetime/ownership errors, but that's on a best-effort basis an can potentially be very resource-intensive.

Yeah unfortunately.

comment 2y ago · link · parent

> To me it seems like the goal was to be a C++ alternative, not C.

That's probably the reason.

> I think somewhere inside Rust there is a hidden simpler language, with only a tiny subset of its features, but which still has lifetimes

That's exactly the language I would like to upgrade to from C.

comment 2y ago · link · parent

Forget all this drama, I wonder if we can have a Borrow Checker, like the one Rust has, implemented on top of C as an optional feature? And since it's just a compile-time thing, it won't cause any incompatibility or breakage at runtime. I love the idea of having the memory safety features that the Rust compiler offers, but I find Rust unreadable, it hurts my eyes, why do we have to write "let" to define a variable? why did they completely change the syntax if the goal is to be a C alternative!?