[Python-Dev] Python startup time

Brett Cannon brett at python.org
Thu May 3 14:08:22 EDT 2018


On Thu, 3 May 2018 at 07:31 Nick Coghlan <ncoghlan at gmail.com> wrote:

> 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.
>

Eric Snow, Barry Warsaw, and I have actually discussed this as part of our
weekly open source office hours as work where we tend to talk about massive
ideas that would take multiple people full-time to accomplish. :)


>
>
>> 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.
>

Rust supports RAII
<https://doc.rust-lang.org/rust-by-example/scope/raii.html> so it shouldn't
be that bad.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180503/f476cdea/attachment.html>


More information about the Python-Dev mailing list