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

Yeah but the C toolchain is a huge pain, and makes things like cross-compiling and compiling to WASM harder. It's really nice if you can keep your program pure Rust.

Go has similar characteristics.



Go is in a much worse situation here since the toolchain doesn't give you any help with C dependencies.

In Rust you can mostly just wrap the C library as a crate and the end developer doesn't need to care very much. If you want to use their system headers then you need to let them know, but that's not an issue if the headers are bundled. Cargo knows how to absorbs any C-built object files into the final binary and it just works.

In Go, in every scenario, the end developer needs to go through the effort of managing all the necessary the cgo calls when any of their dependencies use C libraries, the whole way up the dependency tree. It's really really not supported.


> compiling to WASM

I thought Rust was supposed to be a systems language?


It is. And you can compile it to WASM.




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

Search: