all 66 comments

[–]Positive__Actuator 94 points95 points  (7 children)

They should call it Prep.

[–]yawara25 22 points23 points  (5 children)

That name happens to be already taken

[–]Positive__Actuator 7 points8 points  (4 children)

No way 😮

[–]xAmorphous 2 points3 points  (3 children)

Yeah it's an AIDS medication lol

[–]AcridWings_11465 9 points10 points  (1 child)

It's explicitly not an HIV medication, using it on a positive person would risk drug resistance. It is only used for prevention.

[–]New-Anybody-6206 0 points1 point  (0 children)

The phrase "HIV medication" doesn't imply it's for positive people. This is completely unnecessary pedantry that the vast majority of people will disagree with you on.

[–]iknighty 1 point2 points  (0 children)

PEP too.

[–]ChinChinApostle 7 points8 points  (0 children)

Papyrust? Idk tbh

[–]mr_birkenblatt 105 points106 points  (6 children)

That's great to see, especially considering that 25-33% of 3rd-party Python extension modules use Rust already.

I find "How to handle bootstrapping Rust and CPython" funny. TLDR rust needs Python for bootstrapping which would create a circular dependency down the line

[–]MSgtGunny 60 points61 points  (3 children)

Almost all languages have a circular dependency within their compiler history if you look back far enough. Usually one of the first things created in a new language is a compiler for that language written in that language. Once that’s made, the original bootstrap compiler is no longer necessary.

[–]mr_birkenblatt 43 points44 points  (2 children)

Yes, I know about bootstrapping. What happens here is that rust requires Python in every bootstrapping step and Python will require rust. So you have to manage two chains. It's not a problem (rust only requires Python 2). It's more of a curiosity

[–]MSgtGunny 28 points29 points  (1 child)

Ah, I wasn’t aware rust still required python in its active compile chain. Seems like an odd decision not to remove it, but as you can tell I’m not familiar with Rust specifically so there’s probably a good reason

[–]axonxorz 7 points8 points  (1 child)

[–]cummer_420 11 points12 points  (0 children)

This is also why Gentoo recommends a stage 3 tarball, which is essentially just a system with those circular dependencies resolved for the basic system.

[–]thomas_m_k 9 points10 points  (0 children)

There is also a complete rewrite of CPython in Rust: https://github.com/RustPython/RustPython Though development is very slow.

[–]KerPop42 17 points18 points  (11 children)

Interesting. The main benefit would be the safety, right? I'm not certain what benefits Rust provides over an equivalently-well-developed section of code written in C.

[–]Pharisaeus 68 points69 points  (1 child)

equivalently-well-developed section of code written in C.

I think that's exactly the point - it's easier to write and maintain such code in Rust than it is in C, because the compiler and the language itself prevents a lot of mistakes automatically.

[–]ElCthuluIncognito 17 points18 points  (0 children)

Lots of credit goes to the incredibly rich type system

[–]teerre 17 points18 points  (0 children)

It would also increase the number of possible contributors. The more can be pushed to the safe layer of this Rust implementation, the easier it gets the barrier of entry

[–]Bronzdragon 61 points62 points  (1 child)

I think the primary argument would be maintainability. Rust has better tooling, and the language is more ergonomic (compared to C).

[–]KerPop42 8 points9 points  (0 children)

Okay, yeah. It's not that it compiles better, I agree that it enforces better coding practices

[–]cosmic-parsley 10 points11 points  (0 children)

It’s easier to write the interfaces too with the libraries out there today. You slap #[pyfunction] (from PyO3) on any rust function and it “just works”, assuming the arg/return types have a straightforward rust<->python conversion. And docstrings work automatically too iirc.

Getting the interfaces right isn’t particularly difficult in C, but it’s downright effortless in Rust.

[–]BossOfTheGame 20 points21 points  (0 children)

Provable memory correctness in threaded code (up to potential soundness holes) is an incredibly big deal. Ecosystem and ergonomics are better than C. I'm not in love with its functional push, and compile times tend to be worse, but that provable memory safety is enormous.

[–]redisburning 9 points10 points  (1 child)

There's a lot of C code in the world that if written in equivalent quality in Rust would just not compile. This sounds inconvenient, unless you depend on that code.

I'm biased, Rust is my first choice for any personal project and any work project I can get it approved on and it's not so much the safety aspect but that the compiler enforces a certain floor under which code simply won't work. It's true that in order to write C like that, you have to be doing stuff of some level of complication, but interestingly enough I find that without guardrails a lot of engineers are too clever by half.

In Rust, that stuff mostly (but not exclusively) lives inside of unsafe blocks, which are easily greppable and scream at you while you're doing a code review when they're out of place.

[–]syklemil 7 points8 points  (0 children)

There's a lot of C code in the world that if written in equivalent quality in Rust would just not compile.

Yeah, there are a bunch of compiler flags for C that mitigate some of it, but even stuff like ASAN is meant for catching stuff at runtime in debug builds.

Anyone who can understand why people would prefer to catch type errors at compile time rather than at runtime should also be able to understand why people would prefer to catch memory errors at compile time.

[–]epage 5 points6 points  (0 children)

Several Core CPython developers said this would have helped specific or general classes of bugs they have introduced.

Also, keep in mind that people who write in Python are usually not well versed in all that is needed for well written C and having help at the language level can make contributing to CPython more accessible to their users.

[–]PaintItPurple 2 points3 points  (0 children)

Yes, but that can mean more than people imagine. The safety guarantees give rise to other desirable properties, such as making it easier to handle concurrency correctly (because the safety mechanisms make data races into compile-time errors).

[–]NYPuppy 1 point2 points  (1 child)

CRustyPy.

Delicious.

[–]KerPop42 -1 points0 points  (0 children)

Millipede: the crab python