I decided to just do it and throw together .NET bindings for Tinymail. They are nearly finished and looking great. I might never have told anybody, but a really sweet looking E-mail API for my favorite programming language C# was my original reason when I started Tinymail.
While I was doing Tinymail I of course learned about D, so now C# as a programming language might have to compete with D. Meanwhile Jürg did Vala too. To make sure OLPC would have a reason to take a look at Tinymail I fiddled around with Python bindings too. Mark Doffman made these bindings actually usable. Meanwhile Jürg made the Vala bindings for Tinymail. Just for fun.
That brings us at three bindings for Tinymail: .NET, Python and Vala. I’m hoping to add C++ to that list soon. I’m planning to do this in a way that makes the library sensible to use for Qt developers. This of course implies dealing with mainloop integration and providing a few standard models and views to get a typical Qt E-mail client developer quickly going. I’m not a big fan of C++ but I was pragmatic about GObject and C when I started Tinymail too.
I have some sort of goal in my mind and if I have to do twice as much work to get it working without my favorite tools, then well, that’s what it takes. Politics and religion just makes it more difficult to reach your goals, so I’m not very interested in .NET fans, Python fans, C++ fans, Qt fans and GNOME fans cheerleading because their favorite tech is being used (which is not the point of technology and innovation anyway). I do care about the technical implications of depending on something like a virtual machine, though. Especially since Tinymail has a focus on mobile.
Mono has an ARM port, so it’s usually not really a technical limitation. On top of that I found out about GC.AddMemoryPressure in .NET. Tinymail holds significant large resources that your garbage collector doesn’t know about. With GC.AddMemoryPressure you can easily teach the .NET garbage collector about these non-managed resources.
Something like GC.AddMemoryPressure is really a missing feature in Python in my opinion. When your E-mail client uses mostly the managed higher programming language just for invoking functionality implemented in C, not a lot of Python executions will occur during runtime. This means that Python’s garbage collector is only rarely called to do a collect. Unless you do gc.collect() at an intelligent location, your Python E-mail client will keep instances around for a very long time. In .NET, with GC.AddMemoryPressure, you can tell the virtual machine’s garbage collector that an external resource is significant enough to care about it more. It’s not as drastic as doing a GC.Collect() in .NET. GC.Collect is not recommended by Microsoft, since the .NET garbage collector is supposed to learn from the past to try to predict the future. If you GC.Collect(), you circumvent this. Using GC.AddMemoryPressure you don’t really do anything bad for the garbage collector. You just inform it about the significance of an external resource.
Regretfully, and I already asked Miguel, doesn’t the Mono runtime care about GC.AddMemoryPressure. But the API is available for when Mono’s garbage collector will be adapted to do care about it. Microsoft’s virtual machine does care, by the way.
Nice would be porting GObject to WinCE and then bringing Tinymail to that platform. Making a Tinymail based E-mail client with either Compact Framework .NET or Mono sounds like a fun project.
Meanwhile, Modest is doing great too. I’m still waiting a little bit with Tinymail’s first release. I would like to give the Modest team as gift when they release their first, Tinymail’s 1.0 release. I think we are nearing that moment.
In case you aren’t aware already, python immediately frees objects when their reference count hits zero. If you write your code to have no circular references (which at least for me generally happens naturally), the python garbage collector won’t be doing anything except wasting cycles.
D offers everything people choose C# for but is native, cross platform (Nokia has tried it on their N Linux series) and using the GCC backend, competes with C/C++ for the fastest language on this planet.
I translated a C# GTK example using alpha/compositing stuff in just a few minutes to D (using GtkD bindings) and was surprised. A true binary written in a C# like language, heck even linked against shared C libraries is awesome.
I haven’t played with C#, but I’m really liking D. It’s a bit of a shame that (AFAIK) none of the D compilers work on any of the BSDs just yet.