[–] ted_dunning 9 hours ago
[–] bootsmann 9 hours ago
[–] Groxx 7 hours ago
[–] pjmlp 9 hours ago
[–] fpoling 6 hours ago
[–] pjmlp 5 hours ago
Yet one still needs to account with processes like MISRA to account for safety.
[–] fpoling 6 hours ago
[–] treyd 10 hours ago
After a few rounds of this though it might end up seeming like it's not worth the hassle and it's easier to build the whole application in Rust.
[–] vatsachak 10 hours ago
[–] treyd 10 hours ago
[–] vatsachak 10 hours ago
For example,
- A field in a struct cannot borrow another field so now you'd have to create two structs. I guess you could write an impl to borrow that field instead of storing the borrow.
- In simulation software I wrote I found that mimalloc does just as good as bumpalo (within 5%) so carrying a bump everywhere was useless. Not really a rust issue but rather a loss of faith in manual memory management for me.
- Eventually over time you start adding Arc<Fn(Blah)->Foo> everywhere and Box, Arc and friends start coming in. But you can't have cyclical references there so you have to use Weak. And you have to use OnceCell or LazyCell or LazyLock for things that should run at start time.
Rust is really great for the crates, but ...
For applications which are not absolutely performance critical and cannot* be stated pretty easily in linear logic + clone + drop you can get away with Haskell
[–] Mawr 9 hours ago
[–] hoppp 10 hours ago
I don't see much point in choosing a language just to bypass it's features.
[–] cpgxiii 10 hours ago
Given the issues involved in mixing languages, there can be cases where sticking with one "good enough" GC'd language and having to write a few performance-sensitive parts in very unidiomatic form to minimize/eliminate GC work is preferable.
The OP article here is nice because it allows selective enforcement of allocation free code. If you have code that has some discipline about heap allocation such as having all small allocations then you are OK on the fragmentation front.