Miguel de Icaza Personal blog of Miguel de Icaza http://tirania.org/blog//index.html Miguel de Icaza miguel@gnome.org Thu, 25 Apr 2013 12:21:00 -0500 http://backend.userland.com/rss lb# Need for Exercises <p>For many years, I have learned various subjects (mostly programming related, like languages and frameworks) purely by reading a book, blog posts or tutorials on the subjects, and maybe doing a few samples. <p>In recent years, I "learned" new programming languages by reading books on the subject. And I have noticed an interesting phenomenon: when having a choice between using these languages in a day-to-day basis or using another language I am already comfortable with, I go for the language I am comfortable with. This, despite my inner desire to use the hot new thing, or try out new ways of solving problems. <p>I believe the reason this is happening is that most of the texts I have read that introduce these languages are written by hackers and not by teachers. <p>What I mean by this is that these books are great at describing and exposing every feature of the language and have some clever examples shown to you, but none of these actually force you to write code in the language. <p>Compare this to Scheme and the book "Structure and Interpretation of Computer Programs". That book is designed with teaching in mind, so at the end of every section where a new concept has been introduced, the authors have a series of exercises specifically tailored to use the knowledge that you just gained and put it to use. Anyone that reads that book and does the exercises is going to be a guaranteed solid Scheme programmer, and will know more about computing than from reading any other book. <p>In contrast, the experience of reading a modern computing book from most of the high-tech publishers is very different. Most of the books being published do not have an educator reviewing the material, at best they have an editor that will fix your English and reorder some material and make sure the proper text is italicized and your samples are monospaced. <p>When you finish a chapter in a modern computing book, there are no exercises to try. When you finish it, your choices are to either take a break by checking some blogs or keep marching in a quest to collect more facts on the next chapter. <p>During this process, while you amass a bunch of information, at some neurological level, you have not really mastered the subject, nor gained the skills that you wanted. You have merely collected a bunch of trivia which most likely you will only put to use in an internet discussion forum. <p>What books involving an educator will do is include exercises that have been tailored to use the concepts that you just learned. When you come to this break, instead of drifting to the internet you can sit down and try to put your new knowledge to use. <p>Well developed exercises are an application of the <a href="http://en.wikipedia.org/wiki/Flow_(psychology)">psychology of Flow</a> ensuring that the exercise matches the skills that you have developed and they guide you through a path that keeps you in an emotional state ranging that includes control, arousement and joy (flow). <h2>Anecdote Time</h2> <p>Back in 1988 when I first got the first edition of the "C++ Language", there were a couple of very simple exercises in the first chapter that took me a long time to get right and they both proved very educational. <p>The first exercises was "Compile Hello World". You might think, that is an easy one, I am going to skip that. But I had decided that I was going to do each and every single of one of the exercises in the book, no matter how simple. So if the exercise said "Build Hello World", I would build Hello World, even if I was already seasoned assembly language programmer. <p>It turned out that getting "Hello World" to build and run was very educational. I was using the Zortech C++ compiler on DOS back, and getting a build turned out to be almost impossible. I could not get the application to build, I got some obscure error and no way to fix it. <p>It took me days to figure out that I had the Microsoft linker in my path before the Zortech Linker, which caused the build to fail with the obscure error. An important lesson right there. <h2>On Error Messages</h2> <p>The second exercise that I struggled with was a simple class. The simple class was missing a semicolon at the end. But unlike modern compilers, the Zortech C++ compiler at the time error message was less than useful. It took a long time to spot the missing semicolon, because I was not paying close enough attention. <p>Doing these exercises trains your mind to recognize that "useless error message gobble gobble" actually means "you are missing a semicolon at the end of your class". <p>More recently, I learned in this same hard way that the F# error message "The value or constructor 'foo' is not defined" really means "You forgot to use 'rec' in your let", as in: <pre> let foo x = if x == 1 1 else foo (x-1) </pre> <p>That is a subject for another post, but the F# error message should tell me what I did wrong at a language level, as opposed to explaining to me why the compiler is unable to figure things out in its internal processing of the matter. <h2>Plea to book authors</h2> <p>Nowadays we are cranking books left and right to explain new technologies, but rarely do these books get the input from teachers and professional pedagogues. So we end up accumulating a lot of information, we sound lucid at cocktail parties and might even engage in a <a href="http://tirania.org/blog/archive/2011/Feb-17.html">pointless engineering debate</a> over features we barely master. But we have not learned. <p>Coming up with the ideas to try out what you have just learned is difficult. As you think of things that you could do, you quickly find that you are missing knowledge (discussed in further chapters) or your ideas are not that interesting. In my case, my mind drifts into solving other problems, and I go back to what I know best. <p>Please, build exercises into your books. Work with teachers to find the exercises that match the material just exposed and help us get in the zone of Flow. http://tirania.org/blog/archive/2013/Apr-25.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2013/Apr-25.html Thu, 25 Apr 2013 16:21:00 -0500 Introducing MigCoin <p>Non-government controlled currency systems are now in vogue. Currencies that are not controlled by some government that might devalue your preciously earned pesos at the blink of an eye. <p>BitCoin is powered by powerful cryptography and math to ensure a truly digital currency. But it poses significant downsides, for one, governments can track your every move, and every transaction is stored on each bitcoin, making it <a href="http://market-ticker.org/akcs-www?post=219284">difficult to prevent a tax audit in the future</a> by The Man. <p>Today, I am introducing an alternative currency system that both keeps the anonymity of your transactions, and is even more secure than the crypto mumbo jumbo of bitcoins. <p>Today, I am introducing the MigCoin. <p>Like bitcoins, various MigCoins will be minted over time, to cope with the creation of value in the world. <p>Like bitcoins, the supply of MigCoins will be limited and will eventually plateau. Like bitcoin, the MigCoin is immune to the will of some Big Government bureaucrat that wants to control the markets by printing or removing money from circulation. Just like this: <center> <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/5/54/Total_bitcoins_over_time.png/300px-Total_bitcoins_over_time.png"> <p>Projected number of Bitcoins and MigCoins over time. </center> <p>Unlike bitcoins, I am standing by them and I am not hiding behind a false name. <p>Like BitCoins, MigCoins come with a powerful authentication system that can be used to verify their authenticity. Unlike BitCoins, they do not suffer from this attached "log" that Big Brother and the Tax Man can use to come knocking on your door one day. <p>How does this genius of a currency work? How can you guarantee that governments or rogue entities wont print their own MigCoins? <p>The answer is simple my friends. <p>MigCoins are made of my DNA material. <p>Specifically, spit. <p>Every morning, when I wake up, for as long as I remain alive, I will spit on a glass. A machine will take the minimum amount of spit necessary to lay down on a microscope slide, and this is how MigCoins are minted. <p>Then, you guys send me checks, and I send you the microscope slides with my spit. <p>To accept MigCoins payments all you have to do is carry a DNA sequencer with you, put the microscope slide on it, press a button, and BAM! 10 minutes later you have your currency validated. <p>To help accelerate the adoption of MigCoins, I will be offering bundles of MigCoins with the <a href="http://www.illumina.com/landing/click/miseq.ilmn?gclid=CLiWwZqTxLYCFQFx4Aod5lEAVg">Ilumina MiSeq Personal DNA sequencer</a>: <center> <img src="http://www.illumina.com/images/systems/miseq/miseq-personal-sequencer.png"> </center> <p>Some might argue that the machine alone is <a href="http://nextgenseek.com/2012/08/comparing-price-and-tech-specs-of-illumina-miseq-ion-torrent-pgm-454-gs-junior-and-pacbio-rs/">125,000 dollars</a> and validating one MigCoin is going to set me back 750 dollars. <p>Three words my friends: Economy of Scale. <p>We are going to need a few of you to put some extra pesos early on to get the prices to the DNA machines down. <center> <img src="http://tctechcrunch2011.files.wordpress.com/2013/04/glass-collective.jpg?w=300"> <p>Early Adopters of MigCoins</p> </center> <p>I will partner with <a href="http://techcrunch.com/2013/04/10/the-glass-collective-is-born/">visionaries like these</a> to get the first few thousands sequencers built and start to get the prices down. Then we will hire that guy ex-Apple guy that was CEO of JC Penney to get his know-how on getting the prices of these puppies down. <p>Like Bitcoin, I expect to see a lot of nay-sayers and haters. People that will point out flaws on this system. But you know what? <center> <img src="http://kingtrumpsace.files.wordpress.com/2011/01/haters-gonna-hate.gif?w=610"> </center> <p>The pace of innovation can not be held back by old-school economists that "don't get it" and pundits on CNN trying to make a quick buck. Hater are going to hate. 'nuff said. <p>Next week, I will be launching MigXchange, a place where you can trade your hard BitCoins for slabs of spit. <p>Join the revolution! Get your spit on! http://tirania.org/blog/archive/2013/Apr-12.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2013/Apr-12.html Sat, 13 Apr 2013 03:29:00 -0500 Exclusive! What we know about the Facebook Phone <p>We obtained some confidential information about the upcoming Facebook Phone. Here is what we know about it so far: <blockquote class="twitter-tweet"><p>The FacebookPhone will be free (no contract) but will pause your call every 30 seconds to play an ad for 20</p>&mdash; Miguel de Icaza (@migueldeicaza) <a href="https://twitter.com/migueldeicaza/status/317671176585498624">March 29, 2013</a></blockquote> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> <blockquote class="twitter-tweet"><p>Everyone will get an FacebookPhone to use as a honeypot trap for unwanted calls.</p>&mdash; Miguel de Icaza (@migueldeicaza) <a href="https://twitter.com/migueldeicaza/status/317671764836618240">March 29, 2013</a></blockquote> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> <blockquote class="twitter-tweet"><p>@<a href="https://twitter.com/migueldeicaza">migueldeicaza</a> it will also force a call to a person you haven't talked to in 10 years for every 5 calls you make.</p>&mdash; Jonathan Chambers (@jon_cham) <a href="https://twitter.com/jon_cham/status/317671602085052417">March 29, 2013</a></blockquote> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> <blockquote class="twitter-tweet"><p>@<a href="https://twitter.com/migueldeicaza">migueldeicaza</a> it'll use the ambient light sensor to detect when your not listening to the ad on your phone and just restart it</p>&mdash; Alex Trott (@AlexTrott_) <a href="https://twitter.com/AlexTrott_/status/317671703918563328">March 29, 2013</a></blockquote> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> <blockquote class="twitter-tweet"><p>@<a href="https://twitter.com/migueldeicaza">migueldeicaza</a> and ad calls cannot be muted, refused and the disconnect button will be suspended for the period of the call!...</p>&mdash; Sumit Maitra (@sumitkm) <a href="https://twitter.com/sumitkm/status/317672162251120643">March 29, 2013</a></blockquote> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> <blockquote class="twitter-tweet"><p>@<a href="https://twitter.com/migueldeicaza">migueldeicaza</a> the proximity sensor will be used to switch between earphone and speakerphone if it detects you've put the phone down!</p>&mdash; Sumit Maitra (@sumitkm) <a href="https://twitter.com/sumitkm/status/317672377762865154">March 29, 2013</a></blockquote> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> <blockquote class="twitter-tweet"><p>@<a href="https://twitter.com/migueldeicaza">migueldeicaza</a> Before you're able to call, you must finish a game of Farmville. When done, it asks "Do you wish to call *related friend*?"</p>&mdash; Marco Kuiper (@marcofolio) <a href="https://twitter.com/marcofolio/status/317672448134901761">March 29, 2013</a></blockquote> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> <blockquote class="twitter-tweet"><p>The FacebookPhone will charge you 100 dollars to dial people who you have not friended</p>&mdash; Miguel de Icaza (@migueldeicaza) <a href="https://twitter.com/migueldeicaza/status/317673076206739457">March 29, 2013</a></blockquote> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> <blockquote class="twitter-tweet"><p>@<a href="https://twitter.com/migueldeicaza">migueldeicaza</a> After the call, a transcript and recording will be posted to your timeline, with the other party tagged.</p>&mdash; Chris Howie (@cdhowie) <a href="https://twitter.com/cdhowie/status/317672974675222531">March 29, 2013</a></blockquote> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> <blockquote class="twitter-tweet"><p>@<a href="https://twitter.com/migueldeicaza">migueldeicaza</a> it will have a single hardware button -'Like'</p>&mdash; Martin Topping (@eMartinTopping) <a href="https://twitter.com/eMartinTopping/status/317672903124602880">March 29, 2013</a></blockquote> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> <blockquote class="twitter-tweet"><p>The FacebookPhone has no lock code, as privacy is just an illusion</p>&mdash; Miguel de Icaza (@migueldeicaza) <a href="https://twitter.com/migueldeicaza/status/317673617796243456">March 29, 2013</a></blockquote> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> <blockquote class="twitter-tweet"><p>@<a href="https://twitter.com/migueldeicaza">migueldeicaza</a> When you call someone, their phone will ring on the lowest volume unless you pay to "Promote" the call.</p>&mdash; Brent Schooley (@brentschooley) <a href="https://twitter.com/brentschooley/status/317673485763768323">March 29, 2013</a></blockquote> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> <blockquote class="twitter-tweet"><p>@<a href="https://twitter.com/migueldeicaza">migueldeicaza</a> It will also change the UI every week to expose features you don't use</p>&mdash; Shmueli Englard (@Shmuelie) <a href="https://twitter.com/Shmuelie/status/317673387507998720">March 29, 2013</a></blockquote> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> <blockquote class="twitter-tweet"><p>@<a href="https://twitter.com/migueldeicaza">migueldeicaza</a> "The application 'My Friend Secrets' would like the following permissions: * Eavesdrop on all of your FacebookPhone calls."</p>&mdash; Chris Howie (@cdhowie) <a href="https://twitter.com/cdhowie/status/317673856376635392">March 29, 2013</a></blockquote> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> http://tirania.org/blog/archive/2013/Mar-29.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2013/Mar-29.html Fri, 29 Mar 2013 16:54:00 -0500 How I ended up with Mac <p>While reading Dave Winer's <a href="http://threads2.scripting.com/2013/march/whyWindowsLostToMac">Why Windows Lost to Mac</a> post, I noticed many parallels with my own experience with Linux and the Mac. I will borrow the timeline from Dave's post. <p>I invested years of my life on the Linux desktop first as a personal passion (Gnome) and when while awoken for two Linux companies (my own, Ximian and then Novell). During this period, I believed strongly in <a href="http://en.wikipedia.org/wiki/Eating_your_own_dog_food">dogfooding</a> our own products. I believed that both me and my team had to use the software we wrote and catch bugs and errors before it reached our users. We were pretty strict about it: both from an ideological point of view, back in the days of all-software-will-be-free, and then practically - during my tamer business days. I routinely chastised fellow team members that had opted for the easy path and avoided our Linux products. <p>While I had Macs at Novell (to support Mono on MacOS), it would take a couple of years before I used a Mac regularly. In some vacation to Brazil around 2008 or so, I decided to only take the Mac for the trip and learn to live with the OS as a user, not just as a developer. <p>Computing-wise that three week vacation turned out to be very relaxing. Machine would suspend and resume without problem, WiFi just worked, audio did not stop working, I spent three weeks without having to recompile the kernel to adjust this or that, nor fighting the video drivers, or deal with the bizarre and random speed degradation that my ThinkPad suffered. <p>While I missed the comprehensive Linux toolchain and userland, I did not miss having to chase the proper package for my current version of Linux, or beg someone to package something. Binaries just worked. <p>From this point on, using the Mac was a part-time gig for me. During the Novell layoffs, I returned my laptop to Novell and I was left with only one Linux desktop computer at home. I purchased a Mac laptop and while I fully intended to keep using Linux, the dogfooding driver was no longer there. <p>Dave Winer writes, regarding Windows: <blockquote> Back to 2005, the first thing I noticed about the white Mac laptop, that aside from being a really nice computer, there was no malware. In 2005, Windows was a horror. Once a virus got on your machine, that was pretty much it. And Microsoft wasn't doing much to stop the infestation. For a long time they didn't even see it as their problem. In retrospect, it was the computer equivalent of Three Mile Island or Chernobyl. </blockquote> <p>To me, the fragmentation of Linux as a platform, the multiple incompatible distros, and the incompatibilities across versions of the same distro were my Three Mile Island/Chernobyl. <p>Without noticing, I stopped turning on the screen for my Linux machine during 2012. By the time I moved to a new apartment in October of 2012, I did not even bother plugging the machine back and to this date, I have yet to turn it on. <p>Even during all of my dogfooding and Linux advocacy days, whenever I had to recommend a computer to a single new user, I recommended a Mac. And whenever I gave away computer gifts to friends and family, it was always a Mac. Linux just never managed to cross the desktop chasm. http://tirania.org/blog/archive/2013/Mar-05.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2013/Mar-05.html Tue, 05 Mar 2013 19:49:00 -0500 The Making of Xamarin Studio <p>We spent a year designing the new UI and features of Xamarin Studio (previously known as MonoDevelop). <p>I shared some stories of the process <a href="http://blog.xamarin.com/the-making-of-xamarin-studio/">on the Xamarin blog</a>. <p>After our launch, we open sourced all of the work that we did, as well as our new Gtk+ engine for OSX. Lanedo helps us tremendously making Gtk+ 2.x both solid and amazing on OSX (down to the new Lion scrollbars!). All of their work has either been upstreamed to Gtk+ or in the process of being upstreamed. http://tirania.org/blog/archive/2013/Feb-22.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2013/Feb-22.html Fri, 22 Feb 2013 19:42:00 -0500 "Reality Distortion Field" <p>"Reality Distortion Field" is a modern day cop out. A tool used by men that lack the intellectual curiosity to explain the world, and can deploy at will to explain excitement or success in the market place. Invoking this magical super power saves the writer from doing actual work and research. It is a <a href="http://en.wikipedia.org/wiki/Confidence_trick">con</a> perpetuated against the readers. <p>The <a href="http://folklore.org/StoryView.py?project=Macintosh&story=Reality_Distortion_Field.txt">expression originated</a> as an observation made by those that worked with Steve to describe his convincing passion. It was insider joke/expression which has now been hijacked by sloppy journalists when any subject is over their head. <p>The official <a href="http://www.amazon.com/Walter-Isaacson/e/B000APFLB8/?_encoding=UTF8&camp=1789&creative=390957&linkCode=ur2&qid=1351390701&sr=8-1&tag=tiraniaorg-20">Steve Jobs biography</a> left much to be desired. Here a journalist was given unprecedented access to Steve Jobs and get answers to thousands of questions that we have to this day. How did he approach problems? Did he have a method? How did he really work with his team? How did he turn his passion for design into products? How did he make strategic decisions about the future of Apple? How did the man balance engineering and marketing problems? <p>The biography has some interesting anecdotes, but fails to answer any of these questions. The biographer was not really interested in understanding or explaining Steve Jobs. He collected a bunch of anecdotes, stringed them together in chronological order, had the text edited and cashed out. <p>Whenever the story gets close to an interesting historical event, or starts exploring a big unknown of Steve's work, we are condescendingly told that "Steve Activated the Reality Distortion Field". <p>Every. Single. Time. <p>Not once did the biographer try to uncover what made people listen to Steve. Not once did he try to understand the world in which Steve operated. The breakthroughs of his work are described with the same passion as a Reuters news feed: an enumeration of his achievements glued with anecdotes to glue the thing together. <p>Consider the iPhone: I would have loved to know how the iPhone project was conceived. What internal process took place that allowed Apple to gain the confidence to become a phone manufacturer. There is a fascinating story of the people that made this happen, millions of details of how this project was evaluated and what the vision for the project was down to every small detail that Steve cared about. <p>Instead of learning about the amazing hardware and software engineering challenges that Steve faced, we are told over and over that all Steve had to do was activate his special super power. <p>The biography in short, is a huge missed opportunity. Unprecedented access to a man that reshaped entire industries and all we got was some gossip. <p>The "Reality Distortion Field" is <b>not really a Steve Jobs super-power</b>, it is a special super power that the technical press uses every time they are too lazy to do research. <p>Why do expensive and slow user surveys, or purchase expensive research from analysts to explain why some product is doing well, or why people are buying it when you can just slap a "they activated the Reality Distortion Field and sales went through the roof" statement in your article. <p>As of today, a Google News search for "Reality Distortion Field Apple" reports 532 results for the last month. <p>Perhaps this is just how the tech press must operate nowadays. There is just no time to do research as new products are being unveiled around the clock, and you need to deliver opinions and analysis on a daily basis. <p>But as readers, we deserve better. We should reject these explanations for what they are: a cheap grifter trick. http://tirania.org/blog/archive/2012/Nov-07.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Nov-07.html Wed, 07 Nov 2012 20:57:00 -0500 Mono 3.0 is out <p>After a year and a half, we have finally released Mono 3.0. <p>Like I <a href="http://tirania.org/blog/archive/2011/Oct-14.html">discussed last year</a>, we will be moving to a more nimble release process with Mono 3.0. We are trying to reduce our inventory of pending work and get new features to everyone faster. This means that our "master" branch will remain stable from now on, and that large projects will instead be developed in branches that are regularly landed into our master branch. <h2>What is new</h2> <p>Check our <a href="http://www.mono-project.com/Release_Notes_Mono_3.0">release notes</a> for the full details of this release. But here are some tasty bits: <ul> <li>C# Async compiler <li>Unified C# compiler for all profiles <li>4.5 Async API Profile <li>Integrated new Microsoft's Open Sourced stacks: <ul> <li>ASP.NET MVC 4 <li>ASP.NET WebPages <li>Entity Framework <li>Razor <li>System.Json (replaces our own) </ul> <li>New High performance Garbage Collector (SGen - with many performance and scalability improvements) <li>Metric ton of runtime and class library improvements. </ul> <p>Also, expect F# 3.0 to be bundled in our OSX distribution. http://tirania.org/blog/archive/2012/Oct-22.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Oct-22.html Mon, 22 Oct 2012 15:15:00 -0500 The Sophisticated Procrastinator - Volume 1 <p>Let me share with you some links that I found interesting in the past few weeks. These should keep the most diligent person busy for a few hours. <h2>Software Reads</h2> <p>Talbot Crowell's <a href="http://www.slideshare.net/Talbott/introduction-to-f-30">Introduction to F# 3.0</a> slides from Boston CodeCamp. <p>Bertrand Meyer (The creator of Eiffel, father of good taste in engineering practices) writes <a href="http://bertrandmeyer.com/2012/10/14/a-fundamental-duality-of-software-engineering/">Fundamental Duality of Software Engineering</a>: on the specifications and tests. This is one of those essays where every idea is beautifully presented. A must read. <p>Good <a href="http://preshing.com/20121019/this-is-why-they-call-it-a-weakly-ordered-cpu">article on weakly ordered CPUs</a>. <p>MonkeySpace <a href="https://github.com/dellis1972/monkeyspace2012/blob/master/MonoGameMonkeySpace.pptx">slide deck</a> on MonoGame. <p>David Siegel <a href="https://twitter.com/dvdsgl/status/258586878079549443">shares a cool C# trick</a>, <a href="http://paste2.org/p/2347363">switch expressions</a>. <p><a href="http://amirrajan.github.com/Oak/">Oak</a>: Frictionless development for ASP.NET MVC. <p>Simon Peyton Jones on video talks about <a href="http://skillsmatter.com/podcast/scala/front-end-language-features">Haskell, past, present and future</a>. A very tasty introductory talk to the language. David Siegel says about this: <blockquote> Simon Peyton-Jones is the most eloquent speaker on programming languages. Brilliant, funny, humble, adorable. </blockquote> <p>Rob Pike's talk on <a href="http://vimeo.com/groups/waza2012/videos/49718712">Concurrency is not Parallelism</a>. Rob is one of the crisper minds in software development, anything he writes, you must read, everything he says, you must listen to. <p><a href="https://gist.github.com/3855949">Answering the question of what is the fastest way to access properties dynamically: DynamicMethod LINQ expressions, MethodInfo.</a> <a href="https://twitter.com/ermau/status/255485146889871360">Discussion with Eric Maupin</a>. <p><a href="http://www.khronos.org/opengles/sdk/docs/reference_cards/OpenGL-ES-2_0-Reference-card.pdf">OpenGL ES Quick Reference Card</a>, plus a good companion: <a href="http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008793-CH1-SW1">Apple's Programming Guide</a>. <h2>Interesting Software</h2> <p><a href="http://SparkleShare.org">SparkleShare</a>, the open source file syncing service running on top of Git released their feature-complete product. They are preparing for their 1.0 release. SparkleShare runs on Linux, Mac and Windows. Check out their <a href="https://github.com/hbons/SparkleShare/blob/master/News.txt">Release Notes</a>. <p>Experts warn that Canonical might likely distribute a patched version that modifies your documents and spreadhseets to include ads and Amazon referal links. <p><a href="http://pheed.com">Pheed</a> a <a href="http://www.forbes.com/sites/ilyapozin/2012/10/18/is-pheed-the-new-twitter/">twitter competitor with a twist</a>. <p>Better debugging tools for <a href="http://googledevelopers.blogspot.fr/2012/10/a-better-developer-experience-for.html">Google Native Client</a>. <p><a href="http://elevenworks.com/touchdraw/">Touch Draw</a> comes to MacOS, great vector drawing application for OSX. Good companion to Pixelmator and great for maintaining iOS artwork. It has great support for structured graphics and for importing/exporting Visio files. <p>MonoGame 3D on the Raspberry Pi <a href="http://www.youtube.com/watch?v=jwbYe6eoZgE&feature=youtu.be">video</a>. <p><a href="https://itunes.apple.com/us/app/fruit-rocks/id566849098?mt=8">Fruit Rocks</a> a fun little game for iOS. <p><a href="http://twitter.com/Redth">@Redth</a>, the one man factory of cool hacks has released: <ul> <li><a href="https://github.com/Redth/PassKitSharp">PassKitSharp</a>, a library to generate, maintain, process Apple's Passbook files written in C# <li><a href="https://github.com/Redth/ZxingSharp.Mobile">Zxing.Mobile</a>, an open source barcode library built on top of ZXing (Zebra Crossing) runs on iOS and Android. <li><a href="https://github.com/Redth/PushSharp">PushSharp</a>, A server-side library for sending Push Notifications to iOS (iPhone/iPad APNS), Android (C2DM and GCM - Google Cloud Message), Windows Phone, Windows 8, and Blackberry devices. </ul> <p><a href="https://www.billguard.com/blog/2012/10/coding-passbook-lessons-learned/">Coding on Passbook: Lessons Learned</a>. <h2>Building a Better World</h2> <p><a href="http://haacked.com/archive/2012/10/21/monkeyspace-dotnet-oss.aspx">Phil Haack</a> blogs about MonkeySpace <p><a href="https://twitter.com/patio11">Patrick McKenzie</a> writes <a href="http://blog.intercom.io/designing-first-run-experiences-to-delight-users/">Designing First Run Experiences to Delight Users</a>. <p>Kicking the <a href="http://threads2.scripting.com/2012/october/howToKickTwitterAddiction">Twitter habit</a>. <p>Twitter <a href="http://tjfixman.wordpress.com/2012/10/15/questions-from-the-twitterverse/">Q&amp;A with TJ Fixman</a>, writer for Insomniac Games. <p>Debunking the myths of budget deficits: <a href="http://www.cepr.net/index.php/blogs/beat-the-press/children-and-grandchilden-do-not-pay-for-budget-deficits-they-get-interest-on-the-bonds">Children and Grandchildren do not pay for budget deficits, they get interest on the bonds</a>. <h2>Cool Stuff</h2> <p><a href="http://map.honeynet.org/">Live updates on HoneyPots setup by the <a href="http://www.honeynet.org/">HoneyNet Project</a>. <p><a href="http://shop.oreilly.com/product/0636920024033.do?cmp=tw-code-books-nb-programming-fsharp-3.0">Updated Programming F# 3.0, 2nd Edition</a> is out. By Chris Smith, a delightful book on F# has been updated to cover the new and amazing type providers in F#. <p>ServiceStack <a href="https://github.com/ServiceStack/ServiceStack/wiki/Contributors">now has 113 contributors</a>. <h2>News</h2> <p>From <a href="http://appleinsider.com/articles/12/10/19/wsj-google-may-settle-mobile-frand-patent-antitrust-claim">Apple Insider</a>: Google may settle mobile FRAND patent antitrust claim. <p>The Salt Lake City Tribune editorial board <a href="http://www.sltrib.com/sltrib/opinion/55019844-82/romney-obama-state-president.html.csp">endorses Obama over Romney</a>: <blockquote> In considering which candidate to endorse, The Salt Lake Tribune editorial board had hoped that Romney would exhibit the same talents for organization, pragmatic problem solving and inspired leadership that he displayed here more than a decade ago. Instead, we have watched him morph into a friend of the far right, then tack toward the center with breathtaking aplomb. Through a pair of presidential debates, Romney’s domestic agenda remains bereft of detail and worthy of mistrust. <p>Therefore, our endorsement must go to the incumbent, a competent leader who, against tough odds, has guided the country through catastrophe and set a course that, while rocky, is pointing toward a brighter day. The president has earned a second term. Romney, in whatever guise, does not deserve a first. </blockquote> <p>From <a href="http://www.tnr.com/article/politics/magazine/108185/blue-states-are-scandinavia-red-states-are-guatemala?page=0,0">Blue States are from Scandinavia, Red States are from Guatemala</a> the author looks at the differences in policies in red vs blue states, and concludes: <blockquote> Advocates for the red-state approach to government invoke lofty principles: By resisting federal programs and defying federal laws, they say, they are standing up for liberty. These were the same arguments that the original red-staters made in the 1800s, before the Civil War, and in the 1900s, before the Civil Rights movement. Now, as then, the liberty the red states seek is the liberty to let a whole class of citizens suffer. That’s not something the rest of us should tolerate. This country has room for different approaches to policy. It doesn’t have room for different standards of human decency. </blockquote> <p><a href="http://www.esquire.com/blogs/politics/last-night-debate-13800806">Esquire's take</a> on the 2nd Presidential Debate. <p>Dave Winer wrote <a href="http://scripting.com/stories/2010/10/18/readingsFromNewsExecs.html">Readings from News Execs</a>: <blockquote> There was an interesting juxtaposition. Rupert Murdoch giving a mercifully short speech saying the biggest mistake someone in the news business could make is thinking the reader is stupid. He could easily have been introducing the next speaker, Bill Keller of the NY Times, who clearly thinks almost everyone who doesn't work at the NY Times is stupid. </blockquote> <P>What do you know, turns out that Bill Moyers is not funded by the government nor does he get tax money, like many Republicans like people to believe. The <a href="http://billmoyers.com/segment/bill-moyers-essay-correcting-oreilly/">correction is here</a>. <h2>Twitter Quotes</h2> <p><a href="https://twitter.com/JosephHill/status/259767880533557248">Joseph Hill</a> <blockquote> "Non-Alcoholic Sparkling Beverage" - Whole Foods' $7.99 name for "bottle of soda". </blockquote> <p><a href="https://twitter.com/jon_cham/status/259730475394949122">Jonathan Chambers</a> <blockquote> Problem with most religious people is that their faith tells them to play excellently in game of life, but they want to be the referees. </blockquote> <p><a href="https://twitter.com/hbons/status/259317611001700352">Hylke Bons</a> on software engineering: <blockquote> "on average, there's one bug for every 100 lines of code" this is why i put everything on one line </blockquote> <p><a href="https://twitter.com/waldojaquith/status/258395567904927745">Waldo Jaquith</a>: <blockquote> If government doesn't create jobs, isn't Romney admitting that his campaign is pointless? </blockquote> <p><a href="https://twitter.com/al3xbrown/status/257828789759930369">Alex Brown</a> <blockquote> OH "It is a very solid grey area" #sc34 #ooxml </blockquote> <p><a href="https://twitter.com/directhex/status/257813876882681856">Jo Shields</a> <blockquote> "I don't care how many thousand words your blog post is, the words 'SYMBIAN WAS WINNING' mean you're too high on meth to listen too. </blockquote> <p><a href="https://twitter.com/jeremyscahill/status/257335642957168641">Jeremy Scahill</a> on war monger Max Boots asks the questions <blockquote> Do they make a Kevlar pencil protector? Asking for a think tanker. <p>Max Boot earned a Purple Heart (shaped ink stain on his shirt) during the Weekly Standard War in 1994. </blockquote> <p><a href="https://twitter.com/timbray/status/255764612438437888">Tim Bray</a> <blockquote> "W3C teams with Apple, Google, Mozilla on WebPlatform"... or we could all just sponsor a tag on StackOverflow. </blockquote> <p><a href="https://twitter.com/dvdsgl/status/255512742474174464">David Siegel</a> <blockquote> Most programmers who claim that types "get in the way" had a sucky experience with Java 12 years ago, tried Python, then threw the baby out. </blockquote> <p><a href=""></a> <h2>Outrage Dept</h2> <p>How Hollywood Studios employ <a href="http://www.techdirt.com/articles/20121018/01054720744/hollywood-accounting-how-19-million-movie-makes-150-million-still-isnt-profitable.shtml">creative accounting</a> to avoid sharing the profits with the participants. If you were looking at ways to scam your employees and partners, look no further. <p>Startvation in Gaza: <a href="http://www.haaretz.com/news/diplomacy-defense/2-279-calories-per-person-how-israel-made-sure-gaza-didn-t-starve.premium-1.470419">State forced to release 'red lines' document for food consumption</a>. <p>Dirty tricks and disturbing trends: Billionaire <a href="http://news.yahoo.com/blogs/ticket/koch-industries-sends-pro-romney-packet-employees-195709471--election.html">warn employees</a> that if Obama is reelected, they will be facing layoffs. <p><a href="http://972mag.com/israeli-children-deported-to-south-sudan-succumb-to-malaria/57287/">Israeli Children Deported to South Sudan Succumb to Malaria</a>: <blockquote> Here we are today, three months later, and within the last month alone, these two parents lost two children, and the two remaining ones are sick as well. Sunday is already in hospital with malaria, in serious condition, and Mahm is sick at home. “I’ve only two children left,” Michael told me today over the phone. The family doesn’t have money to properly treat their remaining children. The hospitals are at full capacity and more people leave them in shrouds than on their own two feet. I ask you, beg of you to help me scream the story of these children and their fate, dictated by the heartless, immoral Israeli government. </blockquote> <p><a href="http://geo-geek.blogspot.com.au/2012/10/suicide-is-cheaper.html">When Suicide is Cheaper</a> the horrifying tales of Americans that can not afford health care. <P>Paul Ryan is <a href="http://thinkprogress.org/wp-content/uploads/2012/08/Ryan-vs-Akin-bills_edited-20-499x1024.png">not that different</a> from Todd Akin, when it comes to women rights. <h2>Interesting Discussions, Opinions and Articles</h2> <p>A <a href="http://www.youtube.com/watch?v=X0fsyb-ttcw">Windows 8 critique</a>: someone is not very happy with it. <p><a href="http://www.garann.com/dev/2012/you-keep-using-that-word/">On "meritocracy"</a>: what is wrong with it. <p>Fascinating read on the fast moving space of companies: <a href="http://www.fastcompany.com/3002103/intimate-portrait-innovation-risk-and-failure-through-hipstamatics-lens?src=longreads">Intimate Portrait of Innovation, Risk and Failure Through Hipstamatic's Lens</a>. <p>Kathy Sierra <a href="http://farukat.es/journal/2012/10/669-kathy-sierra-primer-sexism-discussion">discusses sexism in the tech world</a>. How she changed her mind about it, and the story that prevented her from seeing it. <p><a href="http://blog.prettylittlestatemachine.com/blog/2012/10/14/antirez-on-sexism/">Response @antirez's</a> sexist piece. <p>Chrystia Freeland's <a href="http://www.nytimes.com/2012/10/14/opinion/sunday/the-self-destruction-of-the-1-percent.html?_r=2&hp=">The Self Destruction of the 1% percent</a> is a great article, which touches on the points of her book of <a href="http://www.amazon.com/gp/product/1594204098/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1594204098&linkCode=as2&tag=tiraniaorg-20">Plutocrats</a> <p><a href="http://www.gamesindustry.biz/articles/2012-10-05-sonys-steep-learning-process?utm_source=newsletter&utm_medium=email&utm_campaign=european-daily">Sony's Steep Learning Process</a> a look at the changing game with a focus on Sony's challenges. <h2>Entertainment</h2> <p><a href="http://www.brainpickings.org/index.php/2012/10/18/60-second-adventures-in-religion/">One Minute Animated Primers on Major Theories on Religion</a>. <p><a href="http://www.reddit.com/user/cat_fact_and_gif">Cat fact and Gif</a> provides Cat facts with a gif that goes with it. The ultimate resource of cat facts and gifs. http://tirania.org/blog/archive/2012/Oct-21.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Oct-21.html Mon, 22 Oct 2012 01:03:00 -0500 Drowning Good Ideas with Bloat. The tale of pkg.m4. <p>The <tt>gnome-config</tt> script was a precursor to <tt>pkg-config</tt>, they are tools used that you can run and use to extract information about the flags needed to compile some code, link some code, or check for a version. <tt>gnome-config</tt> itself was a pluggable version of Tcl's <tt>tclConfig.sh</tt> script. <p>The idea is simple: <tt>pkg-config</tt> is a tiny little tool that uses a system database of packages to provide version checking and build information to developers. Said database is merely a well-known directory in the system containing files with the extension ".pc", one per file. <p>These scripts are designed to be used in shell scripts to probe if a particular software package has been installed, for example, the following shell script probes whether Mono is installed in the system: <pre class="shell"> # shell script if pkg-config --exists mono; then echo "Found Mono!" else echo "You can download mono from www.go.mono.com" fi </pre> <p>It can also be used in simple makefiles to avoid hardcoding the paths to your software. The following makefile shows how: <pre class="shell"> CFLAGS = `pkg-config --cflags mono` LIBS = `pkg-config --libs mono` myhost: myhost.c </pre> <p>And if you are using Automake and Autoconf to probe for the existence of a module with a specific version and extract the flags needed to build a module, you would do it like this: <pre class="shell"> AC_SUBST(MONO_FLAGS) AC_SUBST(MONO_LIBS) if pkg-config --atleast-version=2.10 mono; then MONO_FLAGS=`pkg-config --cflags mono` MONO_LIBS=`pkg-config --libs mono` else AC_MSG_ERROR("You need at least Mono 2.10") fi </pre> <p>There are two main use cases for <tt>pkg-config</tt>. <p><b>Probing:</b> You use the tool to pobe for some condition about a package and taking an action based on this. For this, you use the pkg-config exit code in your scripts to determine whether the condition was met. This is what both the sample automake and the first script show. <p><b>Compile Information:</b> You invoke the tool which outputs to standard output the results. To store the result or pass the values, you use the shell backtick (`). That is all there is to it (example: version=`pkg-config --version`). <p>The tool is so immensely simple that anyone can learn every command that matters in less than 5 minutes. The whole thing is beautiful because of its simplicity. <h2>The Siege by the Forces of Bloat</h2> <p>Perhaps it was a cultural phenomenon, perhaps someone that had nothing better to do, perhaps someone that was just trying to be thorough introduced one of the most poisoning memes into the pool of ideas around pkg-config. <p>Whoever did this, thought that the "if" statement in shell was a complex command to master or that someone might not be able to find the backtick on their keyboards. <p>And they hit us, and they hit us hard. <p>They introduced <tt>pkg.m4</tt>, a macro intended to be used with autoconf, that would allow you to replace the handful of command line flags to pkg-config with one of their macros (PKG_CHECK_MODULES, PKG_CHECK_EXISTS). To do this, they wrote a 200 line script, which replaces one line of shell code with almost a hundred. Here is a handy comparison of what these offer: <pre class="shell"> # Shell style AC_SUBST(MONO_LIBS) AC_SUBST(MONO_CFLAGS) if pkg-config --atleast-version=2.10 mono; then MONO_CFLAGS=`pkg-config --cflags mono` MONO_LIBS=`pkg-config --libs mono` else AC_MSG_ERROR(Get your mono from www.go-mono.com) fi # # With the idiotic macros # PKG_CHECK_MODULES([MONO], [mono >= 2.10],[], [ AC_MSG_ERROR(Get your mono from www.go-mono.com) ]) # # If you do not need split flags, shell becomes shorter # if pkg-config --atleast-version=2.10 mono; then CFLAGS="$CFLAGS `pkg-config --cflags mono`" LIBS="$LIBS `pkg-config --libs mono`" else AC_MSG_ERROR(Get your mono from www.go-mono.com) fi </pre> <p>The above shows the full benefit of using a macro, MONO is a prefix that will have LIBS and CFLAGS extracted. So the shell script looses. The reality is that the macros only give you access to a subset of the functionality of pkg-config (no support for splitting -L and -l arguments, querying provider-specific variable names or performing macro expansion). <p>Most projects, adopted the macros because they copy/pasted the recipe from somewhere else, and thought this was the right way of doing things. <p>The hidden price is that saving that few lines of code actually inflicts a world of pain on your users. You will probably see this in <a href="https://www.google.com/search?q=pkg_check_modules+syntax+error+near+unexpected&oq=pkg_check_modules+syntax+error+near+unexpected">your forums</a> in the form of: <pre> Subject: Compilation error I am trying to build your software, but when I run autogen.sh, I get the following error: checking whether make sets $(MAKE)... yes checking for pkg-config... /usr/bin/pkg-config ./configure: line 1758: syntax error near unexpected token FOO,' ./configure: line 1758:PKG_CHECK_MODULES(FOO, foo >= 2.9)' </pre> <p>And then you will engage in a discussion that in the best case scenario helps the user correctly configure his ACLOCAL_FLAGS, create his own "setup" script that will properly configure his system, and your new users will learn the difference between running a shell script and "sourcing" a shell script to properly setup his development system. <p>In the worst case scenario, the discussion will devolve into how stupid your user is for not knowing how to use a computer and how he should be shot in the head and taken out to the desert for his corpse to be eaten by vultures; because, god dammit, they should have googled that on their own, and they should have never in the first place have installed two separate automake installations in two prefixes, without properly updating their ACLOCAL_FLAGS or figured out on their own that their paths were wrong in the first place. Seriously, what moron in this day and age is not familiar with the limitations of <tt>aclocal</tt> and the best practices to use system-wide m4 macros? <p>Hours are spent on these discussions every year. Potential contributors to your project are driven away, countless hours that could have gone into fixing bugs and producing code are wasted, you users are frustrated. And you saved 4 lines of code. <p>The pkg.m4 is a poison that is holding us back. <p>We need to end this reign of terror. <p>Send pull requests to eliminate that turd, and ridicule anyone that suggests that there are good reasons to use it. In the war for good taste, it is ok to vilify and scourge anyone that defends <tt>pkg.m4</tt>. http://tirania.org/blog/archive/2012/Oct-20.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Oct-20.html Sat, 20 Oct 2012 15:08:00 -0500 Why Mitt does not need an Economic Plan <p>Mitt Romney does not need to have an economic plan. He does not need to have a plan to cut the deficit or to cut services. <p>It is now well understood that to get the US out of the recession, <a href="http://www.amazon.com/gp/product/0393088774/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=0393088774&linkCode=as2&tag=tiraniaorg-20">the government has to inject money into the economy</a>. To inject money into the economy, the US needs to borrow some money and spend it. Borrowing is also at an all-time low, so the price to pay is very low. <p>Economists know this, and Republicans know this. <p>But the Republicans top priority is to get Obama out of office at any cost. Even at the cost of <a href="http://en.wikipedia.org/wiki/United_States_debt-ceiling_crisis">prolonging the recession, damaging the US credit rating</a> and <a href="http://republicanjobcreation.com/">keeping people unemployed</a>. <p>The brilliance of the Republican strategy is that they have convinced the world that the real problem facing the US is the debt. Four years of non-stop <a href="http://shameproject.com/profile/megan-mcardle/">propaganda</a> on newspapers and TV shows have turned everyone into a "fiscal conservative". The propaganda efforts have succeeded into convincing the world that US economic policy should be subject to the same laws of balancing a household budget (I wont link to this idiocy). <p>The campaign has been a <b>brilliant</b> and has forced the Democrats to adopt policies of austerity, instead of policies of growth. Instead of spending left and right to create value, we are cutting. And yet, nobody has stopped the propaganda and pointed out that growth often comes after spending money. Startups start in the red and are funded for several years before they become profitable; Companies go public and use the IPO to raise capital to grow, and for many years they lose money until their investments pay off and allows them to turn the tide. <p>So this mood has forced Obama to talk about cuts. He needs to be detailed about his cuts, he needs to be a fiscal conservative. <p>But Economists and Republicans know what the real fix is. They know they have to spend money. <p>If Romney is elected to office, he will do just that. He will borrow and spend money, because that is the only way of getting out of the recession. That is why his plan does not need to have any substance, and why he can ignore the calls to get more details, because he has no intention to follow up with them. <p>Obama made a critical mistake in his presidency. He decided to compromise with Republicans, he was begging to be loved by Republicans and in the process betrayed his own base and played right into the Republican's plans. http://tirania.org/blog/archive/2012/Oct-04.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Oct-04.html Thu, 04 Oct 2012 20:00:00 -0500 Mono 2.11.4 is out <p>A couple of weeks ago we released Mono 2.11.4; I had not had time to blog about it. <p>Since our previous release a month before, we had some 240 commits, spread like this: <pre> 488 files changed, 28716 insertions(+), 6921 deletions(-) </pre> <p>Among the major updates in this release: <ul> <li>Integrated the Google Summer of Code code for Code Contracts. <li>Integrated the Google Summer of Code code for TPL's DataFlow. <li>Plenty of networking stack fixes and updates (HTTP stack, web services stack, WCF) <li>Improvements to the SGen GC. <li>TPL fixes for AOT systems like the iPhone. <li>Debugger now supports batched method invocations. </ul> <p>And of course, a metric ton of bug fixes all around. <p>Head over to <a href="http://www.go-mono.com/mono-downloads/download.html">Mono's Download Page</a> to get the goods. We would love to hear about any bugs to have a great stable release. http://tirania.org/blog/archive/2012/Oct-02.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Oct-02.html Tue, 02 Oct 2012 19:23:00 -0500 TypeScript: First Impressions <p>Today Microsoft announced <a href="http://www.typescriptlang.org">TypeScript</a> a typed superset of Javascript. This means that existing Javascript code can be gradually modified to add typing information to improve the development experience: both by providing better errors at compile time and by providing code-completion during development. <p>As a language fan, I like the effort, just like I pretty much like most new language efforts aimed at improving developer productivity: from C#, to Rust, to Go, to Dart and to CoffeeScript. <p>A video introduction from Anders <a href="http://channel9.msdn.com/posts/Anders-Hejlsberg-Introducing-TypeScript">was posted on Microsoft's web site.</a> <h3>The Pros</h3> <ul> <li>Superset of Javascript allows easy transition from Javascript to typed versions of the code. <li><a href="http://typescript.codeplex.com/license">Open source</a> from the start, using the Apache License. <li>Strong types assist developers catch errors before the deploy the code, this is a very welcome addition to the developer toolchest. Script#, <a href="https://developers.google.com/web-toolkit/">Google GWT</a> and <a href="http://tirania.org/blog/archive/2012/Sep-06.html">C# on the web</a> all try to solve the same problem in different ways. <li>Extensive type inference, so you get to keep a lot of the dynamism of Javascript, while benefiting from type checking. <li>Classes, interfaces, visibility are first class citizens. It formalizes them for those of us that like this model instead of the roll-your-own prototype system. <li>Nice syntactic sugar reduces boilerplate code to explicit constructs (class definitions for example). <li>TypeScript is distributed as a Node.JS package, and it can be trivially installed on Linux and MacOS. <li>The adoption can be done entirely server-side, or at compile time, and requires no changes to existing browsers or runtimes to run the resulting code. </ul> <h3>Out of Scope</h3> <p>Type information is erased when it is compiled. Just like Java erases generic information when it compiles, which means that the underling Javascript engine is unable to optimize the resulting code based on the strong type information. <p>Dart on the other hand is more ambitious as it uses the type information to optimize the quality of the generated code. This means that a function that adds two numbers (function add (a,b) { return a+b;}) can generate native code to add two numbers, basically, it can generate the following C code: <pre> double add (double a, double b) { return a+b; } </pre> <p>While weakly typed Javascript must generated something like: <pre> JSObject add (JSObject a, JSObject b) { if (type (a) == typeof (double) && type (b) == typeof (double)) return a.ToDouble () + b.ToDouble (); else JIT_Compile_add_with_new_types (); } </pre> <h3>The Bad</h3> <p>The majority of the Web is powered by Unix. <p>Developers use MacOS and Linux workstations to write the bulk of the code, and deploy to Linux servers. <p>But TypeScript only delivers half of the value in using a strongly typed language to Unix developers: strong typing. Intellisense, code completion and refactoring are tools that are only available to Visual Studio Professional users on Windows. <p>There is no Eclipse, MonoDevelop or Emacs support for any of the language features. <p>So Microsoft will need to convince Unix developers to use this language merely based on the benefits of strong typing, a much harder task than luring them with both language features and tooling. <p>There is some <a href="http://blogs.msdn.com/b/interoperability/archive/2012/10/01/sublime-text-vi-emacs-typescript-enabled.aspx">basic support</a> for editing TypeScript from Emacs, which is useful to try the language, but without Intellisense, it is obnoxious to use. http://tirania.org/blog/archive/2012/Oct-01.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Oct-01.html Mon, 01 Oct 2012 20:35:00 -0500 Free Market Fantasies <p><a href="http://www.rdio.com/artist/Noam_Chomsky/album/Free_Market_Fantasies_Capitalism_In_The_Real_World/">This recording of a Q&amp;A with Noam Chomsky</a> in 1997 could be a Q&amp;A session done last night about bailouts, corporate wellfare, and the various distractions that they use from keeping us in the dark, like caring about "fiscal responsibility". <p>Also on <a href="http://itunes.apple.com/us/album/free-market-fantasies-capitalism/id78406694">iTunes</a> and <a href="http://amzn.to/Ng8EGs">Amazon</a>. http://tirania.org/blog/archive/2012/Sep-07.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Sep-07.html Fri, 07 Sep 2012 15:20:00 -0500 2012 Update: Running C# on the Browser <p>With our push to share the kernel of your software in reusable C# libraries and build a native experience per platform (iOS, Android, WP7 on phones and WPF/Windows, MonoMac/OSX, Gtk/Linux) one component that is always missing is what about doing a web UI that also shares some of the code. <p>Until very recently the answer was far from optimal, and included things like: put the kernel on the server and use some .NET stack to ship the HTML to the client. <p>Today there are two solid choices to run your C# code on the browser and share code between the web and your native UIs. <h2>JSIL</h2> <p><a href="http://jsil.org/">JSIL</a> will translate the ECMA/.NET Intermediate Language into Javascript and will run your code in the browser. JSIL is pretty sophisticated and their approach at running IL code on the browser also includes a bridge that allows your .NET code to reference web page elements. This means that you can access the DOM directly from C#. <p>You can try their <a href="http://jsil.org:8080/try/">Try JSIL</a> page to get a taste of what is possible. <h2>Saltarelle Compiler</h2> <p>The <a href="http://www.saltarelle-compiler.com/">Saltarelle Compiler</a> takes a different approach. It is a C# 4.0 compiler that generates JavaScript instead of generating IL. It is interesting that this compiler is built on top of the new NRefactory which is in turn built on top of our <a href="http://tirania.org/blog/archive/2011/Feb-24.html">C# Compiler as a Service</a>. <p>It is a fresh, new compiler and unlik JSIL it is limited to compiling the C# language. Although it is <a href="http://www.saltarelle-compiler.com/documentation/supported-c-language-features">missing some language features</a>, it is actively being developed. <p>This compiler was inspired by Script# which is a C#-look-alike language that generated Javascript for consuming on the browser. <h2>Native Client</h2> <p>I left NativeClient out, which is not fair, considering that both <a href="https://chrome.google.com/webstore/detail/oohphhdkahjlioohbalmicpokoefkgid?utm_campaign=en&utm_source=en-ha-na-us-bk-webstr&utm_medium=ha">Bastion</a> and <a href="https://chrome.google.com/webstore/detail/icefnknicgejiphafapflechfoeelbeo?utm_campaign=en&utm_source=en-ha-na-us-bk-webstr&utm_medium=ha">Go Home Dinosaurs</a> are both powered by Mono running on Native Client. <p>The only downside with Native Client today is that it does not run on iOS or Android. http://tirania.org/blog/archive/2012/Sep-06.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Sep-06.html Thu, 06 Sep 2012 19:00:00 -0500 What Killed the Linux Desktop <p>True story. <p>The hard disk that hosted my /home directory on my Linux machine failed so I had to replace it with a new one. Since this machine lives under my desk, I had to unplug all the cables, get it out, swap the hard drives and plug everything back again. <p>Pretty standard stuff. Plug AC, plug keyboard, plug mouse but when I got to the speakers cable, I just skipped it. <p>Why bother setting up the audio? <p>It will likely break again and will force me to go on a hunting expedition to find out more than I ever wanted to know about the new audio system and the drivers technology we are using. <p>A few days ago I spoke to Klint Finley from Wired who wrote the article titled <a href="http://www.wired.com/wiredenterprise/2012/08/osx-killed-linux/">OSX Killed Linux</a>. The original line of questioning was about my opinion between Gnome 3's shell, vs Ubuntu's Unity vs Xfte as competing shells. <p>Personally, I am quite happy with Gnome Shell, I think the team that put it together did a great job, and I love how it enabled the Gnome designers -which historically only design, barely hack- to actually extend the shell, tune the UI and prototype things without having to beg a hacker to implement things for them. It certainly could use some fixes and tuning, but I am sure they will address those eventually. <h2>What went wrong with Linux on the Desktop</h2> <p>In my opinion, the problem with Linux on the Desktop is rooted in the developer culture that was created around it. <p>Linus, despite being a low-level kernel guy, set the tone for our community years ago when he dismissed binary compatibility for device drivers. The kernel people might have some valid reasons for it, and might have forced the industry to play by their rules, but the Desktop people did not have the power that the kernel people did. But we did keep the attitude. <p>The attitude of our community was one of engineering excellence: we do not want deprecated code in our source trees, we do not want to keep broken designs around, we want pure and beautiful designs and we want to eliminate all traces of bad or poorly implemented ideas from our source code trees. <p>And we did. <p>We deprecated APIs, because there was a better way. We removed functionality because "that approach is broken", for degrees of broken from "it is a security hole" all the way to "it does not conform to the new style we are using". <p>We replaced core subsystems in the operating system, with poor transitions paths. We introduced compatibility layers that were not really compatible, nor were they maintained. When faced with "this does not work", the community response was usually "you are doing it wrong". <p>As long as you had an operating system that was 100% free, and you could patch and upgrade every component of your operating system to keep up with the system updates, you were fine and it was merely an inconvenience that lasted a few months while the kinks were sorted out. <p>The second dimension to the problem is that no two Linux distributions agreed on which core components the system should use. Either they did not agree, the schedule of the transitions were out of sync or there were competing implementations for the same functionality. <p>The efforts to standardize on a kernel and a set of core libraries were undermined by the Distro of the Day that held the position of power. If you are the top dog, you did not want to make any concessions that would help other distributions catch up with you. Being incompatible became a way of gaining market share. A strategy that continues to be employed by the 800 pound gorillas in the Linux world. <p>To sum up: (a) First dimension: things change too quickly, breaking both open source and proprietary software alike; (b) incompatibility across Linux distributions. <p>This killed the ecosystem for third party developers trying to target Linux on the desktop. You would try once, do your best effort to support the "top" distro or if you were feeling generous "the top three" distros. Only to find out that your software no longer worked six months later. <p>Supporting Linux on the desktop became a burden for independent developers. <p>But at this point, those of us in the Linux world still believed that we could build everything as open source software. The software industry as a whole had a few home runs, and we were convinced we could implement those ourselves: spreadsheets, word processors, design programs. And we did a fine job at that. <p>Linux pioneered solid package management and the most advance software updating systems. We did a good job, considering our goals and our culture. <p>But we missed the big picture. We alienated every third party developer in the process. The ecosystem that has sprung to life with Apple's OSX AppStore is just impossible to achieve with Linux today. <h2>The Rise of OSX</h2> <p>When OSX was launched it was by no means a very sophisticated Unix system. It had an old kernel, an old userland, poor compatibility with modern Unix, primitive development tools and a very pretty UI. <p>Over time Apple addressed the majority of the problems with its Unix stack: they improved compatibility, improved their kernel, more open source software started working and things worked out of the box. <p>The most pragmatic contributors to Linux and open source gradually changed their goals from "an world run by open source" to "the open web". Others found that messing around with their audio card every six months to play music and the hardships of watching video on Linux were not worth that much. People started moving to OSX. <p>Many hackers moved to OSX. It was a good looking Unix, with working audio, PDF viewers, working video drivers, codecs for watching movies and at the end of the day, a very pleasant system to use. Many exchanged absolute configurability of their system for a stable system. <p>As for myself, I had fallen in love with the iPhone, so using a Mac on a day-to-day basis was a must. Having been part of the Linux Desktop efforts, I felt a deep guilt for liking OSX and moving a lot of my work to it. <h2>What we did wrong</h2> <p>Backwards compatibility, and compatibility across Linux distributions is not a sexy problem. It is not even remotely an interesting problem to solve. Nobody wants to do that work, everyone wants to innovate, and be responsible for the next big feature in Linux. <p>So Linux was left with idealists that wanted to design the best possible system without having to worry about boring details like support and backwards compatibility. <p>Meanwhile, you can still run the 2001 Photoshop that came when XP was launched on Windows 8. And you can still run your old OSX apps on Mountain Lion. <p>Back in February I attended FOSDEM and two of my very dear friends were giggling out of excitement at their plans to roll out a new system that will force many apps to be modified to continue running. They have a beautiful vision to solve a problem that I never knew we had, and that no end user probably cares about, but every Linux desktop user will pay the price. <p>That day I stopped feeling guilty about my new found love for OSX. <h2>Update September 2nd, 2012</h2> <p>Clearly there is some confusion over the title of this blog post, so I wanted to post a quick follow-up. <p>What I mean with the title is that Linux on the Desktop lost the race for a consumer operating system. It will continue to be a great engineering workstation (that is why I am replacing the hard disk in my system at home) and yes, I am aware that many of my friends use Linux on the desktop and love it. <p>But we lost the chance of becoming a mainstream consumer OS. What this means is that nobody is recommending a non-technical person go get a computer with Linux on it for their desktop needs (unless you are doing it so for idelogical reasons). <p>We had our share of chances. The best one was when Vista bombed in the marketplace. But we had our own internal battles and struggles to deal with. Some of you have written your own takes of our struggled in that period. <p>Today, the various Linux on the desktops are the best they have ever been. Ubuntu and Unity, Fedora and GnomeShell, RHEL and Gnome 2, Debian and Xfce plus the KDE distros. And yet, we still have four major desktop APIs, and about half a dozen popular and slightly incompatible versions of Linux on the desktop: each with its own curated OS subsystems, with different packaging systems, with different dependencies and slightly different versions of the core libraries. Which works great for pure open source, but not so much for proprietary code. <p>Shipping and maintaining apps for these rapidly evolving platforms is <a href="https://twitter.com/chipx86/status/241451870990778368">a big challenge</a>. <p>Linux succeeded in other areas: servers and mobile devices. But on the desktop, our major feature and our major differentiator is price, but comes at the expense of having a timid selection of native apps and frequent breakage. The Linux Hater blog parodied this on a series of posts called the <a href="http://linuxhaters.blogspot.com/">Greatest Hates</a>. <p>The only way to fix Linux is to take one distro, one set of components as a baseline, abadone everything else and everyone should just contribute to this single Linux. Whether this is Canonical's Ubutu, or Red Hat's Fedora or Debian's system or a new joint effort is something that intelligent people will disagree until the end of the days. http://tirania.org/blog/archive/2012/Aug-29.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Aug-29.html Wed, 29 Aug 2012 16:09:00 -0500 Mono 2.11.3 is out <p>This is our fourth preview release of Mono 2.11. This version includes <a href="http://weblogs.asp.net/scottgu/archive/2012/07/19/entity-framework-and-open-source.aspx">Microsoft's recently open sourced EntityFramework</a> and has been updated to match the latest .NET 4.5 async support. <p>We are quite happy with over 349 commits spread like this: <pre> 514 files changed, 15553 insertions(+), 3717 deletions(-) </pre> <p>Head over to <a href="http://www.go-mono.com/mono-downloads/download.html">Mono's Download Page</a> to get the goods. <p> http://tirania.org/blog/archive/2012/Aug-13.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Aug-13.html Mon, 13 Aug 2012 19:04:00 -0500 Hiring: Documentation Writer and Sysadmin <p>We are growing our team at Xamarin, and we are looking to hire both a documentation writer and a system administrator. <p>For the documentation writer position, you should be both familiar with programming and API design and be able to type at least 70 wpms (you can check your own speed at <a href="http://play.typeracer.com/">play.typeracer.com</a>). Ideally, you would be based in Boston, but we can make this work remotely. <p>For the sysadmin position, you would need to be familiar with Unix system administration. Linux, Solaris or MacOS would work and you should feel comfortable with automating tasks. Knowledge of Python, C#, Ruby is a plus. This position is for working in our office in Cambridge, MA. <p>If you are interested, email me at: miguel at xamarin. http://tirania.org/blog/archive/2012/Aug-11.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Aug-11.html Sat, 11 Aug 2012 16:17:00 -0500 XNA on Windows 8 Metro <p><img src="http://download.codeplex.com/Download?ProjectName=monogame&DownloadId=331456&Build=18696" align="right">The <a href="http://monogame.codeplex.com/">MonoGame Team</a> has been working on adding Windows 8 Metro support to MonoGame. <p>This will be of interest to all XNA developers that wanted to target the Metro AppStore, since Microsoft does not plan on supporting XNA on Metro, only on the regular desktop. <p>The effort is taking place on IRC in the #monogame channel on irc.gnome.org. The code is being worked in the <a href="https://github.com/mono/MonoGame/tree/develop3d">develop3d</a> branch of MonoGame. http://tirania.org/blog/archive/2012/Apr-19.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Apr-19.html Thu, 19 Apr 2012 22:07:00 -0500 Contributing to Mono 4.5 Support <p>For a couple of weeks I have been holding off on posting about how to contribute to Mono, since I did not have a good place to point people to. <p>Gonzalo has just updated our Status pages to include the differences betwee <a href="http://go-mono.com/status/">.NET 4.0 to .NET 4.5</a>, these provide a useful roadmap for features that should be added to Mono. <p>This in particular in the context of ASP.NET 4.5, please join us in <a href="http://lists.ximian.com/mailman/listinfo/mono-devel-list">mono-devel-list@lists.ximian.com</a>. http://tirania.org/blog/archive/2012/Apr-13.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Apr-13.html Fri, 13 Apr 2012 21:54:00 -0500 Modest Proposal for C# <p>This is a trivial change to implement, and would turn what today is an error into useful behavior. <p>Consider the following C# program: <pre> struct Rect { public int X, Y, Width, Height; } class Window { Rect bounds; public Rect Bounds { get { return bounds; } set { // Some code that needs to run when the property is set WindowManager.Invalidate (bounds); WindowManager.Invalidate (value); bounds = value; } } } </pre> <p>Currently, code like this: <pre> Window w = new Window (); w.Bounds.X = 10; </pre> <p>Produces the error: <pre> Cannot modify the return value of "Window.Bounds.X" because it is not a variable </pre> <p>The reason is that the compiler returns a copy of the "bounds" structure and making changes to the returned value has no effect on the original property. <p>If we had used a public field for Bounds, instead of a property, the above code would compile, as the compiler knows how to get to the "Bounds.X" field and set its value. <p>My suggestion is to alter the C# compiler to turn what today is considered an error when accessing properties and doing what the developer expects. <p>The compiler would rewrite the above code into: <pre> Window w = new Window (); var tmp = w.Bounds; tmp.X = 10; w.Bounds = tmp; </pre> <p>Additionally, it should cluster all of the changes done in a single call, so: <pre> Window w = new Window (); w.Bounds.X = 10; w.Bounds.Y = 20; </pre> <p>Will be compiled as: <pre> Window w = new Window (); var tmp = w.Bounds; tmp.X = 10; tmp.Y = 20; w.Bounds = tmp; </pre> <p>To avoid calling the setter for each property set in the underlying structure. <p>The change is trivial and wont break any existing code. http://tirania.org/blog/archive/2012/Apr-11.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Apr-11.html Wed, 11 Apr 2012 15:31:00 -0500 Can JITs be faster? <p>Herb Sutter discusses in his <a href="http://herbsutter.com/2012/04/02/reader-qa-when-will-better-jits-save-managed-code/">Reader QA: When Will Better JITs save Managed Code?</a>: <blockquote> In the meantime, short answer: C++ and managed languages make different fundamental tradeoffs that opt for either performance or productivity when they are in tension. <p>[...] <p>This is a 199x/200x meme that’s hard to kill – “just wait for the next generation of (JIT or static) compilers and then managed languages will be as efficient.” Yes, I fully expect C# and Java compilers to keep improving – both JIT and NGEN-like static compilers. But no, they won’t erase the efficiency difference with native code, for two reasons. <p>First, JIT compilation isn’t the main issue. The root cause is much more fundamental: Managed languages made deliberate design tradeoffs to optimize for programmer productivity even when that was fundamentally in tension with, and at the expense of, performance efficiency. (This is the opposite of C++, which has added a lot of productivity-oriented features like auto and lambdas in the latest standard, but never at the expense of performance efficiency.) In particular, managed languages chose to incur costs even for programs that don’t need or use a given feature; the major examples are assumption/reliance on always-on or default-on garbage collection, a virtual machine runtime, and metadata. </blockquote> <p>This is a pretty accurate statement on the difference of the mainstream VMs for managed languages (.NET, Java and Javascript). <p>Designers of managed languages have chosen the path of safety over performance for their designs. For example, accessing elements outside the boundaries of an array is an invalid operation that terminates program execution, as opposed to crashing or creating an exploitable security hole. <p>But I have an issue with these statements: <blockquote> Second, even if JIT were the only big issue, a JIT can never be as good as a regular optimizing compiler because a JIT compiler is in the business of being fast, not in the business of generating optimal code. Yes, JITters can target the user’s actual hardware and theoretically take advantage of a specific instruction set and such, but at best that’s a theoretical advantage of NGEN approaches (specifically, installation-time compilation), not JIT, because a JIT has no time to take much advantage of that knowledge, or do much of anything besides translation and code gen. </blockquote> <p>In general the statement is correct when it comes to early Just-in-Time compilers and perhaps reflects Microsoft's .NET JIT compiler, but this does not apply to state of the art JIT compilers. <p>Compilers are tools that convert human readable text into machine code. The simplest ones perform straight forward translations from the human readable text into machine code, and typically go through or more of these phases: <center> <img src="http://tirania.org/s/977fd53d.png"> </center> <p>Optimizing compilers introduce a series of steps that alter their inputs to ensure that the semantics described by the user are preserved while generating better code: <center> <img src="http://tirania.org/s/679d485f.png"> </center> <p>An optimization that could be performed on the high-level representation would transform the textual "5 * 4" in the source code into the constant 20. This is an easy optimization that can be done up-front. Simple dead code elimination based on constant folding like "if (1 == 2) { ... }" can also be trivially done at this level. <p>An optimization on the medium representation would analyze the use of variables and could merge subexpressions that are computed more than once, for example: <pre> int j = (a*b) + (a*b) </pre> <p>Would be transformed by the compiler into: <pre> int _tmp = a * b; int j = _tmp + _tmp; </pre> <p>A low-level optimization would alter a "MULTIPLY REGISTER-1 BY 2" instruction into "SHIFT REGISTER-1 ONE BIT TO THE LEFT". <p>JIT compilers for Java and .NET essentially break the compilation process in two. They serialize the data in the compiler pipeline and split the process in two. The first part of the process dumps the result into a <code>.dll</code> or <code>.class</code> files: <center> <img src="http://tirania.org/s/34c474f8.png"> </center> <p>The second step loads this file and generates the native code. This is similar to purchasing frozen foods from the super market, you unwrap the pie, shove it in the oven and wait 15 minutes: <center> <img src="http://tirania.org/s/62ebc31f.png"> </center> <p>Saving the intermediate representation and shipping it off to a new system is not a new idea. The <a href="http://en.wikipedia.org/wiki/TenDRA_Compiler">TenDRA C and C++</a> compilers did this. These compilers saved their intermediate representation into an architecture neutral format called <a href="http://en.wikipedia.org/wiki/Architecture_Neutral_Distribution_Format">ANDF</a>, similar in spirit to .NET's Common Intermediate Language and Java's bytecode. TenDRA used to have an installer program which was essentially a compiler for the target architecture that turned ANDF into native code. <p>Essentially JIT compilers have the same information than a batch compiler has today. For a JIT compiler, the problem comes down to striking a balance between the quality of the generated code and the time it takes to generate the code. <p>JIT compilers tend to go for fast compile times over quality of the generated code. Mono allows users to configure this threshold by allowing users to pick the optimization level defaults and even lets them pick LLVM to perform the heavy duty optimizations on the code. Slow, but the generated code quality is the same code quality you get from LLVM with C. <p>Java HotSpot takes a fascinating approach: they do a quick compilation on the first pass, but if the VM detects that a piece of code is being used a lot, the VM recompiles the code with all the optimization turned on and then they hot-swap the code. <p>.NET has a precompiler called NGen, and Mono allows the --aot flag to be passed to perform the equivalent process that TenDRA's installer did. They precompile the code tuned for the current hardware architecture to avoid having the JIT compiler spend time at runtime translating .NET CIL code to native code. <p>In Mono's case, you can use the LLVM optimizing compiler as the backend for precompiling code, which produces great code. This is the same compiler that Apple now uses on Lion and as LLVM improves, Mono's generated code improves. <p>NGen has a few limitations in the quality of the code that it can produce. Unlike Mono, NGen acts merely as a pre-compiler and tests suggest that there are very limited extra optimizations applied. I believe NGen's limitations are caused by .NET's Code Access Security feature which Mono never implemented [1]. <p>[1] Mono only supports the CoreCLR security system, but that is an opt-in feature that is not enabled for desktop/server/mobile use. A special set of assemblies are shipped to support this. <h2>Optimizing JIT compilation for Managed Languages</h2> <p>Java, JavaScript and .NET have chosen a path of productivity and safety over raw performance. <p>This means that they provide automatic memory management, arrays bounds checking and resource tracking. Those are really the elements that affect the raw performance of these languages. <p>There are several areas in which managed runtimes can evolve to improve their performance. They wont ever match the performance of hand-written assembly language code, but here are some areas that managed runtimes can work on to improve performance: <p>><b><A href="http://en.wikipedia.org/wiki/Alias_analysis">Alias analysis</a></b> is simpler as arrays are accessed with array operations instead of pointer arithmetic. <p>Intent: with the introduction of LINQ in C#, developers can shift their attention from how a particular task is done to expressing the desired outcome of an operation. For example: <pre> var biggerThan10 = new List<int>; for (int i = 0; i < array.Length; i++){ if (array [i] > 10) biggerThan10.Add (i); } </pre> <p>Can be expressed now as: <pre> var biggerThan10 = x.Where (x => x > 10).Select (x=>x); // with LINQ syntax: var biggerThan10 = from x in array where x > 10 select x; </pre> <p>Both managed compilers and JIT compilers can take advantage of the rich information that is preserved to turn the expressed intent into an optimized version of the code. <p><b>Extend VMs:</b> Just like Javascript was recently extended to support strongly typed arrays to improve performance, both .NET and Java can be extended to allow fewer features to be supported at the expense of safety. <p>.NET could allow developers to run without the CAS sandbox and without AppDomains (like Mono does). <p>Both .NET and Java could offer "unsafe" sections that would allow performance critical code to not enforce arrays-bounds-optimization (at the expense of crashing or creating a security gap, this can be done today in Mono by using -O=unsafe). <p>.NET and Mono could provide allocation primitives that allocate objects on a particular heap or memory pool: <pre> var pool = MemoryPool.Allocate (1024*1024); // Allocate the TerrainMesh in the specified memory pool var p = new pool, TerrainMesh (); [...] // Release all objects from the pool, all references are // nulled out // Assert.NotEquals (p, null); pool.Destroy (); Assert.Equals (p, null); </pre> <p><b>Limiting Dynamic Features:</b> Current JIT compilers for Java and .NET have to deal with the fact that code can be extended dynamically by either loading code at runtime or generating code dynamically. <p>HotSpot leverages its code recompiled to implement sophisticated techniques to perform devirtualization safely. <p>On iOS and other platforms it is not possible to generate code dynamically, so code generators could trivially devirtualize, inline certain operations and drop features from both their runtimes and the generated code. <p><b>More Intrinsics:</b> An easy optimization that JIT engines can do is map common constructs into native features. For example, we recently inlined the use of ThreadLocal&lt;T&gt; variables. Many Math.* methods can be inlined, and we applied this technique to <a href="http://tirania.org/blog/archive/2008/Nov-03.html">Mono.SIMD</a>. http://tirania.org/blog/archive/2012/Apr-04.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Apr-04.html Wed, 04 Apr 2012 15:53:00 -0500 Microsoft's new Open Sourced Stacks <p>Yesterday <a href="http://weblogs.asp.net/scottgu/archive/2012/03/27/asp-net-mvc-web-api-razor-and-open-source.aspx">Microsoft announced</a> that another component of .NET would be open sourced. The entire <a href="http://aspnetwebstack.codeplex.com/">ASP.NET MVC</a> stack is now open source, including the Razor Engine, System.Json, Web API and WebPages. <p>With this release, they will start accepting external contributions to these products and will be running the project like other open source projects are. <h2>Mono and the new Stacks</h2> <p>We imported a copy of the git tree from <a href="http://aspnetwebstack.codeplex.com/">Codeplex</a> into <a href="http://github.com/mono/">GitHub's Mono organization</a> in the <a href="https://github.com/mono/aspnetwebstack">aspnetwebstack</a> module. <p>The mono module itself has now taken a dependency on this module, so the next time that you run autogen.sh in Mono, you will get a copy of the aspnetwebstack inside Mono. <p>As of today, we replaced our System.Json implementation (which was originally built for Moonlight) and replaced it with Microsoft's implementation. <p>Other libraries like Razor are next, as those are trivially imported into Mono. But ASP.NET MVC 4 itself will have to wait since it depends on extending our own core ASP.NET stack to add asynchronous support. <p>Our github copy will contain mostly changes to integrate the stack with Mono. If there are any changes worth integrating upstream, we will submit the code directly to Microsoft for inclusion. If you want to experiment with ASP.NET Web Stack, you should do this with your own work and work directly with the upstream maintainers. <h2>Extending Mono's ASP.NET Engine</h2> <p>The new ASP.NET engine has been upgraded to support C# 5.0 asynchronous programming and this change will require a number of changes to the core ASP.NET. <p>We currently are not aware of anyone working on extending our ASP.NET core engine to add these features, but those of us in the Mono world would love to assist enthusiastic new developers of people that love async programming to bring these features to Mono. http://tirania.org/blog/archive/2012/Mar-28.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Mar-28.html Wed, 28 Mar 2012 20:20:00 -0500 Mono 2.11.0 is out <p>After more than a year of development, we are happy to announce Mono 2.11, the first in a series of beta releases that will lead to the next 2.12 stable release. <h2>Continuous Integration</h2> <p>To assist those helping us with testing the release, we have setup a new continuous build system that builds packages for Mac, OpenSUSE and Windows at <a href="http://wrench.mono-project.com/Wrench/">http://wrench.mono-project.com/Wrench</a>. <h2>Packages</h2> <p>To test drive Mono 2.11 head to our our <a href="http://www.go-mono.com/mono-downloads/download.html">downloads page</a> and select the "Alpha" section of the page to get the packages for Mac, Windows or Linux. <p>The Linux version is split up in multiple packages. <p>The Windows version ships with Gtk+ and Gtk# <p>The Mac version ships with Gtk+, Gtk#, F#, IronPython and IronRuby and comes in two versions: Mono Runtime Environment (MRE) and the more complete Mono Development Kit (MDK). <p>At this stage, we recommend that users get the complete kit. <h2>Runtime Improvements in Mono 2.11</h2> <p>There are hundreds of new features available in this release as we have accumulated them over a very long time. Every fix that has gone into the Mono 2.10.xx series has been integrated into this release. <p>In addition, here are some of the highlights of this release. <p><b>Garbage Collector:</b> Our SGen garbage collector is now considered production quality and is in use by Xamarin's own commercial products. <p>The collector on multi-CPU systems will also distribute various tasks across the CPUs, it is no longer limited to the marking phase. <p>The guide <a href="http://mono-project.com/Working_With_SGen">Working with SGen</a> will help developers tune the collector for their needs and discusses tricks that developers can take advantage of. <p><b>ThreadLocal&lt;T&gt;</b> is now inlined by the runtime engine, speeding up many threaded applications. <p><b>Full Unicode Surrogate Support</b> this was a long standing feature and has now been implemented. <h2>C# 5.0 -- Async Support</h2> <p>Mono 2.11 implements the C# 5.0 language with complete support for <a href="http://msdn.microsoft.com/en-us/vstudio/async.aspx">async programming</a>. <p>The Mono's class libraries have been updated to better support async programming. See the section "4.5 API" for more details. <h2>C# Backend Rewrite</h2> <p>The compiler code generation backend was rewritten entirely to support both IKVM.Reflection and System.Reflection which allowed us to unify all the old compilers (<code>mcs</code>, <code>gmcs</code>, <code>dmcs</code> and <code>smcs</code>) into a single compiler: <code>mcs</code>. For more information see <a href="http://www.mono-project.com/Release_Notes_Mono_2.12#C.23_Backend_Rewrite">Backend Rewrite</a>. <p>The new IKVM.Reflection backend allows the compiler to consume any mscorlib.dll library, instead of being limited to the ones that were custom built/crafted for Mono. <p>In addition, the compiler is no longer a big set of static classes, instead the entire compiler is instance based, allowing multiple instances of the compiler to co-exist at the same time. <h2>Compiler as a Service</h2> <p>Mono's Compiler as a Service has been extended significantly and reuses the compiler's fully instance based approach (see <a href="http://www.mono-project.com/Release_Notes_Mono_2.12#Instance_API">Instance API</a> for more details). <p>Mono's compiler as a service is still a low-level API to the C# compiler. The NRefactory2 framework --shared by SharpDevelop and MonoDevelop-- provides a higher level abstraction that can be -- used by IDEs and other high-level tools. <h2>C# Shell</h2> <p>Our C# interactive shell and our C# API to compile C# code can in addition to compiling expressions and statements can now compile class definitions. <h2>4.5 API</h2> <p><b>4.5 Profile</b> Mono now defaults to the 4.5 profile which is a strict superset of the 4.0 profile and reuses the same version number for the assemblies. <p>Although .NET 4.5 has not yet been officially released, the compiler now defaults to the 4.5 API, if you want to use different profile API you must use the -sdk:XXX switch to the command line compiler. <p>Because 4.5 API is a strict superset of 4.0 API they both share the same assembly version number, so we actually install the 4.5 library into the GAC. <p>Some of the changes in the 4.5 API family include: <ul> <li>New Async methods <li>WinRT compatibility API <li>Newly introduced assemblies: System.Net.Http, System.Threading.Tasks.Dataflow </ul> <p>The new System.Net.Http stack is ideal for developers using the C# 5.0 async framework. <h2>Debugging</h2> <p>The GDB support has been extended and can pretty print more internal variables of Mono as well as understanding SGen internals. <p>The soft debugger has seen a large set of improvements: <ul> <li>Single stepping is now implemented using breakpoints in most cases, speeding it up considerably. <li>Calls to System.Diagnostics.Debugger:Log()/Break () are now routed to the debugger using new UserLog/UserBreak event types. <li>S390x is now supported (Neale Ferguson). <li>MIPS is now supported. <li>Added new methods to Mono.Debugger.Soft and the runtime to decrease the amount of packets transmitted between the debugger and the debuggee. This significantly improves performance over high latency connections like USB. </ul> <h2>Mac Support</h2> <p>Mac support has been vastly extended, from faster GC by using native Mach primitives to improves many features that previously only worked on Linux to extending the asynchronous socket support in Mono to use MacOS X specific primitives. <h2>New Ports</h2> <p>We have completed the Mono MIPS port. <h2>Performance</h2> <p>As a general theme, Mono 2.11 has hundreds of performance improvements in many small places which add up. http://tirania.org/blog/archive/2012/Mar-22.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Mar-22.html Thu, 22 Mar 2012 14:33:00 -0500 Mono and Google Summer of Code <p>Students, get your pencils ready for an intense summer of hacking with the <a href="http://www.google-melange.com/gsoc/org/google/gsoc2012/mono">Google Summer of Code and Mono!</a> <p>Check out the Mono organization <a href="http://www.mono-project.com/Gsoc">Summer of Code Project site</a>. http://tirania.org/blog/archive/2012/Mar-16-1.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Mar-16-1.html Fri, 16 Mar 2012 19:41:00 -0500 Cross Platform Game Development in C# <p>If you missed the live session on Cross Platform Game Development in C# from <a href="http://altdevblogaday.com/2012/02/27/altdevconf-session-videos/">AltDevConf</a> you can now watch <a href="http://www.youtube.com/watch?v=qOnUog6WeUUour">presentation</a>. <p>You can also check <a href="http://altdevblogaday.com/2012/02/27/altdevconf-session-videos/">the videos for all the AltDevConf</a> presentations. http://tirania.org/blog/archive/2012/Mar-16.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Mar-16.html Fri, 16 Mar 2012 16:33:00 -0500 Working With SGen <p>As SGen becomes the preferred garbage collector for Mono, I put together the <a href="http://mono-project.com/Working_With_SGen">Working With SGen</a> document. This document is intended to explain the options that as a developer you can tune in SGen as well as some practices that you can adopt in your application to improve your application performance. <p>This document is a complement to the low-level implementation details that we had <a href="http://mono-project.com/Generational_GC">previously posted</a>. http://tirania.org/blog/archive/2012/Mar-05-2.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Mar-05-2.html Mon, 05 Mar 2012 19:18:00 -0500 Gtk+ and MacOS X <p>We have released a <a href="http://www.go-mono.com/mono-downloads/download.html">new build of Mono 2.10.9</a> (Beta) with the latest version of Gtk+2 containing dozens of bug fixes done by the <a href="http://www.lanedo.com/">Lanedo team</a> to improve the quality of Mono/Gtk+ apps on OSX. <p>This is still a beta release, please take it out for a spin, we are almost ready to graduate this as our stable Mono package. http://tirania.org/blog/archive/2012/Mar-05-1.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Mar-05-1.html Mon, 05 Mar 2012 16:20:00 -0500 Phalanger's PHP on Mono/.NET Updates <p>The <a href="http://www.php-compiler.net/">Phalanger developers</a> have published an updated set of <a href="http://www.php-compiler.net/benchmarks">benchmarks of their PHP compiler</a> running on top of .NET vs PHP and Cached PHP, and the results are impressive: <center> <img src="http://tirania.org/s/65a38d9f.png"> </center> <p>There are two cases on the language shootout where they are slower than PHP (out of eighteen cases) and they are also slower on eight of thirtyone microbenchmarks. <p>But in general with real applications like WordPress and MediaWiki, the performance gains are impressive. http://tirania.org/blog/archive/2012/Mar-05.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Mar-05.html Mon, 05 Mar 2012 16:18:00 -0500 C# for Gaming: Slides <p>You can now get the <a href="http://tirania.org/slides/AltDevConf-2012-Mono.pdf">Slides for my Mono for Game Development</a> talk. <p>Or you can go straight to the <a href="https://gist.github.com/1804402">resources</a> for the talk. http://tirania.org/blog/archive/2012/Feb-11.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Feb-11.html Sat, 11 Feb 2012 22:12:00 -0500 C# for Gaming: AltDevConf This Weekend <p>It is a great honor to participate this weekend on the online <a href="http://altdevconf.com/">AltDevConf conference</a>. This is an online <a href="http://altdevblogaday.com/2012/02/02/altdevconf-schedule/">two-day event</a> <blockquote> Our goal is twofold: To provide free access to a comprehensive selection of game development topics taught by leading industry experts, and to create a space where bright and innovative voices can also be heard. We are able to do this, because as an online conference we are not subject to the same logistic and economic constrains imposed by the traditional conference model. </blockquote> <p>I will be participating in the talk on <a href="http://altdevblogaday.com/2012/02/09/altdevconf-programming-laban/">Cross Platform Game Development</a> using C# with Matthieu Laban and Philippe Rollin. <p>You can <A href="https://www4.gotomeeting.com/register/729719079">register here</a> for our session on Saturday at 3pm Eastern Standard Time, noon Pacific Time, and 9pm Paris Time. <p>If you are located in the Paris time zone, that means that you get to enjoy the talk sipping a tasty hot chocolate with some tasty baguettes. http://tirania.org/blog/archive/2012/Feb-09.html miguel@gnome.org (Miguel de Icaza) http://tirania.org/blog/archive/2012/Feb-09.html Thu, 09 Feb 2012 19:59:00 -0500