5 ms·
Can this be used/adapted for Rust too?
by nikivi 4y ago
Can this be used/adapted for Rust too?
- inglor 4y agoWhy would rust even have this problem? Rust has native "extern "C"" blocks and good FFI. The issue in Go is that goroutines run on small stack and C code has no way to know of that or increase the stack size - so Go's C calling facility (cgo) has to go through a thread and a proper stack. There are some wild assembly hacks to go around it ^^
- nikivi 4y agoI meant calling Rust from Go.
- inglor 4y agoOh then sure, I don't see why you couldn't use it with something like https://github.com/mediremi/rust-plus-golang https://github.com/mediremi/rust-plus-golang
- emidoots 4y agoThis project isn't really about calling C functions, Go already supports that after all (CGO). Rust does suffer the same problem, which is that cross-compilation when using C code is a bit of a nightmare. purego solves this by using dlopen and friends. My understanding is Rust solves this through libloading (same approach effectively) and more heavy-handed approaches like cross-rs which distribute full C/C++ build toolchains for each target (in Docker images or something?)