Earlier quoted context omitted.
I tried once building a very simple Rust extension on Windows using the Anaconda Python distribution and had no luck. If I remember correctly it got stuck trying to find the VC++ compiler. Cython extensions on the other hand work fine with the MinGW GCC compiler provided by Anaconda, although it's pretty old (version 5).
In my experience that is just the silly amount of variables you have to export to use the VC++ compiler and this is why they provide a dedicated terminal prompt for the VC++ compiler with all the right env vars loaded. I've struggled as well automating VC++ compilation in rust as a result. If you're so inclined to revisit this using mingw with rust you can see how here https://rust-lang.github.io/rustup/installation/…
Extending Python with Rust
81–88 of 88 posts
Re: Extending Python with Rust
#82Earlier quoted context omitted.
What did you use for your plotter? I'm in science as well and I'm shopping around for a good Rust library to use for just throwing together a quick plot of some simulation data. Currently I generate my data in Rust, write it to a numpy format, and look at it later with matplotlib, but as you've said, 3D plots usually end up looking like a slideshow.
I made my own, using WGPU and this basic graphics engine: https://github.com/David-OConnor/graphics_wgpu Note that there's currently no docs or template/examples, and I'm rapidly breaking the API. The surface plots are just meshes of a grid divided into triangles. When I need to manipulate them, I re-gen the meshes from a nested 3D array. So, not a plotting lib at all; a flexible 3d and UI lib. Could probably made us…
I've come across Plotters before but last time I checked, the documentation was pretty sparse and I didn't really relish the thought of trying to parse though and tweak the examples at that time. It looks like they're gradually filling out the docs now, though, so maybe I'll give it another go.
Re: Extending Python with Rust
#83Earlier quoted context omitted.
Yeah that's one genre of these posts - someone sharing their experience (re)writing *nix utils like cd, ls, grep etc in Rust. But as a project I think it's unrealistic to expect they'll supplant those utilities with an identical Rust-based one, there's often not much to be gained for the risk of potentially breaking a bunch of important stuff in your system by introducing a bit of an unknown quantity, and the effort…
> As I said, not a Rust dev and frankly I'm quite intimidated by all the rants people had about fighting with "The Borrow Checker" which sounds like a ferocious Elden Ring boss. But I am tempted by the way it allows safe (or safer) software to be written. In my experience, those "fighting" the borrow checker are often novices misunderstanding the language model or lacking the experience necessary to effectively use i…
well yeah as a n00b I would be both of those
Re: Extending Python with Rust
#84Earlier quoted context omitted.
Python 3 can be executed server side by Postgres as well CREATE FUNCTION pymax (a integer, b integer) RETURNS integer AS $$ if a > b: return a return b $$ LANGUAGE plpython3u; https://www.postgresql.org/docs/current/plpython.html
Python running in Postgres sounds like it would be unusably slow. What's the performance like?
Re: Extending Python with Rust
#85I think the trouble comes when moving beyond numpy. I'm working on understanding chemistry more, and how to approximate wavefunctions for multi-particle systems. I wrote a Python script a few weeks ago that compares measured vs calculated psi'', to assess how good a trial WF is. Plotting 2/3 of the dimensions using a Matplotlib surface plot. The surface plot brings my computer to a crawl. And, I'm not sure how to mak…
However, it won't solve your problem of Python not being fast enough doing the calculations.
Re: Extending Python with Rust
#86Earlier quoted context omitted.
I tried once building a very simple Rust extension on Windows using the Anaconda Python distribution and had no luck. If I remember correctly it got stuck trying to find the VC++ compiler. Cython extensions on the other hand work fine with the MinGW GCC compiler provided by Anaconda, although it's pretty old (version 5).
In my experience that is just the silly amount of variables you have to export to use the VC++ compiler and this is why they provide a dedicated terminal prompt for the VC++ compiler with all the right env vars loaded. I've struggled as well automating VC++ compilation in rust as a result. If you're so inclined to revisit this using mingw with rust you can see how here https://rust-lang.github.io/rustup/installation/…
Re: Extending Python with Rust
#87Earlier quoted context omitted.
Yeah, Python's dependency management is already abysmal, but when lower level language modules get involved its suddenly whole different level of hell. This actually put me off Python entirely. Sadly no real alternative in ML.
abysmal compared to?
Python has neither standard tooling (de facto nor de jure), has no consensus within community where everyone seems to invent their own yet-another-dependency-management-tool and no culture of preserving strong backwards compatibility (never mind the core 2->3 transition).
Re: Extending Python with Rust
#88Earlier quoted context omitted.
abysmal compared to?
Rust (what I consider to be gold standard at this point), Java, C#, Clojure (piggy-backs on Java/Maven).. Hell, even Emacs-lisp has better dependency management because lack of dependency version control has established strong backwards compatibility culture within community. Python has neither standard tooling (de facto nor de jure), has no consensus within community where everyone seems to invent their own yet-anot…
But we'll agree python's dep management is leagues ahead of javascript and R, though. Right?