- It's Pragmatically Pythonic - The basic syntax of functions and data structures is ripped directly from Python, so most things work like you'd expect if you have a little experience in a procedural language.
- It's .NET-ish - Boo has tuples, lists, and dictionaries just like Python, but they descend from System.Collections types, which means you can use the rich set of operations provided by the .NET Framework. And of course, Boo interoperates with every other .NET language.
- First-Class Functions - Like Python, you can throw around anonymous functions, but Boo provides an even more elegant (for Perl values of elegant) lambda syntax that supports free-form code. And, of course, it supports closures.
- Regex Literals - If you want to create a Regex object, just put it in
//(or, if your regex has whitespace, use@//). Want to match against a regex? Use the=~operator. Sadly, though, that's where the Perl-ish syntax stops. Replacement and splitting, for example, use the more OO-ish methods//.Replace(subject, replacement)and//.Split(subject). - Duck Typing - I know what you're thinking — "Ducks can't type, they have webbed feet!" Duck typing is a programmer convenience where you tell the compiler not to worry about what type an object is. Ordinarily, Boo is statically typed, but by declaring an object to be a duck, you can selectively make objects work like Python's "if it walks like a duck and talks like a duck, then it must be a duck" attitude, where the existence of methods and properties are checked at runtime. If you really like playing fast and loose, you can even tell Boo that all your objects are ducks.
- Three Ways To Play - Boo has a well designed (if a bit buggy) interactive shell
booish, an interpreterbooi, and a compilerbooc. Compiled Boo code runs in the same .NET runtime as things like C#, so it's fast. - Other Fun - Boo also features type inferencing so you don't have to declare types for simple assignments, generators (both as expressions and as functions using
yield), list comprehensions, enumerations, rectangular arrays, and compiler macros (suck it, LISP!).
I've been using Boo for about a day, and here's where it sits on my list of Favorite Programming Languages:
- Perl
- JavaScript
- Boo
- Lua
- Python
- C#
It's good stuff. And Miku's a fan as well. :)
(Actually, that's a partial reference to this set of bizarre Japanese McDonald's commercials, but I like it anyway)