Various experiments and demos relating to Golang talking to Rust via CGO. This gave me a good excuse to mess around with SHM_GET, SHM_OPEN, MMAP, and mkfifo.
- (DONE) Generate header from Rust API
- (DONE) Generate CGO from previously-generated header
- (DONE) Go calls Rust through CGO and streams bytes using FIFO file (named pipe)
- (DONE) Go calls Rust through CGO, sharing memory (uses SHM_OPEN + MMAP)
- (WIP) Go allocates slice in C heap, copies from Go heap and passes pointers to Rust
- (WIP) Go calls Rust through CGO and streams bytes over TCP socket
- Go buy a Mac: https://apple.com
- Install Rust:
curl https://sh.rustup.rs -sSf | sh
- Install Golang: https://golang.org/dl/
- Install c-for-go:
go get github.com/xlab/c-for-go
- This software has been tested with OSX only
To build and run demos:
cd hasher && make ; cd ..
go run main.go