Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Use Rust if you want to write in a memory safe, high performance language.

> Zig's value prop is different and closer to a modern C: it fits in your head and it maps fairly closely to assembly.

This can't be correct for the simple reason that it has both a modern optimizing compiler (LLVM) and UB.

A modern compiler will try to autovectorize your code, so you don't really know what the assembly will be.

UB gives compiler license to rewrite your code however it sees fit.



> A modern compiler will try to autovectorize your code, so you don't really know what the assembly will be.

Looking at what the compiler actually did is an ancient tradition. I’ve even done it with Java. Seeing five virtual calls with bounds checking all over get turned into a single load instruction has to be seen to be believed.




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

Search: