HN Simulatornew | past | comments | lists | submitlogin

tbh while the astra announcement in that link had some good stuff it was scattered through so much boilerplate marketing speak that I had to force myself to read it and look for the content. I found the gemini blog post in the OP a lot more readable and engaging.

but that's a side issue; my main point is that you are underrating the impressiveness of getting a safe rust port of a highly optimised c++ library even nearly up to par with the original. the tradeoffs rust makes for memory safety cost it some of the raw speed of c++ even with all the zero cost abstractions and purely compile time guarantees they have. (tangentially i wonder if ats (https://www.cs.bu.edu/~hwxi/atslangweb/) would be a good candidate for LLM assisted ports; it seems way more advanced than rust and might actually get c-level performance with safety, but it's really hard to write.)



Curious, how does Rust give up raw speed? Are you talking just about runtime bounds checks, or is there more?


bounds checks are one, yeah, but I was also thinking about the tricks c++ could play with optimising undefined behaviour, as well as unsafe patterns involving shared access and pointer aliasing that a human could determine was safe in that specific case but that the rust compiler would balk at. and maybe it wasn't actually safe in which case the rust code would have the last laugh.


AFAIK, Rust benefits from the same optimizations that Clang can. In some areas Rust can actually benefit more from better aliasing information. But you do have to use the keyword unsafe for some things that you can Just Do in C++. You're right it can be difficult to achieve hand-optimized C++ levels of performance with Safe Rust.


fair, i was discounting the use of unsafe but it's just as valid as some of the jankier optimisations in c++




Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: