SUMMARY: Monkey Space is the annual conference on cross-platform and open source .NET development. At $300, it was money well spent. Mono/.NET code is running on all major devices and represents a compelling platform for flexible, performant, future-proof development. Things to keep an eye on: Xamarin for mobile development, ServiceStack for web services, Type Providers for type-safe access to just about anything.
Below are my notes from the talks I attended...
Keynote by Miguel de Icaza
- Casual gaming platform for Sony and Nintendo mobiles is Mono-based.
- Unity also leverages Mono
- Mono 3 is out and includes a fully-featured C# 5 compiler
- Half Xamarin sales are iOS, half are Android
- Forecast that in five years everyone will have mobile device
- no longer to port Microsoft APIs to other platforms
- rather exposing every native feature on every platform
- ServiceStack is becoming industry darling for web services (Mono first)
- aggressive optimizations
- LLVM optimizer
- will hardware accelerate some data types like matrix (OpenTK, XNA)
- static analysis tools
- working on profiling tools
I heard that this was Demis' first talk on ServiceStack. If so, the only reason I might suspect that is that he had enough material to fill a day. It was my favorite session at the conference.
The slides are available on slideshare: http://www.slideshare.net/newmovie/what-istheservicestack-14819151
Demis described his past experience at the BBC, and how their zeal to do everything the right way lead to a slow, unwieldy architecture. He used this to motivate the discussion of ServiceStack's design choices such as a fast JSON parser, few dependencies, POCO DTO's (Plain Old CLR Object) (Data Transfer Object), etc.
What we did right at the BBC
- message queues
What is a Service
- reusable capabilities available remotely
- many clients
- accessible, interoperable
Some Interesting Features
- Supports Google protocol buffers
- IAuthProvider for authentication
- Develop on Windows but deploy to Linux so can scale at $0 license cost.
- See git-deploy
F# 3.0 by Don Syme
Don Syme presented some of the latest features of F# 3.0. Of particular interest were Type Providers. Type Providers are a tool for generating rich static types for data and functions that are normally accessed dynamically. He demonstrated accessing data from Freebase.
Dr. Syme is clearly an advocate of functional and multi-paradigm programming. My favorite quote from the talk was: "The dark days of object fundamentalism are past us" ... "we got lambdas in C++".
Here are some interesting links for diving deeper:
- Developing F# Type Providers
- The future of .NET lies in Mono. The future of F# lies in MonoDevelop
Moving to Mobile by Somya Jain
Somya described the pitfalls he ran into when transitioning to mobile development.
- constrained. No swap.
- varies by device
- low memory warning
- Memory bugs
- Long lived references not GC'd
- How to detect?
- Instruments (iOS)
- Use zombies to detect objects used after freed
- Android Memory Profiling
- Instruments (iOS)
- Decoding, scaling, cropping happen on main thread
- do some things on background thread
- use in memory caching tools
- NSCache (iOS) LRUCache (android)
- Slow, intermittent
- 3G v WiFi
- Use multiple network connections (e.g. Downloading multiple files e.g. 4 at a time)
- use caching, offline mode
- consider pre-loading data when know the user's steps
- do performance intensive stuff on b/g
- consider gpu
Tip: Always test performance on the device (worst one required)
Simple, lightweight, but no automatic relationships
Can use multiple on same project to leverage their strengths
- Use POCOs or Dynamic
- Intellisense with POCOs
- caches reflection mapping
- optimized for writing
- uses ExpandoObject for reading
- serializing an expandoObject to JSON does so as a dictionary; not quite what you expect
- ActiveRecord-like hooks like AfterUpdate
- Syntax is easy to grok
- Mocking support out of the box
- using SimpleData.Mocking ... MockHelper.UseMockAdapter(new InMemoryAdapter())
- Can get back a dynamic or strong-typed object
- ActiveRecord-like FindBy
See tool called Project Linker for synchronizing projects and content compilation
Graffiti is "a cross-platform high-performance rendering engine" optimized for mobile hardware.
- retained mode
- time-driven animations, independent of frame rate
- takes advantage of C# syntax
- uses XNA Reach profile for low power hardware
- Can set code formatting policies per solution