Skip to main content

Book Review : How To Create Pragmatic, Lightweight Languages


At last, a guide that makes creating a language with its associated baggage of lexers, parsers and compilers, accessible to mere mortals, rather to a group of a few hardcore eclectics as it stood until now.

The first thing that catches the eye, is the subtitle:

The unix philosophy applied to language design, for GPLs and DSLs"

What is meant by "unix philosophy" ?. It's taking simple, high quality components and combining them together in smart ways to obtain a complex result; the exact approach the book adopts.
I'm getting ahead here, but a first sample of this philosophy becomes apparent at the beginnings of Chapter 5 where the Parser treats and calls the Lexer like  unix's pipes as in lexer|parser. Until the end of the book, this pipeline is going to become larger, like a chain, due to the amount of components that end up interacting together.

The book opens by putting things into perspective in Chapter 1: Motivation: why do you want to build language tools?
There are two different scenarios in which you may want to do that:
1. you want to create a new language: maybe a general purpose language (GPL), maybe a domain specific language (DSL). In any case you may want to build some support for this language of yours. Maybe you want to generate C and compile the generated code, maybe you want to interpret it. Maybe you want to build a compiler or a simulator for your language. Or you want to do all of this stuff and more.

2. you want to create an additional tool for an existing language. Do you want to perform static analysis on your Java code? Or build a translator from Python to JavaScript? Maybe a web editor for some less known language?

Nowadays, we are surrounded by those: languages targeting a common runtime like .NET or JVM; language A to language B transpilers, the likes of Perlito in translating Perl5/6 to JavaScript; or dedicated DSL's within larger frameworks such as the Perl Dancer Web Framework's one which makes implementing a web application trivial.

full review on i-programmer.info

Comments

Popular posts from this blog

EU Blockchain Observatory and Forum Blockchain AMA

The EU Blockchain Observatory is a recent initiative, launched in February 2018, which is backed by the European Commission with the primary aim of educating the EU's public on Blockchain technology.This very interesting AMA really served that purpose by answering  the public's challenging questions, which were mainly tweeted under the #AMABlockchain hashtag. Educating the public aside, the forum's two other objectives are to accelerate the application of this technology at a pan-European level and to push for cooperation between member states to materialize uses cases and scenarios backed by Blockchain. The AMA started smoothly tackling lightweight questions, such as "what is the Blockchain technology?" or "where is a Bitcoin stored?", (answer: "on every computer in the Blockchain network"), continuing with what a blockchain Node is and what does a Miner do. Other questions revolved around which Consensus algorithms does a blockchain network…

Learn To Program the Blockchain With Devslopes For Free

It is strongly believed that AI together with the Blockchain is the upcoming revolution in technology. Professionals in these areas are expected to be highly sought after. Recognizing this need, Devslopes aims to transform any beginner to a professional and currently has a very attractive offer that amounts to free training. We've recently looked into the Blockchain technology and its future in watching and reviewing the EU Blockchain Observatory and Forum's Blockchain AMA which revolved around the Blockchain's  applications on a pan-European level. Since the EU Commission is so fond of this novel technology, you certainly get the feeling that you have to do something about it to prepare for a Blockchain-powered future. Devslopes is one of the most recently founded .... full article on i-programmer.info