Boo, a .NET CLI language similar to Python

I find Boo to be a neat language for the .NET CLI. It is based on python syntax but compiles and uses MSIL. I find it interesting because it allows you to easily extend the language with Syntactic Attributes. These enable you to move your VIM/editor auto completes into the code itself; why should you need to write getter and setter methods over and over? Build in the syntactic sugar as you need it. For example:

// Standard getter/setter
class person:
    FirstName  as string:
        get: 
            return _fname
        set:
            _fname = value
// With Syntactic Attribute
class person:
    [getter(FirstName)]
    _fname as string
For more info see Syntacic Macros One additional note about this code, Boo is statically typed, but the type do not need to be explicitly defined in all parts of the code. Boo will do its best to infer the correct types and make appropriate casts. See Type Inference for more information.

Boo also gives you Macros, some people are probably horrified to hear this, however they enable great things if used properly. I personaly enjoy having macros around for building quick Domain Specific Languages Hopefully I’ll have time to use this in the up coming months.

Related Posts:

Leave a Reply