Build Your Own .NET Language and Compiler

Published Wed, Sep 15 2004 22:51 | William

All I can say is that  Build Your Own .NET Language and Compiler by Edward Nilges rocks.  I had to write an amazon review b/c the people that trashed it were out of their f----g minds.  http://www.apress.com hasn't put out a '1' Star book that I've come across and the stuff these guys chose to gripe about is beyond lame.  The qoutes from Edsger Wybe Dijkstra are worth the price of the book alone.  The guy is interesting and has a style of writing that I just haven't seen before.  Ever.  Act the risk of sounding like a dork it kind of reminded me of reading Dante's Inferno.  Mainly b/c of all of the footnotes but every time you read one it got your mind thinking in some other interesting and cool direction. I really wish I had read it before we started working on .NET Refactor.  Since Add-ins basically deal with a lot of Code parsing - it would have been a life saver and I'm already working on a few new tricks that I've discovered since I read it.  I almost got through it today and last night and now I'm probably going to spend the next few hours working through some more examples.  Definitely a great read. 

Comments

# William said on September 16, 2004 8:51 PM:

Thanks, Bill! Hey, did we meet at a Microsoft bunfight in 2002? I seem to remember a Bill Ryan with a sense of Irish humor.

Dante's Inferno? Cool! Dante continually gets off topic. You want a clear discussion of the torments awaiting sinners in Hell, but the guy couldn't resist telling you what he knows about evrything, and having a whack at his enemies.

Fortunately, Dan Appleman did an heroic job of keeping me on topic, as did Beth Christmas and the editorial team.

The writing of the book was itself an adventure since I took time off of work, and ran completely out of funds while finishing it. It included but wasn't restricted to pawned laptops and the kindness of strangers.

I wasn't reduced to panhandling on Mission Street but former Bell-Northern cowrokers did help me out and a manager friend gave me a laptop to work on.

Like Blanche Dubois, I am most grateful to the Apress accounting team for helping me out of a total jam when I was passing through San Francisco, writing the book on return from a consulting job on the island of Fiji. They advanced an advance which allowed me to eat, something of which I am fond.

But complementary to Dante's enemies and the disappointments of a long and arduous life (a life that produced "del mezzo del camin de nostra vita" and the darkened wood with which many of us aging geeks are familiar, usually in the server room at 3:00 in the morning) is Beatrice, a vision of the good and true, and in my book there is a dedication to my family and a certain Beatrice.

I am more than happy if the book illuminates "parsing". I have long been, when confronted with the very idea that we can't parse simple business rules, "what part of recursive descent don't you understand?"

Perhaps the book attracted the negative Amazon reviews as part of a Vast Right Wing Conspiracy, and where did I put my tinfoil hat. Or, perhaps there is a slashdot crowd out there who believes that people who actually use Microsoft platforms and VB must be low jungly fellows of no culture.

But this is to believe that the use of Politically Correct platforms and languages like C and unix confers a blessing and instills knowledge. My own experience was that you could see the true concepts even through the dreck, and seeing-through-the-dreck was in fact true knowledge.

# William said on September 17, 2004 8:01 AM:

