Better HN
topnewbestaskshowjobs
Log inSign up

oneup2

3 karma · joined Mar 8, 2025 (1y ago) · 1 submissions

Submissions

comment 1y ago · link · parent

I feel like this is kind of obvious. Plenty of people write C or C++ and then optimize some low-level function using hand coded assembly. Even the author seemed to suggest they couldn't get their C compiler to do what they wanted so they bailed and hand wrote assembly. How is this any different from rust?

I'd expect the same for rust. You make a safe higher level API. It validates all the inputs and then calls into the private "unsafe parts" implemented in C or assembly. Hopefully you've put enough validation in the high level API so that it will be unlikely to call the low-level API in a way that breaks.