Earlier quoted context omitted.
Ah ok, it's at least comforting to know that I missed it, rather than there are superhuman developers that crank these projects out in an afternoon.
I've had some fun converting some of my Python scripts into Rust and it's really not that difficult with the help of modern tools once you wrap your head around Rust. Python is too huge to crank out in an afternoon, for sure, but on the human level, the translation from python to something compiled is a well trod path.
RustPython: A Python Interpreter Written in Rust
61–70 of 75 posts
Re: RustPython: A Python Interpreter Written in Rust
#62If not, is it at all possible to get numpy to work and other libraries written in native code? I see that rustpython also work in wasm: but what about compiling numpy's native code to wasm as well?
Re: RustPython: A Python Interpreter Written in Rust
#63Earlier quoted context omitted.
I'm really looking forward to uv being a drop-in replacement for Poetry. I don't know if that's what they're planning to do, though. Does it currently have all the niceties of Poetry (dependency management, locks, building wheels, etc?).
Yeah, that's definitely within scope for what we're trying to build, and we've been hard at work on extending uv to support those workflows (platform-agnostic resolution, lockfiles, etc.). Honestly, a lot of it is already implemented, but not yet stabilized or announced. Coming soon.
Re: RustPython: A Python Interpreter Written in Rust
#64Earlier quoted context omitted.
How fast does it really need to be? On my M2 macbook air: $ time A=1 B=1 python -c "import os; print(int(os.getenv('A'))+int(os.getenv('B')))" 2 real 0m0.068s user 0m0.029s sys 0m0.026s
Eh. Once you start using imports, python slows down dramatically. So I guess it really just depends what your scripts use.
So a fast SSD will help, and somewhat surprisingly putting it inside docker helps (in an HPC context, not so sure it’s implications here as we’re talking about a short scripts.)
But the context here is to port shell scripts to Python, I’m not sure how huge amounts of imports matters.
And it is probably an intrinsic problem of the language, unless we start talking about compiling (and somehow statically) not interpreting the Python program, whichever implementation of the language probably won’t help the situation.
Lastly, if high startup costs of the script becomes relevant, perhaps it is orchestrating wrong. This is an infamous problem of Julia, and their practice is then just keep the Julia instance alive and use it as “the shell”. Similarly, you can do so in Python. Ie rather than calling a script from the shell acting on millions of things, write a wrapper script that start the Python instance once. Memory leak could be a problem if it or its dependencies are not well written but even in that case you have ways to deal with that.
Re: RustPython: A Python Interpreter Written in Rust
#65While you're at it fix Python's crippled lambdas and ...
Re: RustPython: A Python Interpreter Written in Rust
#66Earlier quoted context omitted.
I've had some fun converting some of my Python scripts into Rust and it's really not that difficult with the help of modern tools once you wrap your head around Rust. Python is too huge to crank out in an afternoon, for sure, but on the human level, the translation from python to something compiled is a well trod path.
The one time cost of learning borrow rules and traits is steep, but the lifetime savings of cargo vs PIP probably hits break even after a few months.
Re: RustPython: A Python Interpreter Written in Rust
#67Earlier quoted context omitted.
I've had some fun converting some of my Python scripts into Rust and it's really not that difficult with the help of modern tools once you wrap your head around Rust. Python is too huge to crank out in an afternoon, for sure, but on the human level, the translation from python to something compiled is a well trod path.
The one time cost of learning borrow rules and traits is steep, but the lifetime savings of cargo vs PIP probably hits break even after a few months.
Re: RustPython: A Python Interpreter Written in Rust
#68Re: RustPython: A Python Interpreter Written in Rust
#69Earlier quoted context omitted.
> Don't these things take a massive amount of effort? Yes, RustPython has been in development since at least 2018. > Wouldn't this be making waves much earlier in its development process? It's been posted on HN several times before: https://hn.algolia.com/?q=rustpython
Ah ok, it's at least comforting to know that I missed it, rather than there are superhuman developers that crank these projects out in an afternoon.
It only ran about 3x slower than PUC Lua... And never collected garbage either :P
Re: RustPython: A Python Interpreter Written in Rust
#70Earlier quoted context omitted.
> Don't these things take a massive amount of effort? Yes, RustPython has been in development since at least 2018. > Wouldn't this be making waves much earlier in its development process? It's been posted on HN several times before: https://hn.algolia.com/?q=rustpython
Ah ok, it's at least comforting to know that I missed it, rather than there are superhuman developers that crank these projects out in an afternoon.
It's still a lot of work but the only need to make the "built in" parts of the language and that's a lot smaller subset.
Example of what im talking about: https://github.com/RustPython/RustPython/pull/3858