Boo 与 IronPython
查看这两个项目后,发现两者非常相似。 两者都运行在 CLI 之上,都具有 python 样式语法,都使用 .NET 而不是标准 python 库。
那么,它们之间有什么区别以及各自的优点呢?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
查看这两个项目后,发现两者非常相似。 两者都运行在 CLI 之上,都具有 python 样式语法,都使用 .NET 而不是标准 python 库。
那么,它们之间有什么区别以及各自的优点呢?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(7)
我认为主要的区别在于 Boo 是静态类型的,这意味着变量的类型是在第一次赋值时推断出来的,并从那里固定下来 - 而 IronPython 具有普通 Python 代码的“真正”动态行为。
IronPython
现在由 Microsoft 正式维护,面向 2.0 版中的新动态语言运行时。 我怀疑由于 Boo 的静态类型性质,它可能会更快。 不过,我对此没有太多“真实”经验……IronPython 还重新实现了许多 Python 标准库,因此您可以在 IronPython 上运行许多 Python 软件,而无需进行任何更改(例如 Django)。
The main difference as I see it is that Boo is statically typed, meaning the type of a variable is inferred on its first assignment and is fixed from there - while IronPython has the "real" dynamic behaviour of normal Python code.
IronPython
is officially maintained by Microsoft now andtargets the new Dynamic Language Runtime in version 2.0. I suspect because of it's statically typed nature Boo might be faster. I don't have much "real" experience with that though ...IronPython also reimplements lots of the python standard library so you can run lots of python software without change on IronPython (e.g. Django).
Boo 是静态类型的,但有可选的鸭子类型(根据我的经验,效果相当好)。 Boo 还专门设计为“手腕友好型”——换句话说,最大限度地减少使用 Shift 键组合的需要。 它在 SharpDevelop 中具有良好的 IDE 支持。
很明显,Boo 从 Python 中汲取了很多灵感,但也旨在充分利用 .NET 功能。
在性能方面,Boo 感觉比 IronPython 稍快一些,特别是没有 IronPython 明显的启动滞后。
Boo仍然是一种不成熟的语言,并且缺乏Python的社区。 我个人对于在生产中使用它有点谨慎。 另外,我不同意它与 Python 的所有区别,例如在类中删除显式的 self。
Boo is statically typed, but has optional duck typing (which works fairly well, in my experience). Boo is also specifically designed to be "wrist friendly" -- in other words, to minimize the need to use Shift-key combinations. It has good IDE support in SharpDevelop.
As is pretty evident, Boo takes a lot of inspiration from Python, but is also designed to take good advantage of .NET features.
Performance-wise, Boo feels marginally faster than IronPython, and in particular lacks the noticeable startup lag of IronPython.
Boo is still an immature language, and lacks the community of Python. I'd personally be a bit wary about using it in production. Also, I don't agree with all the departures it's made from Python, such as getting rid of explicit self in classes.
我还没有使用过 IronPython,但这是我对 Boo 的了解...
我使用 Boo 来完成以下任务:
I haven't used IronPython yet, but here's what I know about Boo...
I've used Boo for things like:
正如 Winston 所说,Boo 由于其开放的编译器架构而具有很强的可扩展性,请查看以下示例:
Like Winston said, Boo is very extensible due to its open compiler architecture, take a look at these examples:
我已经用 Boo 和 IronPython 编写了应用程序。 对我来说,IronPython 是更强大的选择,而且我在 CPython 端口中编写的大部分内容都没有进行任何更改。 如果针对 .Net Framework,所有最近的项目都是纯 IronPython。
自从 Jim“叛逃”到 Microsoft 后,IronPython 已被提升为顶级语言。 甚至还有 Visual Studio。
I have written applications in both Boo and IronPython. For me IronPython has been the more robust choice and much of what I've written in CPython ports without changes. All recent projects have been pure IronPython if targeted for .Net Framework.
Since Jim "defected" to Microsoft, IronPython has been elevated to a top tier language. There's even Visual Studio for it.
我同意 VolkA 的观点。 能够运行 Django 是件大事。 这是一个如此令人惊叹的框架,Boo 很难重做它。 如今,问题更多的是语言提供的框架,而不是语言提供的构造。 而且 Boo 在其支持的结构方面并没有比 Python 提供太多改进。
I agree with VolkA here. Being able to run Django is big. It's just such an amazing framework, that Boo will have a hard time redoing it. Today it's more a question of the frameworks that a language provides, than it is the construct that it provides. And Boo doesn't provide much improvements over Python in the constructs it support.
在我看来,主要区别在于 IronPython 是成熟语言的实现 - 而 Boo 更年轻,也不太出名。
The main difference, in my opinion, is that IronPython is an implementation of a mature language - while Boo is younger and less known.