Versions Compared


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


Things in Boo but Not Python

  • quickly compile boo script to standalone cross-platform exe
  • easy super(), and constructor automatically calls super() for you. If you don't have a constructor, one is created for you.
  • set class properties via the constructor (constructor doesn't have to handle them explicitly):
    Code Block
    x = MyClass(Property1:"value1", Property2:"value2")
  • Anonymous Closures - including multi-line closures:
    Code Block
    b = Button(Text:"Press Me")
    b.Click += def():
        MessageBox.Show("you clicked me")
  • Events, Callable Types
  • unless statement: print "good job" unless score < 75
  • built-in support for Regular Expressions
  • timespan literals (example: t = 10ms)
  • extensible compiler pipeline
  • custom Syntactic Macros

since boo is statically typed, you get:

  • static typing: "x as int" but you can just say "x" (x is an object)
  • Interfaces, Enums
  • private,public,protected,final,etc. variables & methods
  • speed increases - without having to convert your code to a different language like C
  • easier interoperability since boo uses standard CLI types (e.g. string is System.String, int is a System.Int32...)
  • convert C# and VB.NET to boo code (part of the Boo AddIn For SharpDevelop)

other C#/.NET features you get:

  • "lock" (like java's synchronized). See the lock* examples under tests/testcases/semantics/.
  • property getters and setters
  • using: (automatically disposes of object when you are done using it)
    Code Block
    //in this example you can also use the simpler
    //   "for line in StreamReader("filename"):"
    using f = System.IO.StreamReader(''):
        while line = f.ReadLine():
            print line
  • parameter checking
    Code Block
    def foo([required(value > 3)] value as int):
  • [attributes] for functions, fields, classes...
  • asynchronous execution, see Asynchronous Design Pattern.
  • XML Serialization