Boo vs. IronPython

2019-02-05 15:42发布

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?

7条回答
何必那么认真
3楼-- · 2019-02-05 15:50

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
查看更多
太酷不给撩
4楼-- · 2019-02-05 15:50

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.

查看更多
Animai°情兽
5楼-- · 2019-02-05 15:58

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.

查看更多
时光不老,我们不散
6楼-- · 2019-02-05 16:00

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).

查看更多
The star\"
7楼-- · 2019-02-05 16:08

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.

查看更多
登录 后发表回答