Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Polars has a python front end, which I have used. All the work happens in Rust but the queries can be specified in python. The data is stored using Apache Arrow format so there is no copy required for the same data to be accessible in both Rust and python.


Oh, that's cool. I did not realize this. I realize this isn't novel but I do not really understand how a library written in one language is used by another - some sort of bindings that the library handles I guess.


The magic of well-defined APIs! If you're interested in mixing different DS backends and kernels in a single notebook, check out Quarto:

[1]: https://quarto.org/


It looks like polars is using PyO3, which are Rust bindings for Python. Python's reference implementation is in C, so I imagine it's interacting with that API [0] through FFI. Common Python extension modules (as these are called) are compiled as dynamically linked libraries and binaries (or compilation instructions) are included in Python wheels.

[0] https://docs.python.org/3/extending/extending.html


Both R and pythons pandas uses code written in C and Fortran to do the actual calculations when you ask them to manipulate data.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: