-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interest in a Python module? #4
Comments
It will not be very hard to make a pure-python module. DetialsWhen we use standard serialization like But if anyone want use Go back to main topic: How to implement a python
|
I don't have much time to do this, and rust version is just for learn rust for me(it available, can work with c++). If you/anyone want make a python module, or other language implementation. Welcom to PR, it will be very nice. |
The problem I see is that An important use case for me, is communicating with a small microcontroller running the C++ This is why I mentioned the case of Python's built-in So for example, maybe something like this in the Python
And then use the Python Or does the built-in de-serialization handle this already? Or is this just up to the end user of |
Yes, It's up to the end user of rpc_core to make sure they match sufficiently on both sides. Yes, It's necessary to define Uint16 and Uint8, but no need to define Uint32/Uint64, because it's auto size type.
Finally, I suggest use json serialization in defferent language, it's simple and readable, for now it already support by define |
Python, when available, is my go-to language for quick, reliable, portable, maintainable script work. Is there interest from anyone else for a Python module of
rpc_core
?I would suggest using the format strings laid out by the built-in
struct
module as a starting point for defining RPC packets in anrpc_core
Python module. Figuring out how to expand that to the supported C++std::
objects would be very interesting. An alternative route would be to do whatprotobuf
andflatbuffers
do, and use a special compiler for rpc_core schema files that are compiled and in turn used by therpc_core
Python module to describe the objects.The biggest problem for implementation I see, though, is that the standard Python is CPython, not C++. I don't know how we could get over that hurdle gracefully.
Perhaps
pybind11
orBoost.Python
would be the way to go.The text was updated successfully, but these errors were encountered: