简体   繁体   English

Boo 100%C#兼容吗?

[英]Is Boo 100% C# compatible?

Boo seems like a very cool language. Boo似乎是一种非常酷的语言。 Is it 100% C# compatible? 是100%C#兼容吗? I mean: can I use any C# DLL/class? 我的意思是:我可以使用任何C#DLL /类吗? Could I make use of the XNA framework? 我可以使用XNA框架吗?

As far as I know, Boo has an implementation on top of the .NET CLR - which implies that it should be able to both consume, and be consumed by C# code. 据我所知,Boo在.NET CLR之上有一个实现 - 这意味着它应该能够消费并被C#代码消耗。 The syntax may not always be pretty when consuming Boo from C# - but the opposite should be quite elegant, given Boo's syntax. 从C#中消费Boo时,语法可能并不总是很漂亮 - 但考虑到Boo的语法,相反应该相当优雅。

Also, all of the classes in the .NET BCL should be available to you in Boo. 此外,.NET BCL中的所有类都应该可以在Boo中使用。

Yes Boo is easily consumed by C# and vice versa. 是的Boo很容易被C#消耗,反之亦然。 Most of the best features of Boo don't carry over to C#, such as syntactic macros, for obvious reasons, but you can create Macros in C# and consume them in Boo. 由于显而易见的原因,Boo的大多数最佳功能都没有转移到C#,例如语法宏,但是您可以在C#中创建宏并在Boo中使用它们。 Additionally Boo has the nice feature of being able to create Modules, which is something you can't do in C#. 此外,Boo具有能够创建模块的优点,这是您在C#中无法做到的。

They both can create extension methods. 他们都可以创建扩展方法。 Boo has 'duck' typing while C# now has the "dynamic" keyword. Boo有'鸭子'打字,而C#现在有“动态”关键字。 While they're both functionally equivalent you might end up seeing the two merge eventually. 虽然它们在功能上都是等价的,但最终可能会看到两个合并。

Boo currently has known issues with generics, but the feature will be completely supported once they are all ironed out. Boo目前已经知道泛型问题,但一旦完成这些功能,该功能将得到完全支持。 I suspect there will have to be some extra work done to support the new Co/Contra-variance features in .NET 4 as well. 我怀疑还需要做一些额外的工作来支持.NET 4中新的Co / Contra-variance功能。

It would be no different than using VB.NET with C#. 与使用C#的VB.NET没有什么不同。 Currently the only big different between the two (functionally) is Boo does not have pointers... but there are ways to handle that. 目前两者之间唯一的大不同(功能上)是Boo没有指针......但是有办法解决这个问题。

PS: Boo IS a wonderful language. PS:Boo是一种很棒的语言。

IIRC, any language which compiles into IL (Intermediate Language, .NET's version of Java's bytecode) can work with any other language which does the same. IIRC,任何编译成IL(中间语言,.NET的Java字节码版本)的语言都可以与任何其他语言相同。 So you can mix C#, F#, ASP.NET, VB.NET, and if Boo does the same, you should be able to use with with C# as well. 所以你可以混合C#,F#,ASP.NET,VB.NET,如果Boo做同样的事情,你也应该能够使用C#。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM