Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

It fakes being a dynamically-typed language by inference. This makes it seem much like Python's simple and programmer-friendly syntax.

Code Block
titleC#
borderStylesolid
titleC#
int i = 0;
MyClass m = new MyClass();
Code Block
titleBoo
borderStylesolid
titleBoo
i = 0
m = MyClass()

Hello, World!
Anchor
Hello, World
Hello, World

A Hello, World! program is very simple in Boo.
Don't worry if you don't understand it, I'll go through it one step at a time.

Code Block
borderStylesolid
titlehelloworld.boo
borderStylesolid
print "Hello, World!"
//    OR
print("Hello, World!")
No Format
bgColor#D8DDE9
titleOutput
borderStylesolid
titleOutput
Hello, World!
Hello, World!

...

Now you may be wondering how Boo could be as fast as C# or VB.NET.
Using their Hello World programs, I'll show you.

Code Block
titleBoo
borderStylesolid
titleBoo
print "Hello, World!"
No Format
bgColor#D8DDE9
borderStylesolid
titleBoo Output
borderStylesolid
Hello, World!
Code Block
titleC#
borderStylesolid
titleC#
public class Hello
{
  public static void Main()
  {
    System.Console.WriteLine("Hello World!");
  }
}
No Format
bgColor#D8DDE9
borderStylesolid
titleC# Output
borderStylesolid
Hello, World!
Code Block
borderStylesolid
titleVB.NET
borderStylesolid
Public Class Hello
  Public Shared Sub Main()
    System.Console.WriteLine("Hello World!")
  End Sub
End Class
No Format
bgColor#D8DDE9
borderStylesolid
titleVB.NET Output
borderStylesolid
Hello, World!

All three have the same end result and all three are run in the .NET Framework.
All three are first translated into MSIL, then into executable files.

If you were to take the executables created by their compilers, and disassemble them with ildasm.exe, you would see a very similar end result, which means that the executables themselves are very similar, so the speed between C# and Boo is practically the same, it just takes less time to write the Boo code.

...

Here's what booish will look like:

No Format
bgColor#dddd88
titlebooish
borderStylesolid
titlebooish
borderColor#ffffff
>>> print "Hello, World!"
Hello, World!
>>>

...