nebula-python icon indicating copy to clipboard operation
nebula-python copied to clipboard

Consider migrating to Rust based Python package?

Open haoxins opened this issue 1 year ago • 8 comments

General Question

More and more Python packages are built from the Rust code base. Such as:

  1. https://github.com/pola-rs/polars
  2. https://github.com/Qiskit/rustworkx
  3. https://github.com/pydantic/pydantic-core

The associated tools are:

https://github.com/PyO3

The benefit is that we can build the logic from Rust once and publish it as Rust, Python, and even JavaScript (Node.js) packages. This is especially the trending solution for the data/ML ecosystem.

When I start to build the services and SDKs based on the Nebula. The first candidate language is Rust so that I can develop and deploy the services as Rust code, and build the Python SDKs (for data scientists) based on the Rust codebase. This is the ideal solution for writing code only once.

But the Rust client for Nebula is not ready at last year.

Since we already have the first draft version of the Nebula Rust client, I think this is a good time to share this idea with you guys.

The other tools for more languages that I'm not used to are: https://github.com/dtolnay/cxx for c++

cc @Nicole00 @wey-gu

haoxins avatar Feb 21 '24 05:02 haoxins

Another example from Temporal SDK core

haoxins avatar Feb 23 '24 05:02 haoxins

It's really a great idea, thank you Haoxin.

QingZ11 avatar Feb 23 '24 09:02 QingZ11

General Question

More and more Python packages are built from the Rust code base. Such as:

  1. https://github.com/pola-rs/polars

  2. https://github.com/Qiskit/rustworkx

  3. https://github.com/pydantic/pydantic-core

The associated tools are:

https://github.com/PyO3

The benefit is that we can build the logic from Rust once and publish it as Rust, Python, and even JavaScript (Node.js) packages.

This is especially the trending solution for the data/ML ecosystem.

When I start to build the services and SDKs based on the Nebula.

The first candidate language is Rust so that I can develop and deploy the services as Rust code, and build the Python SDKs (for data scientists) based on the Rust codebase.

This is the ideal solution for writing code only once.

But the Rust client for Nebula is not ready at last year.

Since we already have the first draft version of the Nebula Rust client, I think this is a good time to share this idea with you guys.

The other tools for more languages that I'm not used to are:

https://github.com/dtolnay/cxx for c++

cc @Nicole00 @wey-gu

Agreed, was considering pyo3 when facing perf issues in https://github.com/wey-gu/nebula-dgl/issues/10

We could do so in free time!

wey-gu avatar Feb 25 '24 17:02 wey-gu

Also find this https://github.com/jni-rs/jni-rs for Java :)

haoxins avatar Mar 01 '24 05:03 haoxins

Also, recently I had some chance to implement/build something with cython, later I could prepare a PR to add cython build of nebula-python and come with a benchmark.

wey-gu avatar Mar 21 '24 04:03 wey-gu

👍Both Rust and Cython are excellent choices, but Rust (using PyO3) may be a more popular and convenient option when integrating with both Python and Node, especially if there already has a mature Rust-based repository here. Hope to see it soon.

Abeautifulsnow avatar Sep 12 '24 06:09 Abeautifulsnow

https://github.com/nebula-contrib/rust-nebula

cc @BeautyyuYanli @PsiACE

wey-gu avatar Sep 12 '24 16:09 wey-gu

https://github.com/nebula-contrib/rust-nebula

cc @BeautyyuYanli @PsiACE

Cool idea. We can start by simply checking that the core functionality is aligned.

PsiACE avatar Sep 13 '24 02:09 PsiACE