Boo 与 IronPython

发布于 2024-07-06 17:10:23 字数 114 浏览 8 评论 0 原文

查看这两个项目后,发现两者非常相似。 两者都运行在 CLI 之上,都具有 python 样式语法,都使用 .NET 而不是标准 python 库。

那么,它们之间有什么区别以及各自的优点呢?

After having looked at each of these two projects, it seems that both are VERY similar. Both run on top of the CLI, both have python style syntax, both use .NET instead of the standard python libraries.

So, what are the differences between them and advantages of each?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

探春 2024-07-13 17:10:23

我认为主要的区别在于 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 and targets 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).

烟凡古楼 2024-07-13 17:10:23

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.

如日中天 2024-07-13 17:10:23

我还没有使用过 IronPython,但这是我对 Boo 的了解...

  • Boo 受到 Python 的启发,并且有许多语法相似之处。 有关差异,请参阅 http://boo.codehaus.org/Gotchas+for+Python+Users
  • Boo 是专门为 CLR 编写的,
  • 它是静态类型的,这有几个好处
    • 它可以编译为DLL并由VB和C#项目引用
    • 您可以在 IDE 中完成代码
  • 语言本身(如果可扩展)。 您可以编写“语法宏”并实际向语言添加新元素。 这使得它成为编写 DSL 的良好候选者。
  • 它还没有到 1.0,而 IronPython 已经到了。 该语言仍在经历成长的痛苦,但仍然非常有用。

我使用 Boo 来完成以下任务:

  • 编写预定作业的脚本。 它是 VBScript、BAT 文件的绝佳替代品,特别是在访问 .NET API 时。 从那时起,我主要改用 Powershell,但它是特定于操作系统的,并且语法更重,所以我仍然使用 Boo 来做一些事情。
  • 编写单元测试
  • 嵌入式脚本语言

I haven't used IronPython yet, but here's what I know about Boo...

  • Boo was inspired by Python and has many syntatic similarities. For differences, see http://boo.codehaus.org/Gotchas+for+Python+Users
  • Boo was written specifically for the CLR
  • It is statically typed, which has several benefits
    • It can be compiled to a DLL and referenced by VB and C# projects
    • you get code-completion in IDEs
  • The language itself if extensible. You can write "syntactic macros" and actually add new elements to the language. This makes it a good candidate for writing DSLs.
  • It is not yet at 1.0 yet, while IronPython is. The language is still going through growing pains, but is still very usable.

I've used Boo for things like:

  • Scripting scheduled jobs. It's a great alternative to VBScript, BAT files, especially if accessing .NET APIs. Since then I mostly switched to Powershell, but it's OS-specific, and has a heavier syntax, so I still use Boo for some stuff.
  • Writing Unit Tests
  • Embedded scripting language
ぃ弥猫深巷。 2024-07-13 17:10:23

我已经用 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.

我也只是我 2024-07-13 17:10:23

我同意 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.

半夏半凉 2024-07-13 17:10:23

在我看来,主要区别在于 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文