Monday, October 11, 2004

Yep, one day Haskell and LISP will rule the world. Until then we'll just have to live with C# and its new closure-imitating syntax.

One of my design goals with the managed Scheme compiler is to enable easy interoperability with existing managed languages through delegate-based entrypoints. This communication needs to flow both ways, so that for example a lambda can substitute for a delegate and vice versa. My backend actually has its own representation for functions, enabling fine-grained control over scoping and such, but mutliple entrypoints are provided for this explicit purpose.

So for example,

delegate object Transform(object o);
void Map(Transform a, Array arr)
{
  //...
}

Can be called from a Schema program as follows,

((func-lkup "Map(Transform, Array)")
  (lambda (x)
    (* x 2))
  (10 15 20 25))

...and the other way around.

10/11/2004 11:38:57 PM (Pacific Daylight Time, UTC-07:00)  #   

Krzys just blogged an update that I made a bit ago to the DesignGuidelines document. It's a bit of prescriptive guidance on when to use Factory-based object creation over traditional constructors, mostly influenced by what we've done historically in the Framework. This was actually my first update to “the DG” (as it's commonly referred to), and I've made a few others since then.

The most recent update I made taught me quite a bit during the writing process... I worked with RicoM, Don Syme, and Andrew Kennedy on it (I wouldn't have gotten the facts straight otherwise!), but a whole slew of other folks throughout WinFX also had a shared interest in seeing this topic documented. It's a fairly complicated and heated subject, but the bottom line is that under certain well-defined circumstances two NGen'd images could be unable to share generics instantiation code. In such a situation, the JIT will end up being called in. This ends up being pretty bad, especially when people often go to great lengths to avoid calling in the JIT altogether... surprise!

I'll look into posting the actual DG update over the next couple days... the original email thread on which we hashed out the logic might also interesting to some folks. Maybe I can post that too, in keeping with that whole transparency thingamajiggie.

I'm currently overhauling our guidance on finalization and disposability. The internal feedback keeps pouring in on these topics, and at this point I'm in a hurry just to get something out there to stop the bleeding! ;)

10/11/2004 11:10:58 PM (Pacific Daylight Time, UTC-07:00)  #   

 Sunday, October 10, 2004

As mentioned previously, I ate at the Herbfarm last night... absolutely amazing. 9 courses, 5 hours. Too many glasses of wine. ;) The atmosphere at the restaurant was very different than any other. Many high-end restaurants are stuffy and uncomfortable even though they may serve up killer dishes and have great wine menus, filled primarily with folks entertaining business associates and the like. The Herbfarm, on the other hand, is truly a place for people who love great local, artisinal food and wine to gather and have a great night out.

