3 ms·
A good reason is that if you want interop with other languages, C is still the lingua franca of ABIs. All scripting languages have a way to interact with C thro
by antoinealb 6y ago
A good reason is that if you want interop with other languages, C is still the lingua franca of ABIs. All scripting languages have a way to interact with C through some form of FFI mechanism. I guess you could write it in Rust and maintain C bindings to it, but that would be painful.
- rapsey 6y agoThe rust based cloudflare implementation has C APIs. Also C bindings to rust libs are not that painful at all to maintain.
- tlamponi 6y agoNot really. We wrote a content-addressable-storage backup solution in rust[0], and one consumer is QEMU for doing backups of VMs, so we expose C bindings of our rust code[1] and use them in QEMU[2], effectively having rust async stuff handled by QEMU co-routine library. It wasn't exactly complicate or the like, required a bit of "plumbing code" but that's OK. Allowing to get (relatively) easy C bindings is a goal and feature of rust, at least the project itself provides and maintains the rust-bindgen crate[3][4]. Having a bit bigger and slightly complex project like a backup server done in rust is such a relief compared to C or similar languages. Good speed, fast start up times like C but refactoring is really a breeze lots of safety is guaranteed and more time can be spent on fixing the semantic bugs. [0]: https://pbs.proxmox.com/docs/introduction.html#introduction https://pbs.proxmox.com/docs/introduction.html#introduction [1]: https://git.proxmox.com/?p=proxmox-backup-qemu.git;a=summary https://git.proxmox.com/?p=proxmox-backup-qemu.git;a=summary [2]: https://git.proxmox.com/?p=pve-qemu.git;a=blob;f=debian/patches/pve/0028-PVE-Backup-proxmox-backup-patches-for-qemu.patch;h=cb8334ee34006851fdf5b7b5c8e5f2586719e785;hb=HEAD#l312 https://git.proxmox.com/?p=pve-qemu.git;a=blob;f=debian/patc... [3]: https://github.com/rust-lang/rust-bindgen https://github.com/rust-lang/rust-bindgen [4]: https://rust-lang.github.io/rust-bindgen/ https://rust-lang.github.io/rust-bindgen/
- antoinealb 6y agoInteresting, I stand corrected!