Passion * Technology * Ruthless Competence

Friday, March 07, 2008

Morning Coffee 156

  • My hockey team won last night 4-2. No points for me, but I was even on the night. I did spend some time in the penalty box, but I was serving a two many men on the ice bench minor. We only had nine skaters, not enough for two full lines, so I'm pretty tired today. However, I'm not as tired as I was two weeks ago - that's a good sign.
  • Politics 2.0 watch: The Obama campain announced yesterday that they raised $55 million in donations in the month of February. That's significantly more than Clinton ($35 million) and McCain ($12 million) combined. Even more impressive is that $45 million of that was raised online, of which $40 million were from donations of $100 or less and $22.5 million were from donations of $25 or less. I guess in Politics 2.0, individuals contribute more than online punditry and video parodies of political commercials.
  • TextGlow is a Sivlerlight 2 based Word docx file viewer, created by James Newton-King. Nice, but what I really want is "SlideGlow", a SL2 based PPTX file viewer. (via DNK)
  • Speaking of Silverlight, Windows Live launched an experimental site called PhotoZoom which will let you create DeepZoom photo albums. (via LiveSide)
  • Charlie Calvert has created a home for Language Futures discussion on MSDN Code Gallery. If you'll recall, back in January he asked for input on Dynamic Lookup. Now he's looking for feedback on Call Hierarchy, a proposed VS IDE feature to help you visualize how your code flows. Great idea, but the Call Hierarchy dialog mockup isn't very intuitive. Couldn't we put these visualizations into the code editor window directly, like CodeRush does?
  • John Lam continues his Dynamic Silverlight series, first building a Flickr image browser in Managed JScript then showing how to integrate an IronRuby version of the Flickr image browser with an ASP.NET MVC app.
  • EdJez is inspiring. Subscribed. (via Brad Wilson)
Posted By Harry Pierson at 10:34 AM Pacific Standard Time

Friday, February 22, 2008

Morning Coffee 149

Posted By Harry Pierson at 10:34 AM Pacific Standard Time

Friday, February 01, 2008

Morning Coffee 142 - Wishful Catchup Edition

  • After spending most of the last four days away from my desk, I was planning on a quiet day to catch up on a variety of things. Then I heard the oh-so-minor news that Microsoft is offering to buy Yahoo for almost $45 billion. Hasn't been much reaction on the dev, architecture, politics and hockey-oriented blogs I read, but you can get a ton of reactions on TechMeme.
  • Lost is back. Finally. I stayed up late last night reading Lostpedia, catching up on Lost Missing Pieces and the Find 815 ARG.
  • Alex The Great had four goals and an assist in last night's victory. Coughing up three goal lead and letting the Canadiens tie the game in the last 30 seconds isn't encouraging, but a win is a win. The Caps are currently one game behind the SE leading Hurricanes and two games behind the current eight seed Rangers. Alex was named first star for January.
  • Ted Neward has a nice summary of Lang.NET by day: one, two and three. I wonder if my talk qualifies for the exception to Ted's rule that "A blog is not a part of your presentation, and your presentation is not part of your blog". I had 15 minutes to discuss something I've written about over ten posts  (so far).
  • John Lam points to the latest DLR hosting spec. I'm much more interested in the DLR code generator, but at least the hosting interface is documented.
  • Scott Hanselman has a nice post on fluent interfaces. Note to self, find out if Beautiful Soup works with IronPython.
  • I wonder if the VS Source Code Outliner PowerToy works with F#? (via Sam Gentile)
  • Chris Tavares has an extensive post Deconstructing ObjectBuilder? I've poked around inside OB before, but I'm really looking forward to Unity (also via Sam Gentile)
  • NVIDIA finally updated the drivers for the video card in my Tecra M4. That only took a year.
Posted By Harry Pierson at 10:05 AM Pacific Standard Time

Thursday, January 31, 2008

Morning Coffee 141 - Lang.NET '08 Edition

