Beautiful Racket

programming, language-design, racket, lisp, scheme, DSL, book, textbook

The idea of a pro­gram­ming lan­guage that can be molded by its users—I like the phrase lan­guage exten­si­bil­ity—is almost as old as our old­est pro­gram­ming lan­guages, given the his­tory of macros in Lisp. So why isn’t every­one already using macros to extend lan­guages? Like garbage col­lec­tion, macros may seem like a cool idea in prin­ci­ple, but with too much over­head to be prac­ti­cal (but with the over­head in pro­gram under­stand­ing, instead of pro­gram exe­cu­tion). Like first-class func­tions, macros add an extra dimen­sion to code that may seem too mind-twist­ing for an aver­age pro­gram­mer. And like a type sys­tem, the the­ory behind hygienic macros may seem too daunt­ing to be worth the extra guar­an­tees that hygiene pro­vides. Maybe so. But Beau­ti­ful Racket makes the case that the time for lan­guage exten­si­bil­ity has come. That’s why this book is impor­tant. It’s not an abstract argu­ment about the ben­e­fits of macros or a par­tic­u­lar style of macros. Instead, this book shows you, step by step, how to use Racket’s macro sys­tem on real prob­lems and, as a result, get a feel for its ben­e­fits.

via http://beautifulracket.com/foreword.html