Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #40178
| From | Stefan Behnel <stefan_ml@behnel.de> |
|---|---|
| Subject | Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? |
| Date | 2013-02-28 22:03 +0100 |
| References | <b428fdef-a577-45c0-b37c-60bde74e3ae1@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2677.1362085404.2939.python-list@python.org> (permalink) |
kramer65, 28.02.2013 21:25: > I'm using Python for a while now and I love it. There is just one thing > I cannot understand. There are compilers for languages like C and C++. > why is it impossible to create a compiler that can compile Python code > to machinecode? All projects that implement such compilers prove that it's quite possible. The most widely used static Python compiler is Cython, but there are also a couple of experimental compilers that do similar things in more or less useful or usable ways. And there are also a couple of projects that do dynamic runtime compilation, most notably PyPy and Numba. You may want to take a look at the Python implementations page, specifically the list of Python compilers: http://wiki.python.org/moin/PythonImplementations#Compilers > Does machinecode always need to know whether a variable is an int or a > float? Not at all. You're mixing different levels of abstraction here. > And if so, can't you build a compiler which creates machinecode > that can handle both ints and floats in case of doubt? Sure. Cython does just that, for example, unless you tell it explicitly to restrict a variable to a specific type. Basically, you get Python semantics by default and C semantics if you want to. Stefan
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Why is it impossible to create a compiler than can compile Python to machinecode like C? kramer65 <kramerh@gmail.com> - 2013-02-28 12:25 -0800
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Matty Sarro <msarro@gmail.com> - 2013-02-28 15:50 -0500
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-01 02:55 +0000
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Stefan Behnel <stefan_ml@behnel.de> - 2013-02-28 22:03 +0100
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-01 03:47 +0000
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? alex23 <wuwei23@gmail.com> - 2013-02-28 20:31 -0800
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Stefan Behnel <stefan_ml@behnel.de> - 2013-03-01 08:48 +0100
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-02 01:49 +0000
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Chris Angelico <rosuav@gmail.com> - 2013-03-01 08:10 +1100
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Stefan Behnel <stefan_ml@behnel.de> - 2013-02-28 22:17 +0100
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Dave Angel <davea@davea.name> - 2013-02-28 16:18 -0500
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Modulok <modulok@gmail.com> - 2013-02-28 14:19 -0700
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Jonas Geiregat <jonas@geiregat.org> - 2013-02-28 22:33 +0100
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Nobody <nobody@nowhere.com> - 2013-02-28 22:01 +0000
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Terry Reedy <tjreedy@udel.edu> - 2013-02-28 17:06 -0500
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-02-28 21:09 -0500
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-01 04:27 +0000
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? alex23 <wuwei23@gmail.com> - 2013-02-28 20:38 -0800
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? 88888 Dihedral <dihedral88888@googlemail.com> - 2013-02-28 22:21 -0800
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Grant Edwards <invalid@invalid.invalid> - 2013-03-04 16:36 +0000
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? CM <cmpython@gmail.com> - 2013-03-04 14:55 -0800
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? 88888 Dihedral <dihedral88888@googlemail.com> - 2013-03-04 15:12 -0800
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Terry Reedy <tjreedy@udel.edu> - 2013-03-04 19:31 -0500
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Chris Angelico <rosuav@gmail.com> - 2013-03-05 11:33 +1100
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Benjamin Kaplan <benjamin.kaplan@case.edu> - 2013-03-04 16:27 -0800
Re: Why is it impossible to create a compiler than can compile Python to machinecode like C? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-05 01:35 +0000
csiph-web