header I was hoping to blog my thoughts on Lang.NET as the event went along. Obviously, that didn't happen, though I was pretty good about dumping links into my del.icio.us feed. The talks were all recorded, and should be up on the website in a week or two. Rather than provide a detailed summary of everything that happened, here are my highlights:

  • The coolest thing about conferences like this is what John Rose called "N3" aka "Nerd-to-Nerd Networking". It was great to meet in person, drink with and geek out with folks who's blogs I read like Tomas Petricek, Wesner Moise and Larry O'Brien. Plus, I got to meet a bunch of other cool folks like Gilad Bracha, Stefan Wenig and Wez Furlong. That's worth the price of admission (which was admittedly nothing) right there.
  • Coolest MSFT talk: Martin Maly "Targeting DLR". I was wholly unaware that the DLR includes an entire compiler back end. Martin summarized the idea of DLR trees on his blog, but the short version is "you parse the language, DLR generates the code". That's pretty cool, and should dramatically lower the bar for language development. Of course, I want to write my parser in F#, so I'm going to port the DLR ToyScript sample to F#.
  • Runner-up, Coolest MSFT talk: Erik Meijer "Democratizing the Cloud with Volta". Erik is a great speaker and he really set the tone of his session with the comment "Division by zero is the goal, not an error". He was referring to an idea from The Change Function that user's measure of success is a function of perceived crisis divided by perceived pain of adoption. Erik wants to drive that adoption pain to zero. It's a laudable goal, but I remain unconvinced on Volta.
  • Coolest Non-MSFT talk: Gilad Bracha "Newspeak". Newspeak is a new language from one of the co-authors of Java. It's heavily smalltalk influenced, and runs on Squeak. He showed developing PEGs in Newspeak, and they were very compact and easy to read, easier even than F#. He calls them Executable grammar, and you can read his research paper or review his slides on the topic. Unfortunately, Newspeak isn't generally available at this time.
  • Runner-up, Coolest Non-MSFT talk: Miguel de Icaza "Moonlight and Mono". The talk was kinda all-over-the-place, but It's great to see how far Mono has come. Second Life just started beta testing a Mono-based script runner for their LSL language (apparently, Mono breaks many LSL scripts because it runs them so fast). He also showed off Unity, a 3D game development tool, also running on Mono.
  • Resolver One is a product that bridges the gap between spreadsheets and applications, entirely written in IronPython (around 30,000 lines of app code and 110,000 lines of test code, all in IPy). Creating a spread-sheet based app development environment is one of those ideas that seems obvious in retrospect, at least to me. If you do any kind of complicated spreadsheet based analysis, you should check out their product.
  • If you're a PowerShell user, you should check out PowerShell+. It's a free console environment designed for PowerShell and a damn sight better than CMD.exe. If you're not a PowerShell user, what the heck is wrong with you?
  • Other projects to take a deeper look at: C# Mixins and Cobra Language.
  • I thought my talk went pretty well. It's was a 15 minute version of my Practical Parsing in F# series. Several folks were surprised I've been coding F# for less than a year.
Posted By Harry Pierson at 10:25 AM Pacific Standard Time

Monday, January 28, 2008

Morning Coffee 140

  • I only posted one Morning Coffee post last week. It wasn't a lack of content, it was a lack of drive on my part. I had 20-30 items flagged in my news reader, but for some reason I couldn't work up the interest in posting them. So some of these are a bit old.
  • I'm at the Language.NET Symposium this week, so look for lots of language blogging. I've already chatted with Tomáš Petříček and John Lam. If someone kicks Ted Neward's ass because he hates Perl, I'll try and liveblog it.
  • Speaking of Ted Neward, he discusses the question "Can Dynamic Languages Scale?" without devolving into a flame-fest. I agree 100% with his point about the difference between performance scaling and complexity scaling. Personally, I tend to err on the side of better complexity scaling, since buying hardware is easier than hiring developers.
  • Nick Malik responds to me calling his shared global integration vision flawed. He points to NGOSS/eTOM as an example of a shared iterative model that works. I know squat about that shared model, so I'll refrain from commenting until I do a little homework on the telco industry.
  • Speaking of shared interop models, Microsoft is joining DataPortability.org. Dare Obasanjo and Marc Canter are skeptical that so far this effort is all hype and no substance. Reminds me a bit of AttentionTrust.org. But if DataPortability.org can get off the ground, maybe there's hope for Nick's vision (or vis-versa).
  • Don Syme lists what's new in the latest F# release. As I said, this release is pretty light on features. Hopefully, I'll get some details
  • Tomas Restrepo shows how to change your home folder in PowerShell. I need to do this.
Posted By Harry Pierson at 9:10 AM Pacific Standard Time

Monday, July 09, 2007

