alxp12 / cgo-rust-ffi

Various experiments and demos relating to Golang talking to Rust via CGO

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cgo-rust-ffi

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.

Examples

  1. (DONE) Go calls Rust through CGO and streams bytes using FIFO file (named pipe)
  2. (DONE) Go calls Rust through CGO, sharing memory (uses SHM_OPEN + MMAP)
  3. (WIP) Go allocates slice in C heap, copies from Go heap and passes pointers to Rust
  4. (WIP) Go calls Rust through CGO and streams bytes over TCP socket

Tools

  1. Go buy a Mac: https://apple.com
  2. Install Rust: curl https://sh.rustup.rs -sSf | sh
  3. Install Golang: https://golang.org/dl/

Caveats

  1. This software has been tested with OSX only

Build and Run Tests

To build and run demos, run make.

About

Various experiments and demos relating to Golang talking to Rust via CGO

License:MIT License


Languages

Language:Rust 56.9%Language:Go 40.1%Language:Makefile 2.9%