Mark Probst has been working for the past few months on adding support to the Mono JIT to support generic code sharing. This is a technique that allows the JIT to share the same code generated for two differently instantiated types, for example:
class Stack<T> { T [] data = new T [10]; int top; public void Push (T t) { data [top++] = t; } public T Pop () { return data [--top]; } public int Count { get { return top; } } } class Test { static void Main () { Stack<long> ls = new Stack<long> (); ls.Push (10); Stack<Test> ts = new Stack<Test> (); ts.Push (new Test ()); Console.WriteLine ("Count={0} {1}", ls.Count, ts.Count); } }
The JIT must generate different code for the actual Stack instantiation, one must contain a pointer (32 bits on 32 bit machines) and another one must contain 64 bits. So the structures are different in memory, and so is the implementation for Push and Pop.
But certain methods do not depend on the datatype sizes (for example) and could be shared regardless of how their container type is instantiated.
Mark posted the Good news, the bad news and his strategy to deal with the bad news. Am going to limit myself to the good news, and you can click on the link and read the thread for the bad news:
Now for some interesting statistics. Apart from the runtime's test suite I've used three other test suites/benchmarks, namely IronPython (running pystone), Nemerle (compiling its own compiler) and FSharp (compiling and running a Hello World program). Here are the Good-News-statistics. The numbers given are "no sharing / sharing" and have been collected on a 32 bit system: IronPython Methods compiled: 3614 / 3368 native code space used: 719k / 691k Nemerle Method compiled: 7210 / 6302 native code space used: 2001k / 1943k FSharp Methods compiled: 15529 / 11431 native code space used: 2193k / 2062k
See his post for the rest.
Update: Mark informs me that the "bad news" that I conveniently left out of this post (memory consumption in FSharp for bookkeeping was 600k of memory) has now been fixed.
The 600k of bookkeeping in the FSharp test has been now turned down to 14k. So we can scratch that "bad news" part. Congratulations Mark!
Posted on 16 Apr 2008
This weekend ath the Code Camp in Waltham, Igor Moochnick announced the release of pash his open source power shell implementation. It currently runs on Linux, MacOS, WindowsCE and Windows.
pash on Linux.
Igor's project is hosted on sourceforge.
A few years ago Ryan Paul from Arstechnica wrote a nice guide to powershell (when it was still called Monad Shell).
Posted on 07 Apr 2008
Regardless of where you stand on the outcome of OOXML becoming an ISO standard, it is worth pointing out that the opposition to OOXML pushed Microsoft into more open directions.
If you are sulking because OOXML was approved, it is worth looking at what actually was accomplished since December of 2005 when the process begun.
Before OOXML came to ISO and the global review of it begun:
Once OOXML went for discussion at ISO, a number of good things came out and are major community wins:
1. The specifications for the old binary file formats were published under the OSP (February of 2008).
2. The above documents were backed up by the British Library in case Microsoft ever stops publishing them (announcement).
3. Microsoft is funding the development of a translator between the old binary file formats and OOXML which should assist folks that have experience in one format and want to understand the other, or just want to convert documents back and forth. If your app lacked support for OOXML, but had support for the old formats, you can use these tools.
4. Microsoft agreed that future versions of OOXML will be covered by the OSP a concern that some people had about future versions of the document.
5. Microsoft pledged to modify future versions of Office to implement the ISO version of OOXML.
6. working group was created to look into harmonization of OOXML and ODF, something that many developers involved in office suites have been advocating for a long time.
7. Microsoft pledged to support features to support other file formats as native file formats in their office suite:
Last year we sponsored a translator project that gave people the ability to read and write ODF files from Microsoft Office. Last month we announced that we would update the Office product so that the ODF translators could natively plug into Office and give people the same options they get from the other file formats. People will be able to set ODF as the default format in Office if that's what they want by simply installing the translators and then changing their settings.
8. Lots of clarifications went into the spec, and people should be happy about that.
9. And finally, now that OOXML is an ISO standard, as Patrick Durusau implied there are many winners.
Anyways, I wanted to keep this short and uplifting, this seems like a win for everyone all around.
Preemptive-reply-to-the-above-paragraph: I will not reply/approve any flames, FUD or half-truths.
Posted on 02 Apr 2008
Posted on 28 Mar 2008
I have been reading the OOXML storm in a teacup for more than a year now. Am looking forward to the approval of OOXML as an ISO standard and to be able to move the discussion back to the things that actually matter: free and open source software.
For a year, countless bytes have been wasted on what is now a very difficult plot to follow, specially for people that have not followed it since the start (or as Bill Maher said last week "Its like trying to make sense of a LOST episode". Note: am a Lost fan).
When we go back to what matters, we should be ready to ask IBM to open source its Lotus Notes software based on Open Office (as staunch supporters of open formats, and open source, I think its in their best interest to do so). There are nice components in Lotus Notes that would be nice to integrate into the upcoming OpenOffice 3.
But most importantly, it is a time for all of those strong advocates of open standards to stop talking, and start walking. I look forward for all that energy that went into discussing the pros and cons of OOXML to join an open source project and start contributing code, documentation, support, create support forums, file good bug reports and help us make free and open source software better.
In case you have not been noticing, Apple is gaining market share on the desktop. Some of our own kernel hackers, desktop hackers, web hackers that used to be Linux or BSD users are flocking to the proprietary OSX.
We need to change that, lets reverse that trend, and lets focus on what actually matters: the free and open source desktop. To make this happen we will need all the help that we can get.
Punditry and lobbying will not get us very far, real work will.
Posted on 26 Mar 2008
The Mono project will be participating once again in the Google Summer of Code.
Although some ideas from various teams are available in our student projects page this year, I want to encourage students to feel free to submit ideas that they think should be done with Mono.
In past years, a handful of students suggested their own ideas as to what would be an interesting project to work on during the summer, we liked those and turned those into full fledged projects.
Feel free to suggest a project that you think would be useful to the Mono community, and to discuss your idea with us in the Mono Summer of Code IRC channel: #monosoc on irc.gnome.org
Posted on 24 Mar 2008
Mono contributor Jonathan has been hard at work and has added support for Generics to Monodoc as well as importing the ECMA documentation for the new generic APIs.
Monodoc now also support man pages (we have a handful now, and we will later add all the mono ones) and we now render using a CSS stylesheet instead of the collection of gross hacks that we used to have.
Posted on 24 Mar 2008
From Dave Winer's blog:
Melroy Hodge, from Queens, NY, a contact on Twitter, sent a pointer to a YouTube video of a longer excerpt of Jeremiah Wright's post-911 sermon, one of the speeches that soundbites were shown repeatedly on cable news this week. I guess it's not surprising that the cable news excerpts gave a very misleading impression. (Next time this happens we must do an immediate fact-check.) http://www.youtube.com/watch?v=QOdlnzkeoyQThis is a must-watch video. Stop what you're doing, right now, and watch it.
I found myself captivated by Wright's ideas and the way he expresses them.
I agree with everything he said.
I would have been willing to cut him some slack, because this was less than a week after the attack, and those were crazy days, who knew what was coming next. But he was right, we have done what they did to us, and we're doing it again in Iraq. The US was led by despotic people and we followed; we wanted to punish someone, anyone, and it didn't matter if they had anything to do with what happened to us. And we did.
Read the whole post from Dave Winer's blog. The video as he says, is a must-watch.
Also, from the twitter-o-sphere:
Posted on 22 Mar 2008
Microsoft is working on a OOXML SDK for managed languages. They have announced a roadmap:
Being selfish here, I would love to see this SDK relreased under an MS-PL license myself, I think it would be great to get folks outside of the Windows world consume and produce OOXML files easily.
This is a win-win for everyone. Microsoft gets more products consuming and producing OOXML documents on the Windows and MacOS worlds through Mono, and we get a great API to use on Linux with .NET languages.
Although I have emailed a few friends, am not sure am reaching the right people inside Microsoft. I would love to discuss the advantages that MS-PLing the code base would have.
It has to be under a license like the MS-PL as opposed to just a license to use and distribute on Linux for this code to make it and be distributed eventually into Linux distributions.
Posted on 22 Mar 2008
We became fans of the Dog Whisperer TV show from the Discovery Channel in the past few months. Sadly, we are unable to have a dog at home, so we might look for a new place.
My friend Shelly pointed me to Gladewell's article on the New Yorker about Cesar Milan, just as fun and interesting as watching the show.
Posted on 22 Mar 2008