Re:Pebble: A RocksDB Inspired Key-Value Store Written in Go
by strken on Wednesday September 16, 2020 @08:48AM
(#24492134)
Reading this, I wonder how hard it would be to write or generate assembly bindings for libraries like rocksdb and sqlite, and whether you'd be able to do any better than cgo.
[ Parent
| on HN ]
Re:Pebble: A RocksDB Inspired Key-Value Store Written in Go
by petermattis on Wednesday September 16, 2020 @03:02PM
(#24496181)
Cgo exists because goroutine stacks are small and grow on demand. C/C++ expect large fixed size stacks. While you can technically call into C++ without going through cgo (see https://github.com/petermattis/fastcgo), you can't avoid the stack problem. Cgo solves it by switch from the goroutine stack to the stack of the thread underlying the goroutine.