Morning Coffee 98

  • Morning Coffee was canceled on Thursday and Friday on account of a kidney stone. So not fun. Luckily, it was a little one and it was alone, but I will be listening very closely to my doctor's advice to avoid another.
  • Took the kids to see Ratatouille last Tuesday and saw Transformers yesterday with my wife due to fluke babysitter luck. I liked Ratatouille, but I'm not sure it's the 51st best movie of all time. On the other hand, major props for making a kid movie with a significant lack of toy tie-ins. Ratatouille is a better movie that Cars, but I don't see my four year old boy trading in is Lightning McQueen toy car for a Remy the Rat. Transformers on the other hand obviously did not forgo the toy tie-ins! Still, it wasn't bad. Kinda reminded me of The Rock with a bigger budget.
  • Micahville listed DevHawk on it's list of 69 Tech Blogs That Don’t Suck. Thanks!
  • David Ing boldly writes that C# is getting fat. Or maybe it's just big-boned. My take: no question that integrated query is a big feature that covers a lot of surface area. But given the prevalence of databases and other queriable stores, it's critical to improving programmer productivity. Go read Todd Proebsting's talk on Disruptive Programming Language Technologies. Two of his candidates for disruptive language technologies were Database Integration and Manipulating XML. LINQ neatly covers both.
  • According to John Shewchuck, the new BizTalk Services release is available. However, when I click on the "what's new" page, it tells me they're experiencing technical difficulties. (Their error page is Oops.aspx. Funny!)
  • Scott Hanselman has Programming Personas 2.0. Who are you? I thought I was and "Order n" Architect (the quote "Where's the whiteboard" is spot on) but my CS background isn't as strong as the persona's.
  • Sam Gentile is starting to dig into Concurrency and he has a great list of links that have influenced his design.
Posted By Harry Pierson at 11:06 AM Pacific Daylight Time

Monday, June 04, 2007

Morning Doughnuts 7

Once again I get the chance to fill in for Harry while he is gone. I will attempt to keep up with the high standard he has set.

  • Be careful with trampolines. I have a four year old that was bouncing on a trampoline this weekend. He twisted his knee slightly on landing, and decided that the fastest way to get comfort was to jump off the edge. His knee gave out and he fractured his tibia. I don't think this was how he planned to start his summer. At least he is pretty calm about the whole thing.
  • It looks like there is a good product out there named CliSecure to obfuscate .net code. From what I was able to read it looks like a pretty decent product, even hiding the code while its in memory. (via Larkware)
  • TechEd started this morning. While I am sure Harry will be giving some on-site reports there is a link to the virtual site here.
  • There is a great video showing Gregor Hohpe talking about SOA, and the many unrealistic claims in the industry. If you have read any of Hohpe's work it is clear that he has a great understanding of the topic. (via Nick Malik)
  • The NBA Finals will begin this week with the Spurs playing the Cavaliers and King LeBron. I wonder if this will help rescue the NBA from what seems to be a real apathy on the part of the average fan. Other than the series between Dallas and Golden State earlier in the play-offs it really seems there haven't been any compelling stories. The NBA really needs a shot in the arm to become relevant again.
Posted By Dale Churchward at 10:18 AM Pacific Daylight Time

Thursday, May 31, 2007

Morning Coffee 86

  • Google announces Gears, a browser plugin for taking your web application offline. Developer docs are also available. TechMeme has lots more, but obviously this is yet another significant bow shot in the upcoming unified client platform war. By my count, there are four horses in this race: Microsoft with .NET and Silverlight, Adobe with Flash and Apollo, Google with AJAX and Gears and Sun with Java and JavaFX. Did I miss anyone? (via Dare Obasanjo and Scott Hanselman)
  • Alex James writes that REST is about intent and shows a pseudo-code sample posting multiple changes to a single endpoint as a way of demonstrating your intent that they be applied atomically. Andres Aguiar left a comment saying that Astoria does something similar. Personally, I like that model for transactions better than the transaction factory approach Jon Udell describes. But either way, you've moved beyond simple CRUD style services and into the world of protocol. Surfacing intent via protocol aligns with what Tim described as making the protocol explicit
  • Windows Live posted new beta versions of Writer, Mail and Messenger. I've been on an internal build of the new Writer for a while and I've really been impressed. There's also a new Provider Customization API, so I can't wait to see what the DasBlog folks do with that.
  • Scott Guthrie's LINQ series continues, this time covering how to build the LINQ to SQL data model. Looks like they used the DSL toolkit to build the LINQ to SQL data model designer, cool! 
  • Martin Fowler digs into racc, a yacc-esque compiler compiler for Ruby. Looks interesting as a internal DSL example (better than the now-canonical rake example). But why is the sexy new language on the block using old school CFG's instead of new hotness PEG's?
  • Speaking of Martin, he writes about the opportunity Ruby presents to Microsoft, building on Scott Hanselman's concerns that Microsoft is losing the Alpha Geeks. Sam Gentile also weighs in, suggesting that Microsoft is at the crossroads. Frankly, I don't work in evangelism anymore so I'm going pass these links along without comment except to say that Scott, Martin and Sam are all folks I have much much respect for.
