为什么Python无法在.net上运行 [英] Why Python won't work on .net

查看:143
本文介绍了为什么Python无法在.net上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Jython是100%java编码的python。

Python对象与javacompilers和虚拟机一起使用。


我是一个业余爱好程序员,所以技术原因是可能超出我...

为什么python与.net不兼容?为什么不能用C#编写python?


我看到linux / unix上的MONO项目正在推进。 .Net似乎是一个

juggernaut,特别是如果程序员能够使用他们最喜欢的(最有价值的b $ b高效)语言来编程。(每种语言,但python)


我是一个新的蟒蛇修补匠。我喜欢这门语言。但是它的未来是什么呢?作为

a传统工具?


allen

解决方案

< blockquote> al**********@aol.com (Allenabethea)写道:

为什么python与.net不兼容?为什么不能用C#编写python?


谁说不能用C#编码。事实上,它当前不是b $ b,但是可以在C#中重新实现Python

解释器(而不是在C中实现它) 。


至于生成MSIL字节代码:这也是可能的,并且已经演示了

。事实证明,最初的实现可能非常慢*


问题是.NET的Python实现是否会是CLS

兼容(CLS ==公共语言规范)。现有的

实现表明,如果不放弃部分Python语义,这是不可能的。


我是一个新蟒蛇修补匠。我喜欢这门语言。但它的未来是什么呢?作为一种传统工具?




相反,大多数.NET用户会发现.NET不是* a *

juggernaut,但在实践中仅限于C#。所以Python甚至可能会在.NET中存活下来:-)


说:如果你认为Python-.NET的故事应该是更好的,那么/>
随时可以贡献。 Python是一项志愿者工作,没有

志愿者,就没有进展。在开始之前,请查看优秀的Python-for-.NET,它使用本机代码

Python实现来托管.NET,从而使Python程序更加完整访问

到框架。


问候,

马丁


Allenabethea写道:

我是一个新的蟒蛇修补匠。我喜欢这门语言。但它的
未来是什么呢?作为传统工具?

allen




据我所知到目前为止.net很适合客户端服务器,但不是很好的独立,因为需要.net运行时来运行,这会产生很大的开销。性能也是一个问题,

因为所有内容都编译JIT。我认为这就是为什么虽然.net是一个很棒的想法,很多语言仍然是首选的语言

独立/没有运行时/速度关键/交叉平台应用。我b $ b可能是错的,但我不认为我离真相很远。


Gustavo Campanelli


al ********** @ aol.com (Allenabethea)写道:

我是一个新的蟒蛇修补匠。我喜欢这门语言。但是它的未来是什么呢?作为一种传统工具?




什么,.NET突然变得流行而我不是/>
在看?整个世界几乎没有在.NET平台上跳跃,实际上大多数人似乎忽略了它......


或者这是一些巨魔你可能还想看看:

http://zope.org/Members/Brian/PythonNet/

-

Ville Vainio http://www.students.tut.fi/~vainio24


Jython is 100% java coded python.
Python objects work with javacompilers and Virtual machines.

I am a hobby programmer so the technical reasons are probably beyond me...
Why is python incompatible with .net? Why can''t python be coded in C#?

I see the the MONO project on linux/unix is advancing. .Net seems to be a
juggernaut especially if programmers will be able to use their favorite(most
productive) language to program in. (every language but python)

I am a new python tinkerer. I love the language. But what is its future but as
a legacy tool?

allen

解决方案

al**********@aol.com (Allenabethea) writes:

Why is python incompatible with .net? Why can''t python be coded in
C#?
Who says that it cannot be coded in C#. It is a matter of fact that it
currently isn''t, but it would be possible to reimplement the Python
interpreter in C# (instead of implementing it in C).

As for generating MSIL byte codes: This is also possible, and has been
demonstrated. It also has been demonstrated that an initial
implementation is likely to be *very* slow.

The question is whether a Python implementation for .NET would be CLS
compliant (CLS == Common Language Specification). The existing
implementation has shown that this is not possible without giving up
parts of the Python semantics.

I am a new python tinkerer. I love the language. But what is its
future but as a legacy tool?



No. Instead, most .NET users will find out that .NET is *not* a
juggernaut, but restricted to C#, in practice. So Python might even
survive .NET :-)

That said: If you think the Python-.NET story should be a better one,
feel free to contribute. Python is a volunteer effort, and without
volunteers, there will be no progress. Before starting, please have a
look at the excellent Python-for-.NET, which uses the native-code
Python implementation to host .NET, giving Python programs full access
to the framework.

Regards,
Martin


Allenabethea wrote:

I am a new python tinkerer. I love the language. But what is its future but as a legacy tool?

allen



As far as I''ve learned so far, .net is good for client server but not
that great for standalone because of the need for the .net runtime to
run things, which creates a large overhead. Performance is an issue too,
as everything compiles JIT. I think that''s why although .net is a great
idea, a lot of languages will remain language of choice for
standalone/no runtimes/speed critical/cross platform aplications. I
could be wrong, but I don''t think I''m far from the truth.

Gustavo Campanelli


al**********@aol.com (Allenabethea) writes:

I am a new python tinkerer. I love the language. But what is its
future but as a legacy tool?



What, has .NET suddenly turned out to be popular while I wasn''t
watching? The whole world is hardly jumping on the .NET platform,
actually mostly people seem to be ignoring it...

Or is this a troll of some kind?

You might also want to take a look at:

http://zope.org/Members/Brian/PythonNet/

--
Ville Vainio http://www.students.tut.fi/~vainio24


这篇关于为什么Python无法在.net上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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