Best practices in creating a Rust API for a C++ library? Seeking advice from those who've done it before.

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • ompl

    The Open Motion Planning Library (OMPL)

  • In Robotics, the Open Motion Planning Library (OMPL) is a popular library for multi-dimensional motion planning, and is used by ROS and other robotics-related software. There are no Rust bindings to OMPL (though there is Rust support for software like ROS), and the library is written almost exclusively in C++. There are Python bindings, but those are generated using Py++. The header files throughout OMPL are C++ header files, not C, as they contain namespaces, classes, etc.

  • rosrust

    Pure Rust implementation of a ROS client library

  • In Robotics, the Open Motion Planning Library (OMPL) is a popular library for multi-dimensional motion planning, and is used by ROS and other robotics-related software. There are no Rust bindings to OMPL (though there is Rust support for software like ROS), and the library is written almost exclusively in C++. There are Python bindings, but those are generated using Py++. The header files throughout OMPL are C++ header files, not C, as they contain namespaces, classes, etc.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • pyplusplus

  • In Robotics, the Open Motion Planning Library (OMPL) is a popular library for multi-dimensional motion planning, and is used by ROS and other robotics-related software. There are no Rust bindings to OMPL (though there is Rust support for software like ROS), and the library is written almost exclusively in C++. There are Python bindings, but those are generated using Py++. The header files throughout OMPL are C++ header files, not C, as they contain namespaces, classes, etc.

  • ROS

    Core ROS packages

  • In Robotics, the Open Motion Planning Library (OMPL) is a popular library for multi-dimensional motion planning, and is used by ROS and other robotics-related software. There are no Rust bindings to OMPL (though there is Rust support for software like ROS), and the library is written almost exclusively in C++. There are Python bindings, but those are generated using Py++. The header files throughout OMPL are C++ header files, not C, as they contain namespaces, classes, etc.

  • rust-bindgen

    Automatically generates Rust FFI bindings to C (and some C++) libraries.

  • I have looked into bindgen, but found that it would not be feasible due to OMPL not having a C API, just C++.

  • rust-cpp

    Embed C++ directly inside your rust code!

  • I would like to utilize OMPL's functionality in Rust code, so I want to call into OMPL C++ code somehow in Rust. I've seen two (non-mutually-exclusive) options so far: - rust-cpp, which allows you to write C++ code in Rust within the cpp!() macro. - cxx, which allows you to define both sides of the FFI boundary manually (as opposed to bindgen's automatic generation).

  • cxx

    Safe interop between Rust and C++

  • I would like to utilize OMPL's functionality in Rust code, so I want to call into OMPL C++ code somehow in Rust. I've seen two (non-mutually-exclusive) options so far: - rust-cpp, which allows you to write C++ code in Rust within the cpp!() macro. - cxx, which allows you to define both sides of the FFI boundary manually (as opposed to bindgen's automatic generation).

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts