To many developers, the term “metaprogramming” conjures up images of bizarre rituals performed in esoteric Lisp interpreters. Others hear the term and think of the messy, write-only world of C++ templates and the dark horrors that lurk within the error messages they generate. But metaprogramming is a surprisingly simple technique that, once understood, can greatly enhance your productivity by literally moving your development to a higher level: instead of programming your code, you’re programming your programming language itself!
This presentation focuses on the Boo language, a friendly, easy to grasp, strongly typed language for the CLR. Boo was designed with metaprogramming in mind, and it contains several language features to enhance your productivity as a developer, from basic macros and meta methods to simplify redundant tasks, to code-transforming AST attributes, to full-on code generation, to a customizable compiler pipeline that offers full control over the compilation process for projects that need it.
Among other things, attendees will learn about using Boo and its metaprogramming facilities to create frameworks to simplify common, repetitive tasks, how to create code generators, code transformers, and code verifiers and integrate them into your project, and how to deal with those annoying cases every large project faces where adding a new piece of data requires changes in half a dozen places scattered throughout your codebase.
With the CoreCLR project, Microsoft has released the source to the runtime on GitHub and is welcoming community contributions. Ports to new platforms have already been contributed and officially accepted by the CoreCLR team, including OSX and FreeBSD, and an effort is currently underway, by myself and a few other developers, to produce an Android port. It is expected to be complete by the time Code Camp rolls around.
This topic will cover the process of creating this port and lessons learned along the way, as well as coding topics such as interoperability with the Java/Dalvik side of the system, differences for Windows developers to be aware of, and showcasing actual Android CLR development.