Live data from Hacker News

RustPython

rustpython.github.io

171–180 of 244 posts

Re: RustPython

#171
post #61

Earlier quoted context omitted.

Turns out 99% of the time you don't need to parse terabytes or have μs-response times. Meaning you should be programming just about 99% of your time in Python. The Rust memory management puzzles are not really complicated. They just get in the way. > they don't have basic language tools like proper sum types or traits that get things done Sum types and traits are not getting things done.

> 99% of the time 99% of whose time? Where does this estimate come from? Definitely not my case, and definitely not the case for lots of programmers I know and/or work with. Python has its own place (for example, in DS/ML) and while I use it myself on daily basis for what's it's best at, statements like "you should be programming just about 99% of your time in Python" make no sense at best. And, note, it's not only a…

Since 3.10 python has a „semi proper sum type tool belt“ with PEP 634s pattern matching, typing.Union and the | operator. It requires a different approach and it’s still not as seamless or enforce type safety as strictly at compile time compared to languages like Rust or F# but it’s doable and usable.

Re: RustPython

#172

Earlier quoted context omitted.

From a non-python dev perspective: I always struggle with dependencies and versions. I have a script in front of me that I want to run, and am often just frustratingly brute-forcing commands to make it work. Do I: python? python3? pip install? pip3 install? python pip install? python pip3 install? python3 pip install? python3 pip3 install? And then everyone mentions "oh just use venv" or "conda" or docker or... It ju…

I feel you. python itself has its warts but its mostly minor. The dependancy hell though.. god damn it confuses me every time. I don't understand why they can't get it together with one consistent dependency system with good ergonomics. ruby does it with gem. elixir handles things reasonably well with mix. rust does it REALLY well with cargo. hell even ocaml has opam. but python? it between conda, pip, pip3, virtuale…

To highlight another dynamically typed, interpreted language ecosystem, npm has been providing a remarkably smooth and uniformly adopted service for the JavaScript community.

Re: RustPython

#173
post #123

Earlier quoted context omitted.

Pyodide (standard cPython in WebAssembly) loads surprisingly quickly. My https://lite.datasette.io application usually starts up in less than 10s - most of that is downloading about 10MB of WASM blobs, and 10MB isn't actually that big these days (many sites serve more than that in image headers). When I built Datasette Lite I did it as a research project, assuming it would be far too slow loading to be useful. I've s…

Your project seems very cool, and good on you for it. 10 seconds is absurdly slow, though. That's like time to install Mathematica from a disk image level slow.

I thought it was too slow as well, but apparently it's not - plenty of people are using it now, and I myself use it way more than I thought I would.

Re: RustPython

#174

Earlier quoted context omitted.

I don't think you grasp quite the implications of what I was saying, this kind of approach could take _seconds_ to even start running your python application. Large python codebases could take like a minute to start if loaded that way. Once it does start then your arguments can make sense, but even so it would still make it impractical for most things. Trust me, when the Javascript dev tells you something will be slo…

> I don't think you grasp quite the implications of what I was saying, this kind of approach could take _seconds_ to even start running your python application. Indeed, the web demo takes about 5 seconds to cold-start on my beefy PC, between downloading the 22MB WASM blob and compiling it. It also grows the WASM heap to 160MB after running the simple Fibonacci example, and WASM heaps can't (yet) be shrunk, so the onl…

I guess parts of this can be cached, so if you use the app more than once it will be faster (or at least it has the potential for it).

Re: RustPython

#175
post #18
post #4

Earlier quoted context omitted.

I wonder if anyone actually uses those third-party interpreters for anything serious. I've never come across anyone that did.

PyPy is one of the most underrated python implementation. It just makes your pure python code 20x faster without needing to change anything ( if you don't have c++. Extension depends) We had used PyPy in production , especially on Real-time/ asynchronous web apis that doesn't need machine learning stack

If Python community and CPython developers were more open to PyPy, many things could be changed. A group of people talks about how good having a third-party interpreter in Python community while the whole Python eco-system is heavily relying on the old (maybe good-enough) Python C API.

Whenever I meet a C API issue on RustPython project (yes, I contribute to RustPython), I think about PyPy, and check what's going on C API, and realize 15 years was not enough to change things. Now the momentum of PyPy is not that strong as before. I believe Python community lost a huge chance.

Hope HPy or something can save PyPy. Maybe RustPython also will get a chance around there.

Re: RustPython

#176

We've been using RustPython as the Python interpreter for our project Kybra, which is a Python environment for the Internet Computer Protocol (decentralized cloud, where all programs are automatically replicated across 13-40 nodes). Wasm is the runtime environment on ICP. It's been working quite well, though lack of C extensions is a problem. We're hoping to move to CPython once the wasi and C extension support is th…

Thank you for working with RustPython. I believe kybra made RustPython wasi support a lot more stable.

Re: RustPython

#177
post #97

Earlier quoted context omitted.

The reality is that the "dark" majority of preexisting code has essentially no performance requirements/concerns; they're business scripts that could literally run on a toaster with no problem if you could get the code onto it. So really most business logic can easily be satisfied by "compile the interpreter to wasm and then run the dynamic language on that", and doing it this way can move existing "learned the hard…

>> The reality is that the "dark" majority of preexisting code has essentially no performance requirements/concerns; they're business scripts that could literally run on a toaster with no problem if you could get the code onto it. Which means this whole thing is pointless from an end user point of view. The technology stack is getting very deep - Python, Rust interpreter, WASM, in a browser. I'd love to get back to r…

Use go for that :)

Re: RustPython

#178
post #123

Earlier quoted context omitted.

Pyodide (standard cPython in WebAssembly) loads surprisingly quickly. My https://lite.datasette.io application usually starts up in less than 10s - most of that is downloading about 10MB of WASM blobs, and 10MB isn't actually that big these days (many sites serve more than that in image headers). When I built Datasette Lite I did it as a research project, assuming it would be far too slow loading to be useful. I've s…

Your project seems very cool, and good on you for it. 10 seconds is absurdly slow, though. That's like time to install Mathematica from a disk image level slow.

> 10 seconds is absurdly slow, though.

I hate to say this, but have you used any $ModenWebApp with $HotJSFramework recently? I thank the gods when those pages load without a 5-10 second of fancy spinning animation. Really thought we would be in a better place by 2024 but nope.

Re: RustPython

#179

Earlier quoted context omitted.

I don't think you grasp quite the implications of what I was saying, this kind of approach could take _seconds_ to even start running your python application. Large python codebases could take like a minute to start if loaded that way. Once it does start then your arguments can make sense, but even so it would still make it impractical for most things. Trust me, when the Javascript dev tells you something will be slo…

> I don't think you grasp quite the implications of what I was saying, this kind of approach could take _seconds_ to even start running your python application. Indeed, the web demo takes about 5 seconds to cold-start on my beefy PC, between downloading the 22MB WASM blob and compiling it. It also grows the WASM heap to 160MB after running the simple Fibonacci example, and WASM heaps can't (yet) be shrunk, so the onl…

As far as I'm aware, even discarding the instance isn't good enough, since v8 doesn't seem to reclaim the Wasm Linear Memory ever. I think the only thing you can do is start it in a worker and then terminate the entire worker.

Re: RustPython

#180
post #42

Last blog entry being from "Dec 1, 2021" doesn't make it sound like there's much action.

Our team tends to drilling on code more than writing. I know it is not a strategic good way though. Any idea what do you expect to see on the blog?
Post reply on HN