为什么不是Python编译器? [英] Why not a Python compiler?

查看:76
本文介绍了为什么不是Python编译器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



(肯定如果这个问题已被问过多次......)

(对不起我的英文!)


我对python印象深刻。我对这种语言非常满意,而且我发现Python + Pygame是一种非常强大且富有成效的2D / $
游戏编写方式。在这一刻,我不是很担心我正在努力的小型游戏的执行速度(即使在旧的AMD中也能以60 fps的速度运行 -

K6 450笔记本电脑),但我继续问我同样的问题:


为什么不是Python编译器?


它会很高兴能够输出Linux,MAC或Windows

编译(非字节编译)代码的二进制文件。它会运行得更快,它的尺寸会更小(我认为)并且它很容易分发给没有安装python的人。
。是的,我知道py2exe,但是我不知道这是不是正确的方法。


那么,有什么不对编译python?


由于语言的性质,可能不可能?只是一个

的决定?


你对此有何看法?


( Surely if this question has been asked for a zillion of times... )
( and sorry for my english! )

I''m impressed with python. I''m very happy with the language and I
find Python+Pygame a very powerful and productive way of writing 2D
games. I''m not, at this moment, worried about execution speed of the
small game I''m working on (it runs at full 60 fps even in an old AMD-
K6 450 Laptop computer), but I continue asking me the same question:

Why not a Python COMPILER?

It would be very nice to be able to output Linux, MAC or Windows
binaries of compiled (not bytecompiled) code. It would run faster, it
will be smaller in size (I think) and it will be easy to distribute to
people not having python installed. Yes, I know about py2exe, but I''m
not sure if that''s the right aproach.

So, what''s wrong with compiling python?

Maybe is not possible due to nature of the language? Is just a
decision?

What do you think about this?

推荐答案

2月5日上午9:19,Santiago Romero< srom ... @ gmail.comwrote:
On Feb 5, 9:19 am, Santiago Romero <srom...@gmail.comwrote:

(当然,如果这个问题已被要求几十亿次......)

(对不起我的英文!)


我对python印象深刻。我对这种语言非常满意,而且我发现Python + Pygame是一种非常强大且富有成效的2D / $
游戏编写方式。在这一刻,我不是很担心我正在努力的小型游戏的执行速度(即使在旧的AMD中也能以60 fps的速度运行 -

K6 450笔记本电脑),但我继续问我同样的问题:


为什么不是Python编译器?


它会很高兴能够输出Linux,MAC或Windows

编译(非字节编译)代码的二进制文件。它会运行得更快,它的尺寸会更小(我认为)并且它很容易分发给没有安装python的人。
。是的,我知道py2exe,但是我不知道这是不是正确的方法。


那么,有什么不对编译python?


由于语言的性质,可能不可能?只是一个

的决定?


您如何看待这个?
( Surely if this question has been asked for a zillion of times... )
( and sorry for my english! )

I''m impressed with python. I''m very happy with the language and I
find Python+Pygame a very powerful and productive way of writing 2D
games. I''m not, at this moment, worried about execution speed of the
small game I''m working on (it runs at full 60 fps even in an old AMD-
K6 450 Laptop computer), but I continue asking me the same question:

Why not a Python COMPILER?

It would be very nice to be able to output Linux, MAC or Windows
binaries of compiled (not bytecompiled) code. It would run faster, it
will be smaller in size (I think) and it will be easy to distribute to
people not having python installed. Yes, I know about py2exe, but I''m
not sure if that''s the right aproach.

So, what''s wrong with compiling python?

Maybe is not possible due to nature of the language? Is just a
decision?

What do you think about this?



我不知道确切的细节,但我认为问题是动态的,因为Python的性质使得无法正确存储各种

类型和对已编译代码的更改。其他人可能会提供一个很好的理由,说明为什么它不可行,也不是一个好主意。如果你想加速你对Psyco的python看法。
http://psyco.sourceforge .net /


-On [20080205 09:22],Santiago Romero(sr*****@gmail.com)写道:
-On [20080205 09:22], Santiago Romero (sr*****@gmail.com) wrote:

为什么不是Python编译器?
Why not a Python COMPILER?



Python中的很多东西都是依赖于运行时的,所以创建一个

编译器并不是一件容易的事。
<然而,有一些努力正在进行,如皮肤脱落:

http://code.google.com/p/shedskin/

这提供了一个Python到C ++编译器,但它强制执行一些限制on

Python的代码。


-

Jeroen Ruigrok van der Werven< asmodai(-at-) in-nomine.org/ asmodai

??¤??§??????????????????????????? '????? 3 ?????? ?? | ??§?????'??§?? 3
http://www.in-nomine.org/ | http://www.rangaku.org/

我们我遇见了敌人,他们是我们的...

A lot of things within Python are very run-time dependent so creating a
compiler is not trivial work.

There are, however, endeavours underway like shed skin:

http://code.google.com/p/shedskin/

This provides a Python to C++ compiler, but it enforces some restrictions on
Python''s code.

--
Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org/ asmodai
??¤??§????????3 ?????|?????*?????ˉ ??′?????3 ?????? ??|??§?????′??§??3
http://www.in-nomine.org/ | http://www.rangaku.org/
We have met the enemy and they are ours...


2月5日上午9:19,Santiago Romero< srom ... @ gmail.comwrote:
On Feb 5, 9:19 am, Santiago Romero <srom...@gmail.comwrote:

(当然,如果这个问题已被问过多次......)
( Surely if this question has been asked for a zillion of times... )



当然。您可以通过google.google.com访问comp.lang.python。它有一个

搜索功能。

Sure. You can access comp.lang.python via google.google.com. It has a
search function.


这篇关于为什么不是Python编译器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