For memory's sake, here's the menu (yes, that Madeira is from the year nineteen-hundred-one... it's not a typo!):

A Menu for
A Mycologist's Dream
Saturday, October 9, 2004

From the Gatherer's Basket
Grilled Honey Mushroom with Spot Prawn
Bears Tooth Mushroom with Sea Urchin Flan
Poached Flat Oyster with Angel Wings
1998 Domaine Meriwether Brut, Captain Wm Clark Cuvee

Chestnut and Delicata Squash Ravioli
With Cauliflower Mushrooms & Quince in Lemon Thyme Consomme
2003 Poet's Leap Riesling

Herb-Smoked Wild Sturgeon with Matsutake
On Savoy Cabbage with Pear
2003 Patricia Green Cellars Chardonnay, Four Winds Vineyard

Lobster Mushroom, Hedgehog, Hawks Wing, and Blue Chanterelle Mushroom Terrine
With Wilted Spinach and Bacon
2001 Beaux Freres Belles Soeurs Pinot Noir

Concord Grape and Rosemary Ice

Spice-Rubbed Muscovy Duck Breast
With Two Gratins: King Bolete-Potato
And Red Chart-Duck Confit
1999 Glen Fiona Walla Walla Syrah, Puncheon Aged

A Mycologist's Salad
Chanterelles, Yam, Asian Pear & Quillisacut Goat Cheese

Harvest Festival of Desserts
Hardy Kiwi and Lemon Verbena Tart
Pumpkin-Bay Sundae
Carmelized Apple Souffle
With Orange-Thyme Custard Sauce

Brewed Coffees, Teas & Infusions

A Selection of Small Treats
Vintage 1901 Barbeito Malvazia Madeira
Herbfarm Yeasted Corn Bread & Multi-Grain Rolls
Chive-Calendula Butter Coins

10/10/2004 9:21:58 PM (Pacific Daylight Time, UTC-07:00)  #   

 Saturday, October 09, 2004

I've decided to track my book progress by capturing a number of interesting data points at the end of each writing session. If there are other interesting ones folks would like to see, let me know and I'll start recording them.

Here's what I have at the end of my first session... I'm pretty slow right now, trying to get used to the various writing templates, guidelines, and styles provided by my publisher. I hope my output beefens up as I progress.

Date Chapters Done Pages Words Chars Paragraphs Sentences Passive Reading Ease
10/9/2004 0 4 1038 5518 89 41 7% 38.9

At one of my previous jobs, I was affectionately (I think) referred to as the Data Pig. Oink, oink.

10/9/2004 1:31:29 PM (Pacific Daylight Time, UTC-07:00)  #   

 Saturday, October 02, 2004

I've been really bad about blogging lately. So much to do, and so little time in which to do any of it. One thing sure remains constant: time keeps ticking away.

Over the last couple weeks, I've been working on a book proposal and outline. It got submitted last night. I was approached by a publisher a few weeks back to author a book, and if all continues going well I'll likely take the offer. I'm particularly excited about the project albeit a bit scared about the time commitment.

Progress on my Scheme compiler has been minimal because of the book effort. This is really a shame because I'd spend all day working on it if I could. Like I said, time is something I'm short on at the moment.

I began writing a paper which I'd love to complete, but that will likely take some time. It explores using structural equivalence for type matching and operational subsumption, foregoing the artificial inheritance policy that OO slams on types. I'm particularly interested in exploring how this would enable rich ecosystems of types to borrow and share implementations from each other at runtime, introducing mutations in parallel. Basically, an evolutionary type system.

Microsoft has been going well, although it obviously eats up most of my time and energy. Mostly this is a shame, simply because I have research work like my Scheme compiler that I am completely in love with. The energy people have there is just sickening at times, and it's difficult to remain in the game 100% of the time. I've found that it's easy to fall behind and lose effectiveness, simply because of a loss of focus for a minimal amount of time.

I had one of those "you're a moron" moments today. Was sitting there, and suddenly some guy shows up at my office door. I was so involved in what I was doing, my brain just couldn't do the context switch fast enough. Paraphrasing... "Hi, I'm Herb. Do you agree with the premise of the email I sent earlier?" I responded, "The value type finalizer thing?" Blank stare between the two of us. Him: "Value types don't have finalizers..." Perplexed, I thought about it for a moment. Ahh, yes... "Oh, disposable value types." Turns out it was Herb Sutter, a C++ Architect and smart dude. It always amazes me how whenever I open my mouth I make myself look like an idiot.

I went to a friend's place last weekend to hang out. It's great to unwind and let the noggin' relax for a little bit. Unfortunately, it again reminded me of my lack of a strong long term career goal. I used to think that it was being a (successful) entrepreneur, as various business topics have always interested me (such as competition and macro-economics). However, computer science is my passion, and academia and/or a research environment seems like a natural fit. I thought of this because many of the folks at the gettogether were PhD's and there was at least one professor from UoW. I wonder every day if that's my real calling.

Chilled with KitG, JoelPob, and AMoore tonight for a couple beers. Two Aussies and a New Zealander. All on the same team. Who woulda thunk it? Good fun.

Anyhow, it's only 1AM and I've got some reading to do!

10/2/2004 1:06:21 AM (Pacific Daylight Time, UTC-07:00)  #   

 Monday, September 27, 2004

Another one of those "What kind of person am I?" surveys... courtesy of Mr. Sells.

your distinct personality, The Prime Minister might be found in most of the thriving kingdoms of the time. You are a strategist who pursues the most efficient and logical path toward the realization of the goal that you perceive or visualize. You will often only associate with those people who can assist you in the implementation of your plan. Inept assistants may be immediately discarded as excess baggage. To do otherwise could be seen as inefficient and illogical. On the positive side, you can be rationally idealistic and analytically ideological. You can be a bold decision maker and risk taker who can move society ahead by years instead of minutes. On the negative side, you may be unmerciful, impatient, impetuous and impulsive. Interestingly, your preference is just as applicable in today's corporate kingdoms.

I especially love the bit about being impatient and impulsive. Me? Naahhh...

9/27/2004 2:54:34 PM (Pacific Daylight Time, UTC-07:00)  #   

 Friday, September 24, 2004

We just had a DevDiv get-together (that's Developer Division for nonconformists out there)... free beer, and a couple hours to wind down is never a bad thing. At one point, we had a discussion burning away about the optimal number of children a couple should have. In the midst, the following gem popped up:

Brad: I've been successful at convincing her we should have a prime number of children.
Anthony: Yes, then at least you could store them properly in a hashtable.
<ensuing laughter>

Good point, I thought.

9/24/2004 6:17:06 PM (Pacific Daylight Time, UTC-07:00)  #   

 Saturday, September 18, 2004

Yup, another one of these book posts... I've actually found the process very revealing for my own self; I very seldom take a structured look at my activities, and I think research and reading is one that deserves structure. The next step is to plan ahead rather than simply analyze prior trends.

How to Solve It: Modern Heuristics
by Zbigniew Michalewicz, David B. Fogel

10 of 10. This book is easily within the select few books that I've enjoyed 150%, page for page. The general topic of heuristic-based problem solving strategies is discussed, including search- and network-based solution techniques, evolutionary approaches, along with plenty of fundamental information on problems, modeling, and the process of devising solutions. I felt engaged throughout, constantly presented with example problems to keep my brain active. Although some relatively elementary math is used to express concepts, the book is surprisingly easy to read (considering the density and depth of the material covered).

Just as a teaser, I'll go ahead and offer up one of the simplistic examples found early in the book:

Mr. Smith and his wife invited four other couples for a party. When everyone arrived, some of the people in the room shook hands with some of the others. Of course, nobody shook hands with their spouse and nobody shook hands with the same person twice.

After that, Mr. Smith asked everyone how many times they shook someone's hand. He received different answers from everybody.

How many times did Mrs. Smith shake someone's hand?

microserfs
by Douglas Coupland

8 of 10. This was a gift, and was read within a couple days of receiving it. The book is basically a novel that reads like a pathetic Microsoft employee's journal. He and his friends decide to be not-so-pathetic, and decide to join a 90's-style start-up, but still end up being pathetic. I'm still unsure what sucked me in, as I'm typically not a fan of works of fiction, but perhaps it was the truthfulness of the Microsoft cultural references that did me in. It's a bit frightening when a fictional book reads as though it's a diary of your own life... oh, and it was written ~10 years ago! Now, I'd like to think that I'm not as sad as the characters in the story, but perhaps I'm in denial? ;)

Waltzing with Bears: Managing Risk on Software Projects
by Tom DeMarco, Timothy Lister

7 of 10. For that spreadsheet-oriented part of your brain. Covers some fairly straightforward (duhh) concepts that, as in most books written on topics of business and management matters, should be obvious but often aren't. And no, this book doesn't advocate for eliminating risk entirely, quite the opposite actually. Which is why I found it interesting: it is primarily about managing and mitigating the negative consequences that could result from making (and managing the implementation of) risky decisions.

Joel on Software: And on Diverse and Occasionally Related Matters That Will Prove of Interest to Software Developers, Designers, and Managers, and to Those Who, Whether by Good Fortune or Ill Luck, Work with Them in Some Capacity
by Joel Spoelsky

7 of 10. Most of this material is available right on Joel's weblog, but for those who prefer killing trees (which I do, not for the killing trees part but rather the yet-to-be-widely-understood preferable feeling of holding a book in one's hands) this was worth it. His style of writing gives some people heartburn, but if you take it for what it is, it's enjoyable. So what is it? Well, a collection of op-ed pieces on technology from somebody with a respectable amount of experience and success in the software industry. Luckily, you can get a good taste of his style by reading his weblog and be at ease knowing the book is significantly less expensive than your average book covering the subject of computers.

In Search of Stupidity: Over 20 Years of High-Tech Marketing Disasters
by Alan MacFarlane, Iris MacFarlane

9 of 10. A classic tale of foolish mistakes that have sunk entire software- product units and/or companies over the years. I burst out laughing several times, and still can't believe that many of the stories are true. I find that learning from other peoples' mistakes is often more valuable than digesting theoretical prose, especially when it comes to business advice. This book serves that purpose perfectly.

From Airline Reservations to Sonic the Hedgehog: A History of the Software Industry
by Martin Campbell-Kelly

8 of 10. A very well-written historical account of the software industry, and (imho) an indispensable resource for attempting to understand where we've been and where we're going. This fell into the category of "once you start, you just can't put it down"... for me, at least.

I've also been particularly enjoying a set of Don Syme's [MSResearch] publications. I found the coverage of ILX very insightful, and particularly relevant to my current Scheme compiler effort (man, I need a freaking code name badly).

9/18/2004 3:43:31 PM (Pacific Daylight Time, UTC-07:00)  #   

 Thursday, September 16, 2004

I've been happily hacking away at my managed Scheme implementation. Just a quick progress report. I'm ~50% done with my parser, a hand-crafted LR(1) top-down predictive kind of guy. I'm realizing now that this might have been a suboptimal choice as the Scheme grammar is fairly ambiguous at times and results in quite a bit of backtracking. E.g. take a look at how many freaking nonterminals start with '(' that can appear interchangably... Once I get this more baked, I might consider alternative algorithms as part of the optimization phase.

For those who are curious, I'm using this as my primary language reference.

My object model looks like this thus far:

Lexical tokens:

+ Token
  - EosToken
  - BooleanToken
  + IdentifierToken
    - VariableToken
    - KeywordToken
  - LiteralToken
  - NumberToken
  - CharacterToken
  - StringToken

Parse tree nodes:

+ TreeNode
  + ExpressionNode
    + LiteralExpressionNode
      - QuotationExpressionNode
      - SelfEvaluatingExpressionNode
    - ProcedureCallExpressionNode
    - LambdaExpressionNode
    - ConditionalExpressionNode
    - AssignmentExpressionNode
    - DerivedExpressionNode
    - MacroUseExpressionNode
    - MacroBlockExpressionNode
  - FormalsNode
  - BodyNode
  - SeuqneceNode
  + DatumNode
    - SimpleDatumNode
    + CompoundDatumNode
      - ListDatumNode
      - AbbreviationDatumNode
      - VectorDatumNode

The latter, as previously stated, is only ~50% complete. Still happy with progress thus far... Got a looooooooonng way to go.

9/16/2004 12:32:20 AM (Pacific Daylight Time, UTC-07:00)  #   

 Monday, September 13, 2004

Some people picked up on my reference to an obscure number grammar last week, so I figured I'd post briefly about my intentions.

I am cooking up a managed Scheme interpreter and compiler. There are still several unknowns at this point... for example, I'm not even sure what approach I'm going to take with regards to licensing and releasing the source (it's primarily just an academic exercise for my own benefit). My actual code generation story isn't fully baked yet, either. Regardless, I am keeping a sort of dev-log which I intend to transform into a paper or set of blog posts when it makes sense to do so. So these tough decisions should be well documented.

I'm hand-authoring the front- and back-ends, knowing fully that there are tools out there that could auto-generate much of it for me. Call me a control freak. The process has been very interesting thus far, actually (albeit a bit tedious at times... e.g. do I put one or two characters back on the buffer?). I'm continuously reminded of the age-old search for the perfect mix of generalized and specialized code.

The milestone I spoke of last week was successfully implementing the lexer and its ancillary components. I found some compliance scripts on the 'net which are proving handy for testing. When I say it's complete, I mean complete: it lexes any valid Scheme, and has an error-detection/recovery strategy that I'm fairly happy with. Took about 1.5klocs.

Granted, Scheme has a pretty straightforward lexical structure... the super-difficult bit is certainly the code generation. I think the biggest challenge for the entire effort will be getting acceptable parse/emit/execute performance when operating in interpreter mode (the default).

9/13/2004 4:06:56 PM (Pacific Daylight Time, UTC-07:00)  #   

 

RSS 2.0

Me
 

Joe Send mail to the author(s) is an architect and developer on a systems incubation project at Microsoft.

Recent

Search

Browse

Disclaimer:
The content of this site are my own personal opinions and do not represent my employer's view in anyway.

© 2013, Joe Duffy