<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-AU link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span lang=EN-US>I don’t think there would be any trouble linking in the generated C files. The built in modules like this just have their *_init() functions called at startup, so possibly nothing would even change.</span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Top-posted from my Windows 10 phone</p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='border:none;padding:0cm'><b>From: </b><a href="mailto:brett@python.org">Brett Cannon</a><br><b>Sent: </b>Wednesday, 1 August 2018 17:20<br><b>To: </b><a href="mailto:stefan_ml@behnel.de">Stefan Behnel</a><br><b>Cc: </b><a href="mailto:python-dev@python.org">python-dev@python.org</a><br><b>Subject: </b>[Python-Dev] Using Cython for the stdlib (was: Let's change to CAPI!)</p></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>[new thread as this no longer has anything to do with Victor's proposal]</p><div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Tue, 31 Jul 2018 at 13:42 Stefan Behnel <<a href="mailto:stefan_ml@behnel.de">stefan_ml@behnel.de</a>> wrote:</p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal>Antoine Pitrou schrieb am 31.07.2018 um 09:45:<br>> On Tue, 31 Jul 2018 09:27:03 +0200<br>> Jeroen Demeyer <J.Demeyer@UGent.be> wrote:<br>>> On 2018-07-31 08:58, Antoine Pitrou wrote:<br>>>> I think Stefan is right that we<br>>>> should push people towards Cython and alternatives, rather than direct<br>>>> use of the C API (which people often fail to use correctly, in my<br>>>> experience).  <br>>><br>>> I know this probably isn't the correct place to bring it up, but I'm <br>>> sure that CPython itself could benefit from using Cython. For example, <br>>> most of the C extensions in Modules/ could be written in Cython.<br>> <br>> We don't depend on any third-party Python modules.  Adding a Cython<br>> dependency for CPython development would be a tough sell.<br><br>I don't really want to get into that discussion (it's more about processes<br>than arguments), but let me note that the CPython development already has a<br>couple of dependencies, such as github and its bots, or tools like argument<br>clinic (admittedly included), make and a C compiler (not included), and a<br>text editor. It's not like it's free of tools that help in writing and<br>maintaining the code. That's pretty much the level at which I also see<br>Cython. It's more complex than argument clinic, but it otherwise serves a<br>similar need.</p></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>You're right that since Cython generates C code that we could check in like we do all of our other generated code we could view Cython as another external tool we rely on for maintaining the code base.</p></div><div><p class=MsoNormal> </p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal><br><br>> Also, a C extension can be built-in (linked statically into the<br>> interpreter), which I think would be hard to do with Cython.<br><br>Someone recently contributed a feature of hiding the pyinit function for<br>the embedding case, so people do these things already. This could use the<br>normal inittab mechanism, for example. What I think you might be referring<br>to is that Cython modules require the CPython runtime to be initialised to<br>a certain extent, so you couldn't implement "sys" in Cython, for example.</p></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I think the key thing is that on Windows all extension modules are built-in modules, so that use-case would need to be supported (I don't know Cython well enough to know whether this would be doable if we converted as much as possible to Cython itself).</p></div><div><p class=MsoNormal> </p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal>But Jeroen is right, Cython should be a viable option for (most of?) the<br>extension modules in the stdlib. Whether the CPython core devs would accept<br>it in their workflow or not is a totally different question.</p></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div></div></div></div><p class=MsoNormal>I think it's definitely something to consider, although I think Victor's proposal to clean up the C API so we have a clearly delineated private API, a version-specific API, and a stable ABI is a separate idea and so this should be its own thread (plus Victor's is easier to accomplish in the short-term ;) . </p><p class=MsoNormal><o:p> </o:p></p></div></body></html>