The annotated version of C# included in the blog post reminds me of Spec# <a href="http://research.microsoft.com/en-us/projects/specsharp/" rel="nofollow">http://research.microsoft.com/en-us/projects/specsharp/</a><p>Spec# has annotations and methods for object ownership. You can see an example of it in the "The Spec# Programming System: An Overview" slideshow (slide 39 onwards).<p>Also:<p>> C# has two families of data structures that dermine allocation behaviour: structs and classes. If a type is a struct then values of that type will be allocated on the stack:<p>Here's a primer on how the Microsoft CLR handles it, because it's more subtle than what's stated above. The end effect is that value types behave like values, reference types behave like references. Where they're stored is a function of where they need to be stored, not their type.<p><a href="https://blogs.msdn.microsoft.com/ericlippert/2010/09/30/the-truth-about-value-types/" rel="nofollow">https://blogs.msdn.microsoft.com/ericlippert/2010/09/30/the-...</a>
I like the author's attempt to explain Rust's borrow checker to a new audience by inventing a variant of C#. Lifetimes are certainly one of Rust's most unique features, and the existence of analogies to express unfamiliar concepts in terms of familiar ones is very valuable.
Hopefully this is relevant but one of the things I had difficulty with in Rust is closures (or more specifically the lifetime and pointers of closures) and wiring up a system or library that needs lots of callback things.<p>See I'm used to Java where anonymous classes are closures (I really like that about Java/Scala/Groovy. One of the very few things I don't like about C# is that does not have anonymous classes).<p>So the problem is when I want a callbacky thing that has state it gets fairly complicated in Rust because you have lots of options that have limitations. For example there is bare functions or raw functions which basically stateless, there is traits but you'll need to use boxes and or cells, and then there is Rust closures which I had some various issues with because of bugs (they are probably fixed now).<p>I only bring this up because instead of so many tutorials on simple static programming stuff I would like to see how one might wire up a system with many callback components (ie manual dependency injection). I suppose I should look at how its done in Iron.<p>ie if your going to show something analogous to a Java/C# developer show them some wiring up of a complicated system that has interfaces and the components can be interchanged (perhaps that is just something you don't do in Rust but I'm curious how it would be done).
Does anybody know how good the Rust integration with Windows is? The language looks very good but can you interop with Win32, COM and .NET? Is there a debugger? Without those its usability is a little limited.