THanks Andy - and if I did read my comments I wouldn't have read the one posted by the first guy to turn me on to Dijkstra ;-) - but I know, I'm a little slow on the updtake. Actually I'm a week past due on an email I was going to write you but I'm a lazy bum sometimes - I'll drop you a line privately about the CF Stuff. I saw your post on the flaming officer the other day and was rolling -- anyway, I'll drop you a line privately later - got a few suggestions to your question and a few questions about Primes (started getting real into PN alogirthms lately and number theory for some crypto stuff I've been doing).

# William said on September 17, 2004 8:16 AM:

Oops, posted that in the wrong section. Edward - it's Really cool to hear from you. I was actually going to write you with a few questions about the book but as you may note in my incrorrectly posted post to Andy, I'm a bum at times and don't write or write back as quickly as I should.

As far as the Inferno comment, I stand by it wholeheartedly. Your footnotes are all over the place just like the inferno and after I read the first few, I was addicted to them. So I'd read them, start laughing or thinking hard, then get back to the subject at hand - it was the same as the Inferno in that regard and kept the book interesting.

I was going to ask you about the Fiji stuff. I noticed you mentioned the working conditions down there so I figured you had been there. I heard it's a killer place to go and the Kava rocks. Also heard the landing strip/airport is kind of freaky but a killer vacation place.

So you had to pawn the laptop? How much did they give you? Those pawn brokers can be a rough crowd. If you write another book and get in the same situation, I promise, send me a note and I'll send some food money. You have WAYYY to much talent and Wayy too much writing skill to only have one book.

To work through stuff in the book I started working on "C Southern" which is an amusing goof that makes it fun. I was listening to Trick Daddy and Trina the other day when I was working through some examples and I was thinking that making a language that supported Rapper syntax could be a real hoot too. The possibilities are endless but to be honest, I actually think one of the best applications of it would be in writing Add-Ins. We jumped through some hoops to get .NET Refactor working and I'm really thinking of runnign through the excercise again with my new found knowledge.

Funny you mention C. Andy is a big advocate of it and I started playing with it again recently even though I do most of my professional work in .NET - he's write, the control is addicting. But the old school compiler implementations are like the AA meeting that accompanies the addiction. I've been starting to play with it more and more even though I don't have anythign at work directly related to it.

I appreciate your comments and would love to chat more later. BTW, wasn't me in Redmond - it was probably Bill Vaughn - he's the smart Irish guy named Bill and much funnier than I could ever hope to be ;-)

# William said on September 18, 2004 4:31 AM:

Bill, thanks.

Fiji is a beautiful place, but unfortunately I was so busy when I was down there (teaching .Net and working on the book) I didn't get to many vacation places. I did learn everything I could about the culture and politics. The place is a limited success story because the natives and Indo-Fijians try to get along.

I was loaned 300.00 for the Vaio on Howard Street and 500.00 later on at a classier joint on Sutter near Van Ness when I was in San Francisco last year.

I do plan to write more. One book that is in the works is a biography of Dijkstra on the lines of A Beautiful Mind.

Another would be an add-on (sic) to my Apress title. I need to describe how compiler generators work by actual construction of a yaccer and a lexer. I also need to show that for comprehensive and accurate error reporting, you almost always need to generate the parser using automated tools.

However, the recursive descent algorithm I present in the existing book is more than enough for business rules (where the error reports can simply report the error as the failure to parse the rule) and for add-ins, in which the code can usually presumed correct.

Many thanks for your kind words. I shall explore your blogging and follow up.

# William said on September 18, 2004 4:52 AM:

At work the other day, we needed to find all strings in 525 Java modules. The concern was that the developers here in China may have inserted Chinese or unfamiliar messages into the output..

I wrote a .Net program to lexcially analyze all and only strings according to the Java definition of "strings".

One does find that if one does not regard either lexical analysis or parsing with awe, one can become a resource for quick tools which actually work, and save a lot of scut work.

However, they have to be faithful to the definition of the language.

One program I need to write: a syntax-driven windiff program that would isolate differences in code more accurately than the current windiff. The output could be "change the identifier on line 345 to 'f'".

On another assignment, I developed a complete parser for stored procedures which saved us two weeks of work.

Unfortunately, I can't think of any way of creating a magic tool which would make me rich, for my magic bullet is instead the dissemination of practice, in the form of the willingness to parse accurately with code written Johnny on the spot.

It is in other words an art one learns through suffering.

Unfortunately it makes me one of those mad chaps who thinks he can write a better product than an available tool and is consequently bored out of his mind by "tools" except his own.

Also, it is coupled with a left-wing world view in which I think artisans should be left alone to make new things.

Here in China, people made their own Stuff for thousands of years. Along came the British who wanted the stuff the Chinese made but had nothing to offer in return except opium. They opened the area in which I now live by force.

But if nobody will pay you enough for your production,. then you have to do it for free or move somewhere where the cost of living is low, like China.

# TrackBack said on September 19, 2004 8:41 PM:

# TrackBack said on November 9, 2004 11:01 AM:

Search

This Blog

Tags

Community

Archives

News

My other sites

Cool Stuff

Book Stuff

Security

ORM

Data Access

Funny Stuff

Compact Framework Stuff

Web Casts

My KnowledgeBase Articles

My MVP Profile

Design Patterns

Performance

Debugging

Remoting

My Fellow Authors

My Books

LINQ

Misc

Speech

Syndication

Email Notifications