[Python-Dev] Python startup time

Nick Coghlan ncoghlan at gmail.com
Thu May 3 10:29:55 EDT 2018


On 3 May 2018 at 15:56, Glenn Linderman <v+python at g.nevcal.com> wrote:

> On 5/2/2018 8:56 PM, Gregory Szorc wrote:
>
> Nobody in the project is seriously talking about a complete rewrite in
> Rust. Contributors to the project have varying opinions on how aggressively
> Rust should be utilized. People who contribute to the C code, low-level
> primitives (like storage, deltas, etc), and those who care about
> performance tend to want more Rust. One thing we almost universally agree
> on is that we want to rewrite all of Mercurial's C code in Rust. I
> anticipate that figuring out the balance between Rust and Python in
> Mercurial will be an ongoing conversation/process for the next few years.
>
> Have you considered simply rewriting CPython in Rust?
>

FWIW, I'd actually like to see Rust approved as a language for writing
stdlib extension modules, but actually ever making that change in policy
would require a concrete motivating use case.


> And yes, the 4th word in that question was intended to produce peals of
> shocked laughter. But why Rust? Why not Go?
>

Trying to get two different garbage collection engines to play nice with
each other is a recipe for significant pain, since you can easily end up
with uncollectable cycles that neither GC system has complete visibility
into (all it needs is a loop from PyObject A -> Go Object B -> back to
PyObject A).

Combining Python and Rust can still get into that kind of trouble when
using reference counting on the Rust side, but it's a lot easier to avoid
than it is in runtimes with mandatory GC.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180504/e3d353f8/attachment-0001.html>


More information about the Python-Dev mailing list