dylibso / observe-sdk

Continuous runtime observablity SDKs to monitor WebAssembly code.
https://dev.dylibso.com/docs/observe/overview
Apache License 2.0
159 stars 7 forks source link

Observe API C++ SDK #139

Closed G4Vi closed 4 months ago

G4Vi commented 1 year ago

Currently the observe api may be used in C++, but requires using raw pointers to pass strings. It would nice to be able to use std::string to pass strings instead.

nilslice commented 1 year ago

could we wrap the C API in a CPP SDK? we know we want to support C, with as few dependencies as possible.

G4Vi commented 1 year ago

The C API is kind of two APIs wrapped into one right now. The imports from dylibso:observe/api that pass strings as ptr and length separately as uint32_ts and the wrappers that take null terminated strings. We'd want to use the former to implement the c++ sdk as the common std::string implementations store the length of the string so it doesn't need to be computed again.