Rust Bindings

Aperta
#1,891 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
20/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
cpp, rust
Ambito
api

Direzione di ricerca

No files or tests are named. Start by reviewing the existing C++ and Python binding arrangements, then evaluate the proposed Cargo packaging, API-version compatibility, repository separation, license, and native socket-level design. Done would be a usable Rust binding with an agreed version-support and ownership model.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I'm starting to look into some new projects in Rust. I'm willing to work on and contribute the bindings, but there are some things to think about:

  1. The bindings need to live Cargo, the Rust package manager, as a primary method of installation. This also handles hosting documentation at https://doc.rust-lang.org. You can bundle dependencies in the same way that we currently ship/install the C++ and Python bindings, but this is sort of an anti-pattern in Rust (with the exception being OS distros that need to provide Rust dependencies as a part of other packages but it is typically NOT intended for code compilation for the end user).
  2. The above means that the OLA version may be decoupled from the Rust bindings version. I propose establishing an API version that can be queried from OLA. The bindings would then check if the OLA they are communicating with is supported by the binding version. This would also significantly help with #1451 where similarly the Python bindings could be decoupled if published to Pypi. I will make a separate issue/initial pull for this. Another nice consequence of this is possibly documentation about the underlying socket API that would allow for any binding to be created more trivially in the future.
  3. The above means that possibly there should be a separate repo for the Rust bindings since they wouldn't necessarily be tied to an individual OLA version/OLA API version. It would be strange also (in my opinion) for the Rust binding version to match the OLA version if it supports multiple OLA versions (we can limit it possibly to the last 1 or 2 major/minor versions released or found in popular distros (i.e. all of 0.10.x) for now.
  4. Because of Rust's recompilation/static linking requirements, LGPL may not be the best license. It is not necessarily always possible to replace the binary components of a Rust library with another in the same way you can with C/C++ shared libraries. It seems that MPL is the closest (copyleft). Apache 2.0 and MIT are also popular (but not copyleft).
  5. This should be a native binding, not a C++/shared library wrapper. There are some threading and other bits in the C++ API that don't make sense to wrap in Rust and should be written in Rust. Since it will be very separate code (working at the socket level and not a shared library) it further makes sense to be a separate repo (in my opinion).

I think I will probably start this at some point in my own repo and then I would be happy to transfer ownership or fork to another repo once I have something usable.

Lingua principale
C++
Stelle
771
Fork
234
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenLightingProject/ola

Tutte le issue di OpenLightingProject/ola

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.