Posted By Harry Pierson at 11:15 AM Pacific Daylight Time

Wednesday, May 23, 2007

Morning Coffee 82

  • Dare reached a similar conclusion about Silverlight and Apollo that I did. But newly minted Adobe RIA evangelist Ryan Stewart writes that calling Silverlight vs. Apollo the next platform competition is overblown. However, he then reiterates my point that MSFT is moving in on Adobe's traditional stronghold (aka the web) while Adobe is moving in on MSFT's traditional stronghold (aka the desktop). The upshot is that both companies are trying to deliver a unified "client" platform that spans desktop, devices and browser. That sounds like "platform competition" to me.
  • Apparently I'm missing the this years compiler dev lab. :( John Lam is there, with slides from his talk on the DLR. Miguel de Icaza is there, with fairly extensive notes. Hopefully they will post talks like they did last year.
  • Speaking of languages, Scott Hanselman explains why he thinks Ruby is "the tits". Personally, on the scale between "I can't see where Ruby is such hot shit" and "Ruby is the tits", I'm somewhere near the middle, leaning towards tits. I love the expressiveness of Ruby's syntax, but I miss the static typing. Call me over the hill, but I like the compiler catching mistakes at compile time. I realize it's not for everyone, but I like what I like.
  • This talk about Ruby's expressiveness reminds me of something Larry O'Brien said in the wake of the IronRuby announcement: "I am surprised by the IronRuby announcement. I really thought we were going to see some form of Ruby#:Ruby::C#:Java. Although I'm happy, I was actually hoping to see a new language." The expressiveness of Ruby that Scott describes (which is to say, not all of Ruby's expressiveness) would be completely achievable in a statically typed language. Personally, I'd like to see that language...
  • My birthday is past, but I want a Lego Ice Cube Tray. (via Geekdad)
Posted By Harry Pierson at 11:01 AM Pacific Daylight Time

Friday, May 18, 2007

Morning Coffee 79

  • Soma announces PopFly, the "fun, easy way to build and share mashups, gadgets, Web pages, and applications" from the Non-Professional tools team. The PopFly team blog has some videos. Sounds vaguely like Yahoo! Pipes, but cooler. While most of the focus is on their browser-based mashup creator, they also have VS support for the non-non-professionals among us.
  • Eric Nelson suggests that the new Dynamics CRM systems is actually a LOB application platform in it's own right. More details in Ben Riga's MIX session. (via Gianpaolo)
  • Sam Gentile is worried that C# is becoming to complex, especially when you also consider how fast the platform is moving underneath. When you get your head out of the debugger for a second and look at the Big Picture, it certainly seems overwhelming. Is it just a question of getting used to it? The first time I fired up the VS.net 2002 alpha and looked at all the classes in the BCL, I had the same overwhelmed feeling, but eventually I got over it. Or have things just gotten too big and move to fast now? If so, it's time for some new layers of abstraction...
  • Udi Dahan writes about building testable services. Testability has to be a core consideration when building anything, but especially a reusable framework. I've had similar thoughts about language design. How do you unit test a DSL?
  • Roberto Medrano of SOA Software thinks "maybe 20 percent of IT folks understand SOA and half of the rest think they do". Personally, I think most IT folks don't agree on what SOA is or should be. Furthermore, we don't even have a common lexicon to discuss it, so we end up talking past each other and arguing about topics we agree on. I think Roberto is really saying is "most people are wrong because they don't agree with what I think SOA is". (via Jack van Hoof)
  • Jeffrey Snover talks about the virtuous cycle of .NET language support. His point is that time spent learning .NET pays off as you transition between system programming (C#, VB.NET), shell programming (PowerShell) and script programming (IronPython, DLR). I'm not sure I would break them down that way, but his point spot on.
  • Clemens Vasters experiments with the new BizTalk Services with a sample called TweetieBot. I agree 100% with his point about the assumption of centralization will be challenged by the federation of personal services.
Posted By Harry Pierson at 12:03 PM Pacific Daylight Time

Tuesday, April 17, 2007

Morning Coffee 65

  • My brother is a VaTech alumni, so the shock of the deadly shootings there yesterday hits very close to home. My heavy heart is with the grieving Hokie nation today.
  • Jeff Atwood has a couple of great posts on Language vs. Platform. Earlier in my MSFT career, I spent a significant amount of time explaining .NET, often to companies that had made a significant investment in Java. Picking the Java platform is fine (it's almost the best platform around!), but it seemed many people I spoke to didn't understand the fact that "[w]hen you choose a language, like it or not, you've chosen a platform".
  • Ian Thomas riffs on my When is a Service Not a Service post. I like Ian's thinking about SaaS as an analogy for SOA adoption - if for no other reason that SaaS is easier to "get". But trying to realize SOA via SaaS inside the enterprise is a mistake in my opinion (and I think Ian would agree with that). SaaS is a business model, and I don't think you want to turn your enterprise into an internal service marketplace. Instead, this ties back with Nick Malik's points about central planning. Regardless if I'm right or wrong, I subscribed to Ian's blog (and not just because he linked to me - check out his Elements of the Future Business Ecosystem)
  • TLA Watch: Oracle coins Application Integration Architecture (aka AIA). Joe McKendrick calls it "Big SOA". Isn't this the market segment that BizTalk has been in for seven years?
Posted By Harry Pierson at 9:53 AM Pacific Daylight Time

Tuesday, April 03, 2007

Morning Coffee 56

  • I survived the weekend no problem. My wife has the details of what she did for the weekend while I played Mr. Mom. The kids were great, we even went to see the Easter Bunny on Sunday. Wish the weather had been better, but we did get to go on a little walk around the neighborhood between hailstorms Sunday after naps.
  • Between taking the kids all morning until Jules got home from the airport and going to opening day for a team morale event, I worked about 30 minutes yesterday. In case you're wondering, that's way below average. I typically work at least twice that every day. :)
  • After maintaining a post a day average for January and February, I slipped a bit in March. Twenty seven posts in thirty one days. So that puts me five posts behind for the year as of this one.
  • Dale let me borrow Madden 07 for the weekend so I could pump my gamerscore (a practice called gamerscore whoring). I still need 255 points by April 22nd to complete the Old Spice Experience Challenge. I'm not proud of it, but it's not like I have much time to play these days.
  • Mads Kristensen has a new .NET blog engine intuitively called BlogEngine.NET. I wonder how it compares to dasBlog, which powers DevHawk. (via DotNetKicks)
  • I wrote a last week that unit test support should be in the Express editions of VS. Thanks to Jamie Cansdale, it is. (via Larkware)
  • Scott Hanselman saved his C# Tiny OS project from the impending shutdown of GDN and reposted it to his blog. I first met Scott at TechEd Malaysia 2002, so I remember seeing him present this "back in the day".
  • EMI is going to start offering songs sans DRM @ $1.29 a pop. Assuming other labels follow suit, this is gonna be huge. (via Loke Uei
  • Jomo Fisher writes about using LINQ as a string switch compiler that's about 900% faster than using a hash table. Money quote: "Any time I see a data structure with a capability I’m not using it makes me wonder whether I can trade that capability for something I do need—in this case a speed boost." LINQ is turning out to be much more interesting than just a (much) better way to query databases. (via DotNetKicks)
Posted By Harry Pierson at 11:07 AM Pacific Daylight Time

Thursday, March 15, 2007

I'm Wrong Because Ruby and Powershell Are Mainstream

Brad Wilson and Scott Hanselman took me to task for my comment the other day that no "mainstream" language had implemented extension methods:

How mainstream is Ruby on Rails for you? Ruby is a full fledged dynamic language. No hacks for "extension methods" (Brad)

Ya, I kind of blanched at that statement too...method_missing is pretty mainstream... (Scott)

They're right, Ruby does support the addition (and redefinition I think) of methods on a class at any time. There's a sample of this in the Classes and Objects chapter of Programming Ruby (aka the pick-axe book) where they add a basic documentation facility "available to any module or class" in Ruby by adding a doc instance method to the Module class.

class Module
  @@docs = Hash.new(nil)
  def doc(str)
    @@docs[self.name] = str
  end

  def Module::doc(aClass)
    # If we're passed a class or module, convert to string
    # ('<=' for classes checks for same class or subtype)
    aClass = aClass.name if aClass.type <= Module
    @@docs[aClass] || "No documentation for #{aClass}"
  end
end

Given how Ruby classes are defined, I think the newly added methods have access to the private data of the class. Extension methods in C#3/VB9 only have access the public interface of the object. But that's a fairly minor difference.

FYI, Powershell can do this as well, though not as succinctly as Ruby. Scott has an example how you can add a DatePhotoTaken property to System.IO.FileInfo using Omar Shahine's PhotoLibrary project.

Chalk this up to my continuing ignorance of dynamic languages. I'm working on it, albeit slowly.

Posted By Harry Pierson at 12:53 PM Pacific Standard Time

Monday, March 05, 2007

Morning Coffee 38

  • As predicted, the XNA guys had a bunch of news to announce at GDC. They launched the XNA Creators Club Online with samples, forums and a new starter kit. Also they announced some cool partnerships for Creators Club Premium members (aka the folks who paid $99 a year to be able to run code on their Xbox 360) including access to the highly anticipated Torque X Engine.
  • From Don Syme, we here that the new 1.9 version of F# is almost ready. When I shifted from learning F# to learning PowerShell, it wasn't because of a sudden lack of interest in F#, so I'm glad to see them still chugging along. And by the time they release 2.0 later this year, I hope to have learned enough PowerShell that I can spend some time focusing on learning F#.
  • Apparently Jenny Lam at Microsoft reviewed more than 10,000 images to pick the new Vista Wallpapers. Not sure if I would love or hate that job. But some that didn't make the cut are available online. (via DotNetKicks)
  • Tomas Restrepo reviews a number of lightweight, syntax-highlighting text editors. Personally, I like Notepad2, but as Tomas mentions there's no way to save your settings. Also, there's no way to add new syntax highlighting without recompiling it. For example, Wesner Moise compiled a version that added Ruby syntax. I really want a version that that supports PowerShell. Maybe it's time to give Notepad++ a closer look
  • Dale has some new SOAhlocis Anonymous shirts available.
  • Jeff Atwood discovers that the French acronym for object oriented programming is POO.
Posted By Harry Pierson at 10:22 AM Pacific Standard Time

Monday, January 22, 2007

Morning Coffee 15

  • I was checking out the ASP.NET community site, and I noticed a small "Microsoft Communities" toolbar across the top. There's a little menu that links to other MS community sites like Channel 9 and MSDN Blogs. I'm surprised the NetFx3 community site isn't included.
  • My teammate Dale is blogging about Proper SOA. He lays out 6 Proper SOA principles, and then drills into the first three: meets business needs, requires governance and responds to changing business drivers. I expect to see posts on the remaining principles this week. Maybe Dale should turn this series into an article.
  • Speaking of articles about architecture, Architecture Journal 10 is online as a PDF. This issue's topic is Composite Applications.
  • Malbolge is a programming lanugage that is "specifically designed to be difficult to program in." Here's Hello World in Malbolge:
    (=<`$9]7<5YXz7wT.3,+O/o'K%$H"'~D|#z@b=`{^Lx8%$Xmrkpohm-kNi;gsedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543s+O<olm
    Seriously. Actually, it's worse than it looks. The effect of any instruction depends on where it is located in memory.  Malbolge is so difficult, it took a month to write a Lisp program to generate that program. However, Lou Scheffer thinks we should think about Malbolge as a cryptosystem. I wonder if it could be used for obfuscation? (via Good Math, Bad Math)
  • Nat Torkington blogs about teaching kids to program. He makes the point about "them to think in terms of small steps". I was lucky to have a computer teacher in elementary school who did something similar. She had us write down instructions for making a peanut butter and jelly sandwich and she then followed them to the letter. For example, if you wrote, "spread peanut butter on the bread" with out first instructing her to take out a slice, she'd happily spread peanut butter on the entire loaf. (via reddit)
  • To this day, my wife thinks the peanut butter and jelly lesson negatively affected my ability to communicate with "normal" people. She'll even say "peanut butter and jelly" when she thinks I'm being particularly obtuse in my communication.
Posted By Harry Pierson at 10:04 AM Pacific Standard Time

Sunday, September 17, 2006

Managed Lex and Yacc

Buried deep in the docs for v3 of the Visual Studio SDK is something called the Managed Babel System. Babel - in the context of Visual Studio - is the framework for creating language services for stuff like syntax highlighting, brace matching, and IntelliSense completion. As part of the Managed version of Babel, the VS SDK includes the Managed Package Lex Scanner Generator (MPLEX) and the Managed Package Parser Generator (MPPG). Online docs are pretty thin, but there are a few white papers in the additional documentation of the VS SDK install.

Interestingly enough, the white papers were written by John Gough of QUT's Programming Languages and Systems group. John wrote Compiling for the .NET Common Language Runtime and PLAS has several interesting language projects including Metaphor and Ruby.NET. As you might expect for a group that focuses on languages on .NET, they have a managed version of YACC called GPPG available and John said at Lang.NET that they would be releasing a managed version of LEX "soon". I'm thinking that QUT's GPPG/GPLEX combo has been absorbed into the VS SDK and renamed MPPG/MPLEX. Unfortunately, my laptop power connector is broken, so I can't verify this until Monday.

It's not a Rosetta stone and the lex/yacc model is getting pretty long in the tooth, but I'm thinking at least Larry O'Brien will be interested in these tools.

UPDATE - Apparently, this is somewhat old news, as per Aaron Marten:

The tools we're including are called MPPG & MPLex (which stand for Managed Package Parser Generator and Managed Package Lexer). They are derivative works from the open-source GPPG/GPLex tools developed at the Queensland University of Technology.
[Managed Language Tools in Visual Studio 2005 SDK]

Posted By Harry Pierson at 9:08 AM Pacific Daylight Time

Thursday, September 07, 2006

Python and DSLs

When I read Larry O'Brien's post IronPython as a Foundation for DSLs, I had a strong sense of deja-vu. I went thru a very similar thought process when I discovered the early versions of IronPython were written in Python. I figured that meant Python must have some support that makes building compilers easier. Unfortunately, that doesn't turn out to be the case. Python provides a standard module called parser which "provides an interface to Python's internal parser". That means that compiling Python is easy, but there's no support for compiling any language other than Python.

I've been doing a little experimenting in this space. First, as I've written before, I've been playing with parsing expression grammars. Second, I want to take a close look at Metaphor from QUT:

Metaphor is a programming language with support for type-safe run-time code generation -- a form of meta-programming. Metaphor is based on a subset of C# or Java and combines the imperative, object-oriented nature of these languages with the multi-stage programming constructs from MetaOCaml. Metaphor uses the static type system of multi-stage languages to achieve compile-time safety of run-time generated code...

Metaphor is implemented as a compiler on the Microsoft CLR.

Finally, I need to take a closer look at ANTLR. Don't know how I missed it, but I had never seen ANTLRWorks until Larry linked to it.

Posted By Harry Pierson at 8:12 PM Pacific Daylight Time

Monday, August 21, 2006

Language Features I Wish C# Had - Symbols

Ruby's symbols are often talked about in terms of efficiency - taking up less memory and executing faster. While these are both laudable goals, symbols are more than just performance improvers. The ability to name things is valuable semantically. Take a look thru p&p's Composite UI AppBlock and you'll see strings used as names for things all over the place. It's great for loose coupling, you see. But how do you tell the difference between a string used as a name and a string used for some other reason like user input? You can't.

Rails makes extensive use of symbols - anyone who has Rolled on Rails has seen "scaffold :recipe". That's just the tip of the iceberg. Rails uses symbols extensively across both ActionPack and ActiveRecord (and probably others I'm not familiar with). It's a great approach, but one that's unique to Ruby as far as I'm aware.

Posted By Harry Pierson at 11:05 PM Pacific Daylight Time

Language Features I Wish C# Had - Tuples

Several languages, such as Python, have the concept of a Tuple built into the lanugage. One of things it's used for in Python is multiple return values. So you can call "return x,y" to return two values. Of course, C# can only return one. If you need to return more values, you have to define out parameters.

LINQ / C# 3.0 / VB 9 support the idea of anonymous types, which is similar to a tuple. The big difference is that, because they're anonymous, they can't leave the scope they're defined in. In other words, they're great within a function, but if you want to pass them out of your function type-safely, you have to define a non-anonymous type for them.

Interestingly enough, F# supports tuples, though it a bit of a hack. Since the CLR doesn't support tuples, F# basically defines different Tuple classes for up to seven tuple parameters (i.e. Tuple<t1,t2,t3,t4,t5,t6,t7>), For .NET 1.x, it's even worse - they have to define different type names (Tuple2, Tuple3, etc). Ugh.

Update - Robert Pickering pointed out that F#'s tuple implementation is entirely transparent inside of F#. He's right - I was writing from the perspective of a C# developer using F#'s implementation of tuples. Maybe I need to be looking closer at F#?

Posted By Harry Pierson at 11:01 PM Pacific Daylight Time

Tuesday, August 15, 2006

Modular Compilers

During Lang.NET, I ended up sitting next to Hua Ming, who's been working on the .NET Classbox project I wrote about previously. .NET Classbox introduces a new syntax for "using" to C# - basically, you can use individual classes as well as whole namespaces, and you can extend the individual classes you use. Obviously, that meant having a custom compiler that was 99% vanilla C# + the extra classbox syntax. Rather than building a C# compiler from scratch, the Classbox project extended the Mono Project C# compiler. Hua described the process as taking a "huge amount of time" and he described the compiler as "a monster". Now, I'm not trying to knock Mono here, I imagine our C# compiler is just as hard to work with. SSCLI's C# compiler directory is 5.5MB of source code alone spread across 126 .h and 68 .cpp files.

Is it just me, or does it seem crazy to have to muck about with such a large code base in order to add a relatively simple language feature? What I'd like to see is a more modular way of building compilers, so that integrating a small language feature like classbox would be a small amount of effort.

Of course, there is some work that's been done in this space. MS Research had a Research C# compiler paper, but it's three years old and one of the two authors has moved on to a cool product group job. I also discovered SUIF and the National Compiler Infrastructure Project, but these don't look like they've been updated in a while.

I like the model that the Research C# compiler proposes. Basically, it looks like this:

  1. Specify the grammar in a modular way. In the paper, the grammar is specified in an Excel file, and you can use multiple files in a modular fashion. i.e. have one file for the core language and another for the extensions.
  2. Late bind a grammar production to an action. Typically, in a lex/yacc style scenario, you embed the action code for a given production directly into the grammar, which makes it extremely hard to extend the existing syntax. In the paper, each production is linked with an instance of a type, so swapping out a new type would seem to be possible.
  3. Generate an abstract syntax tree, that gets processed by multiple visitors. From the paper, the compiler has broken the "traditional" compiler steps - bind, typecheck, rewrite and generate binary (in this case IL) - into separate visitors. That makes adding extra steps or chaning existing steps fairly straightforward.

The only think I don't like about this specific approach is their Excel file based parser generator. It's a huge step beyond the LEX/YACC approach as it is scanner-less (having separate scanner and parser steps kills any chance of modularity) but it still has to deal with ambiguous grammars. Personally, I've been looking at Parsing Expression Grammars in part because they aren't ambiguous. For programming lanugages, support ambiguity in the grammar is a bug, not a feature.

Posted By Harry Pierson at 10:46 AM Pacific Daylight Time

Wednesday, August 02, 2006

Lang.NET Is Helping Game Developers

Back at POPL 06, Tim Sweeny of Epic Games delivered a talk titled "The Next Mainstream Programming Language: A Game Developer’s Perspective". I imagine he was a little too busy getting Gears of War out the door to attend the Lang.NET Symposium. Too bad, as there were interesting solutions presented that solved two of the issues Tim identified in his his POPL talk.

One of the issues Tim identified is one of Modularity. Gears of War uses the Unreal Engine 3. In other words, UE3 is a game framework and GoW uses that framework. As you might expect, this framework is exposed as a hierarchy of objects. Tim's example had "Actor" as the base class in the framework hierarchy, with classes like "Player", "Enemy" and "InventoryItem" inheriting from "Actor". Then he had game-specific classes like "Dragon" and "Sword" inheriting from the generic "Enemy" class. The problem is that game developers also need to extend the functionality of the framework's base classes. That is, they need a game-specific version of "Actor" or "InventoryItem" in addition to the game specific subclasses like "Dragon" and "Sword". Unfortunately, the current generation of languages don't support this, so game developers often clone the entire framework, which is error-prone and hard to support.

At Lang.NET,