A taste of development

May 29, 2008

Language parsing and compiler design doesn’t have to be hard, but boy this book truly sucks!

Filed under: Technology —Tagged , , , — simma1990 @ 1:55 pm

How’d you like that for an opening up title? Did it seize your attention? Hell, your studying this far so I hazard it did. The book I’m riveting on hither is Work up Your Own.NET Language and Compiler  and delight, don’t click the link and so run purchase it. I don”t care about the 50 cents worth of referral money I’ll get if you do. I wouldn’t yet advocate the book if I paid off 50 bucks of referral money (good, money talks, so mayhap I would).

The book startles out with the basics of parsing and even expressions and all that jazz. But the extent of the code is a bunch of screen shots. We are droping a line a parser/compiler dang it, we aren’t WYSIWYGing our way through life at this point, you have to render some existent frigin code. What you terminate up with is a bunch of screen shots of many tools for droping a line a compiler, but not truly the code, unless of course you proceed snap up the CD and come out all of the code without a lick of explanation from the book. God I go for the code is good documented with comments, or you simply bribed an issue of Compiler’s Instanced and this isn’t the Swimsuit edition. I’ll let in some of my ain links at the bottom, where I present factual code for many of these processes.

OK, so you pay off to meet a bunch of tools, and what do you pay back? Well, you produce a bunch of half-assed tools (good-for-naught for the language if your kid is learning my highly technical blog… In fact, if he/she is I could utilize some interns, must typewrite 50+ WPM and be technical at C, C++, or C#). A numerical expression evaluator is the first. I conceive it is ever the first. People e’er trivialize math. Thence make sure enough you view all the pretty pictures and render to harvest some wisdom from the text. I have a numerical expression evaluator by the way, it’s sent for calc.exe and from what I can assure it has shipped since 16-bit windows. He as well makes believe an attempt at a even expression workbench. You can’t have enough of those (really I’m not being sarcastic hither, I constantly apprize a newfangled regex tool), but and so he ne’er spells anything or manifests compiler technology that utilises veritable expressions. Does he come in NFA/DFA technology? Well, he does discuss it for a few sentences. BNF format? Over again a few sentences hither and in that location. But await, another tool is what you get under one’s skin and this time it is a picture of a drop-downward menu with all sorts of truly teasing names (convert from BNF to XML, exhibit a BNF parse tree, display arranged docs, etc…). At this point use one of the pages to get the drool doing off your lip, because that is as near as you’ll make it this book to anything nerveless.

OK, thus block the tools. At some point he really begins talking about existent compiler technology. I think around chapter 7 peradventure? I rattling should dig out up the TOC on Amazon, but I’m just moving to squander enough time on this book to eat up this posting. Anyhow, they start up discoursing the assorted parsing techniques. Recursive descent (RD), Top-Down, Bottom-Up… I imagine there are some other peculiar names they throw in in that location to pose the reader. After taking all of the major compiler design books I shouldn”t be mystified by something that could classify as a 4 Dummies book (unless it is something like Cross Dressing 4 Dummies, I could probably use that after my Halloween party)…  Anyway, they really donn’t do the entire process justice, and I think at some point some more tools are used, Yacc might be mentioned, and bam, back to the pictures.

At this point I want to identify the worst problem I found throughout the entire book. Plainly the author didn’t have time to eat up the code so they led a bunch of exercises for the reader. Nah, nah… You don”t leave the compiler as an exercise in a book on how to write a compiler. You leave behind bits and pieces, but not the of import stuff. Experiencing my Knuth books, I’m really stormed when he gos away problems as exercises that ask more know-how than what has been provided in the chapter. I don”t mind exercises for the reader, but there is a limit people. Ideate catching backward from Home Depot with a 300 page picture book on constructing a house, that had a bunch of pictures of finished homes, and some text offering up that the building of the house will be resulted as an exercise for the reader. Doh!

At the end of the book, it is ostensible I’m not starting to pay off anything of use and so it starts up talking about code generation. Oooh, something with some meat. In reality, they’ve been mentioning their nodes for the calculator in such a way that the name of the node was pretty often the name of the op code that was rifling to be named. They may have some Fast Introductory implementation code spits as comfortably, but I’m confused at this point (and graveled) because I’ve been fingering this book for an hour. In reality the act of spewing IL is in all likelihood deserving an intact book of it’s ain (oh waitress it is Deep down Microsoft.NET IL Assembler and you truly should buy this one so I catch 50 cents). That isn’t just because that book is really how IL functions and not how to spew it. But I’d remember one does predate the other since finally your runing to go out of node names to match to IL op-codes and when opComplexOperation isn’t mirrored by OpCodes.ComplexOperation I simply don”t know what you’ll do.

How fair of a review is this? Well, I’ve interpret factual compiler books, quite a few of them. I’ve carryed out my ain parsers and compilers many times for many unlike circumstances. I don”t think it is a hard process and I think extending the process to a more general development audience is important. There should be a relatively approachable book on droping a line your ain.NET languages, but this book is for sure not it. I’ll hold searching about, I take heed there is another book focalized on.NET language generation and I’ll have to look it out. Perhaps an O’Reilly publication? Can you catch an accurate review from something in about an hour’s time? Well, I register tight, the words were quite big, most of the content was entirely conversant and entirely about 30% of the page material was text, so I’d go for indeed. Get hold of this for what it is deserving, but if I learn any referral money for that book, I’ll cognise someone is runing low to be expressing joy hysterically when they catch that book in a 2-3 days from Amazon. PS: I didn’t and won”t buy the book. I passed a couple of hours at Borders today working through two books that got my eye when I was very seeking a with child.NET Localization book. I take to dig up up Michael Kaplan, since I’m certain he has saved something someplace.

Lexer/Parser/Compiler   Code and articles for unlike types of parsers
Lexer, Parser, Compiler, Oh My!   Postings, with code, on even more lexer/parser stuff
ftp://ftp.cs.vu.nl/pub/dick/PTAPG/BookBody.pdf  A more tough-core text on parser technologies

Relating Posts:
CVS on the Web

Comments are closed.

©2012 A taste of development
Provided by WPMU DEV -The WordPress Experts
Hosted by Edublogs.org