Re: [Python-Dev] PEP 3003 - Python Language Moratorium
by Michael Foord other posts by this author
Nov 5 2009 2:18AM messages near this date
Re: [Python-Dev] PEP 3003 - Python Language Moratorium
|
Re: [Python-Dev] PEP 3003 - Python Language Moratorium
Stefan Behnel wrote:
> Michael Foord, 05.11.2009 10:13:
>
> > Stefan Behnel wrote:
> >
> >> if it's intended to name the major
> >> implementations, I wonder why Cython is missing from that list.
> >>
> > Is Cython an implementation of Python?
> >
>
> We certainly aim for Python compatibility. That's a proclaimed 1.0 goal.
> Not sure if that means Py3 or Py2 syntax, but that's just a parser detail,
> after all.
>
>
Right, but I think the main point is that Cython is not an
implementation of Python. It uses Python syntax, calling into the Python
runtime for many of its features, and *extending* Python syntax for
compilation to C. (Right?)
Obviously a grey area - but if you take Cython code and try to run it on
ClassicPython then you are likely to have syntax errors. The same is not
true of the other full implementations (although where they use native
platform features you may not have the same libraries available - but
the language is unchanged).
All the best,
Michael
>
> > It's a grey area, but it seems like Cython is a "Python inspired"
> > language (similar to Shedskin) rather than an implementation of Python:
> >
> > The Cython language is very close to the Python language, but Cython
> > additionally supports calling C functions and declaring C types on
> > variables and class attributes. This allows the compiler to generate
> > very efficient C code from Cython code.
> >
> > (From http://www.cython.org/ )
> >
>
> Cython is different from Shedskin because Shedskin /requires/ the 'Python'
> code to be static. Cython does not. It /optimises/ static code, but it will
> not complain about dynamic code.
>
> It /does/ make some static assumptions in that it considers builtins true
> builtins. However, it does not prevent you from replacing them in your
> code, as long as you do it inside the module. Certainly a restriction
> compared to Python, where you can import a module into a changed dict
> environment that redefines 'object', but not a major restriction IMO, and
> certainly not one that impacts much code.
>
>
>
> > There are several partial implementations, including Python inspired
> > languages, but if we are looking at 'major complete implementations'
> > then the current list seems to be: CPython, Jython, IronPython and PyPy.
> >
>
> Cython certainly is not a complete implementation, sure. It still lacks
> support for local classes, for example, metaclasses aren't handled, and
> generators are still in design stage. But if one of the goals of the
> moratorium is to let implementations catch up with the syntax, then Cython
> is certainly in line with that. I doubt that there will be much left on the
> TODO list two years from now.
>
>
>
> > Even Unladen Swallow is a fork (sorry - I mean branch) of CPython rather
> > than a separate implementation.
> >
>
> Cython is somewhere in the middle. It's not a fork or branch. Rather, it
> depends on the normal CPython runtime for certain features, such as the
> standard library, the type/object implementation, garbage collection, and a
> couple of dynamic features. But that doesn't prevent it from compiling your
> module into an executable application.
>
> Stefan
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev@[...].org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/fuzzyman%40voidspace.org.uk
>
--
http://www.ironpythoninaction.com/
_______________________________________________
Python-Dev mailing list
Python-Dev@[...].org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-dev-ml%40maillist.acti
vestate.com
Thread:
Guido van Rossum
Arfrever Frehtes Taifersar Arahesis
Antoine Pitrou
exarkun
Glyph Lefkowitz
R. David Murray
exarkun
Glyph Lefkowitz
Stephen J. Turnbull
Brett Cannon
Guido van Rossum
Steven D'Aprano
Steven D'Aprano
Guido van Rossum
Scott Dial
Geremy Condra
Jesse Noller
Geremy Condra
Guido van Rossum
Geremy Condra
Brett Cannon
Guido van Rossum
John Arbash Meinel
Greg Ewing
Terry Reedy
Mrab
Dirkjan Ochtman
Brett Cannon
Jesse Noller
Guido van Rossum
Georg Brandl
Nick Coghlan
Guido van Rossum
skip
exarkun
Georg Brandl
Guido van Rossum
Brett Cannon
Guido van Rossum
Brett Cannon
Guido van Rossum
Brett Cannon
Terry Reedy
Geremy Condra
Andre Stechert
Yuvgoog Greenle
Nick Coghlan
Dirkjan Ochtman
Tres Seaver
Nick Coghlan
Bobby R. Ward
exarkun
hfuerstenau
Yuvgoog Greenle
Gregory P. Smith
Georg Brandl
A.M. Kuchling
Georg Brandl
Jesse Noller
Raymond Hettinger
Stefan Behnel
Stefan Behnel
Michael Foord
Stefan Behnel
Michael Foord
Stefan Behnel
Maciej Fijalkowski
Stefan Behnel
Dirkjan Ochtman
Thomas Heller
Guido van Rossum
Stefan Behnel
Antoine Pitrou
Stefan Behnel
Guido van Rossum
Anand Balachandran Pillai
Willem Broekema
Maciej Fijalkowski
Stefan Behnel
Michael Foord
Steven D'Aprano
Willem Broekema
Steven D'Aprano
Willem Broekema
Stefan Behnel
Dino Viehland
Stefan Behnel
Dino Viehland
Collin Winter
Alexandre Vassalotti
Jack Diederich
Nick Coghlan
Mark Hammond
Facundo Batista
Jesse Noller
Barry Warsaw
Michael Foord
Doug Hellmann
skip
M.-A. Lemburg
Guido van Rossum
Stephen J. Turnbull
Brett Cannon
Guido van Rossum
martin
Guido van Rossum
Antoine Pitrou
|