3 ms·
Sorry to be "that person", but have you tried Rust yet? It checks a lot of your boxes: - Access and control, nothing "behind your back" - Low or high level, a
by Georgelemental 4y ago
Sorry to be "that person", but have you tried Rust yet? It checks a lot of your boxes:
- Access and control, nothing "behind your back"
- Low or high level, as you prefer
- Swap in different implementations (custom allocator, different async runtime, etc)
- Really powerful macros
- Strong conventions, safe by default (but you can break them, go into the weeds if needed)
Downsides compared to your list:
- More complex than C or Go (though less than C++)
- Only one production compiler, and everyone assumes `cargo` build system (though both are very good)
- Library ecosystem not quite as extensive (though there is a lot of good stuff on crates.io, and you can always write bindings to C)
The little things that seal the deal:
- Enums (tagged unions without the danger or boilerplate)
- Zero-cost closures
- Incremental compilation
- "If it compiles, it probably works"
- Standardized documentation via `rustdoc`
- Module system
- _benj 4y agohehe! It's ok to be "that person" :) Yes, I've tried rust and have even shipped some project with it! I think the things that didn't worked for me was the complexity. It felt like I had to keep a lot of things in mind to be effective, (traits can be a bit obscure, i.e. magic IMHO), also lifetimes and Option made the code complex by either having a bunch of math or .unwrap all over the place. With that said tho, Rust would be one of my top picks for a professional setting or a codebase that I share with a team, because of the really good defaults that it has! I read once somebody comparing the Rust compiler with a bunch of tiny unit tests that the developer doesn't have to write, and I agree with that! With C tho, for personal stuff I can do things that I've never do professionally (i.e. use the OS as my GC because when the process dies the OS is gonna "free" my memory allocations anyways! I know, terrible, but I'm having fun! ¯\_(ツ)_/¯)