3 ms·
I'm taking a class with the first author of this paper known as "Hack Your Own Language", where we read the draft of this paper as our first assignment. While I
by adjkant 9y ago
I'm taking a class with the first author of this paper known as "Hack Your Own Language", where we read the draft of this paper as our first assignment. While I won't do it full justice I'm sure, I'll try to detail some advantages, though not all of them:
1. You can override built-in language features to better suit the domain of your problem.
2. You can control scope and evaluation of variables. While they often have good defaults, there are cases where you want to override them.
3. You could easily add partial or full typing as you desire to a language. Not runtime typing, but compile time with proper error messaging, and it will be a heck of a lot easier than hand rolling it trying to do it with functions.
4. You can change the very shape of the syntax. Imagine specifying a graph with only identifiers and ascii arrows and just listing them out, then performing DFS. No more Node/Edge class structures, you just work at the abstract level. That applies to any domain. If you're working with functions, you can't change the syntax of the language, which leads to very awkward code in some cases.
The graph language:
http://www.ccs.neu.edu/home/matthias/4620-s18/network-syn-lang.rkt http://www.ccs.neu.edu/home/matthias/4620-s18/network-syn-la...
The graph language sample program:
http://www.ccs.neu.edu/home/matthias/4620-s18/network-syn-lang-client.rkt http://www.ccs.neu.edu/home/matthias/4620-s18/network-syn-la...
The language is simple, but as is the point, can be extended by anyone. That's powerful.