Live data from Hacker News

RustPython

rustpython.github.io

61–70 of 244 posts

Re: RustPython

#61
post #47
post #21

Earlier quoted context omitted.

Python is a great language to Just Get Things Done™. Rust is great if you like puzzles and want to spend your precious time solving the same memory management riddle over and over again. You do get faster and often more robust code though, although in practice the difference is often not meaningful and the extra time invested doesn't pay off.

Sometimes, Things just can't be Done with Python. E.g., you're parsing dozens terabytes of data, or need response time within a microsecond. So, you're left with a choice of C++, Rust (what else, C#, possibly Zig and a few other). Rust stops being a "puzzle" once you've written enough of it and you just know how to do things. It has one major disadvantage though - returning back to write in languages like C++/Python…

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.

Re: RustPython

#62
post #5

How do extensions work with interpreters written other languages? Does the interpreter still expose a C API?

PyPy exposes a subset of the CPython C API, which is good enough for many C extensions, and some others can be ported with little effort.

Most other Python implementations don't provide any way to use CPython C extensions.

There is also the HPy API and ABI, which some C extensions target and multiple Python implementations can compile or load.

Re: RustPython

#63
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

Absolutely

It is really underrated.

Maybe it's the extension issue, maybe it's something else or maybe it's the fact that it was born as an experimental platform more than anything

But it should have been more popular

Re: RustPython

#64
post #57
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 nice if you want more performance. From my experience it seems underused. Never seen jython and ironpython used - yet.

I worked on a project (15+ years ago) that used Jython to put a web front end on GDS systems (airline reservation mainframes). It was in production and being used in some of the largest travel call centers at the time. The whole thing was built in Jython.

Re: RustPython

#65
post #4

I think it's really cool that Python has a healthy third-party interpreter community. PyPy, IronPython, Jython, and now RustPython expand Python's accessibility. It's very cool to see how many people are working on this, and I wonder what kind of problems with CPython this has exposed also.

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

No.. because the only reason to use python is the ecosystem of packages and that's painful enough on the official implementation.

Re: RustPython

#66

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…

for simple scripts, this is the easiest and works. python3 -m venv venv source venv/bin/activate pip install whatever echo "source path/to/venv/bin/activate && python3 path/to/app.py" > myscript mv myscript /usr/local/bin and just use myscript. I use this for a lot of little scripts

Why not just

Path/to/venv/bin/python path/to/app.py?

Neat trick though, gonna adopt it!

Re: RustPython

#67
post #61
post #47

Earlier quoted context omitted.

Sometimes, Things just can't be Done with Python. E.g., you're parsing dozens terabytes of data, or need response time within a microsecond. So, you're left with a choice of C++, Rust (what else, C#, possibly Zig and a few other). Rust stops being a "puzzle" once you've written enough of it and you just know how to do things. It has one major disadvantage though - returning back to write in languages like C++/Python…

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.

> Meaning you should be programming just about 99% of your time in Python.

No, not me, because I’m less productive in Python than in Rust, assuming the same level of final product quality, even excluding runtime performance.

> Turns out 99% of the time you don't need to parse terabytes or have μs-response times.

Performance is not the primary reason to use Rust. It has way more to offer than performance.

Re: RustPython

#69
post #18

Earlier quoted context omitted.

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

Absolutely It is really underrated. Maybe it's the extension issue, maybe it's something else or maybe it's the fact that it was born as an experimental platform more than anything But it should have been more popular

Python's use base is now dominated by ML and scientific in general isn't it? Both of those communities are relying on extensions completely. I am quite possibly biased as I haven't written any python that didn't use at least numpy.

Re: RustPython

#70
post #62
post #5

How do extensions work with interpreters written other languages? Does the interpreter still expose a C API?

PyPy exposes a subset of the CPython C API, which is good enough for many C extensions, and some others can be ported with little effort. Most other Python implementations don't provide any way to use CPython C extensions. There is also the HPy API and ABI, which some C extensions target and multiple Python implementations can compile or load.

There is a merge request up to add autogen rust bindings to hpy

https://github.com/hpyproject/hpy/pull/457

Post reply on HN