May 23, 2007
This article was contributed by Joseph Quigley
Imagine taking a Ford engine, a Chevrolet chassis, and a Toyota transmission, bolting them together, and discovering that they fit perfectly.
In the programming world, Rodrigo Barreto de Oliveira created such a vehicle. Around the year 2003, de Oliveira was unhappy with some of the
.Net/Mono languages at the time because none of the stable ones were Python-like.
De Oliveira said that he missed the "wrist-friendly" Python syntax. He created his own language,
Boo, and explains in the
Boo Manifesto
[pdf]: "I wanted a language I could extend with my own constructs. I wanted a compiler system that could be taught new things, taught how to automagically [sic] generate common code for me." The language caught on, and several sites hosted Boo projects or created communities around it.
Boo is an object-oriented, statically-typed programming language that makes use of the .Net Common Language Infrastructure. It is licensed under an open-source MIT/BSD-style license, and because it is built upon the Mono or Microsoft .Net framework, it is cross-platform and can be extended significantly. Boo supports Unicode, internationalization, and web-style applications while its language's syntax is Python-inspired. Focusing on both language and compiler extensibility, it features type inference, optional duck typing, currying, first class functions, multimethods, and generators.
The language is quite flexible and adapts to many genres of programming.
It can be used in or written for games, GUI applications and web frameworks
(see the
Boo Applications).
It can interact with most Mono libraries, every CLS-compliant library and most generics. In short, it works with pretty much everything, every library, and every framework for .Net or Mono. In the game world,
BooGame
(a 2D, OpenGL-accelerated,
game engine framework) is similar, if not almost equivalent, to
PyGame.
The commercial Mac OS X Unity game engine has very good support for Boo scripting for both 2D and 3D games.
With Unity, Boo games can even be played from a browser.
Unity is not the only 3D framework that supports Boo.
The open source
Tao framework
supplies OpenGL, Ogre, and
OpenAl
bindings for Boo on both .Net and Mono.
Although not too many web frameworks have been written for Boo, Apache's
mod_mono
makes web development possible. A popular framework is
Webbness, which delivers
functionality similar to
Ruby on Rails
and it generates code in either Boo or C#.
There are several reasons to use Boo over other languages, even though many others (such as Lua)
may have a larger community, have a larger software base, or may be in the news more often. Boo stands out from the crowd since it is appealing to developers due to its simple syntax and well implemented OOP functionality on the .Net/Mono platform. It differs from
IronPython
in several ways because it can provide features and tools that IronPython might never support (due it its very good compatibility with standard CPython).
Unlike some languages, Boo is not designed to replace or be used exclusively as an alternative to C#. Instead it was designed to be extended and to interact with those languages. This allows the programmer to write once in a different languages, and use his code with Boo. In the Boo Manifesto, de Oliveira explains why he created the language. "When I was programming in full Python mode I missed some of the things I'd normally get from a more statically typed environment." He goes on to say, "what I missed the most was the well thought out .net architecture and its great support for Unicode, globalization and web style applications."
Just recently Boo 0.7.7
was released, touting new features primarily involving support for consuming generic methods.
For example, in Boo 0.7.6 one could only use generics with external types. Boo 0.7.7 improved generics support, allowing the programmer to use generics with internal types (which are defined in the Boo assemblies that are to be compiled). It also improved the verify pipeline, making it available on Mono (the pipeline in 0.7.6 only worked well in .Net) and optimized string handling (allowing the coder to generate Gendarme/FXcop-compliant assemblies). Type inference (which is a work in progress) was improved and the release fixed a handful of bugs, mostly inconsistencies in the Boo compiler.
Boo releases come frequently (see the
Boo Release Schedule). The team uploads a new sub-release every month to fix bugs and add a few features. The next major version, Boo 0.8, is in active development and the team is working on improving the compiler even more. Although there isn't much information on the upcoming 0.8 release, the bug tracker has some reported issues with the improved lexical and method syntax as well as some interpreter and duck typing improvements.
Boo was created to fill gaps in Python in order to make a programmer's
job even easier.
Its syntax makes programming a breeze and it can be extended to work in dozens of scenarios.
Whether one wants to create a game, a web site or a GUI application, Boo can lighten the load. The programmer can concentrate on nitty-gritty programing in a different language, while Boo effortlessly interacts with that language.
Almost every other module can be found in the .Net/Mono framework.
Resources
(
Log in to post comments)