Get the latest tech news
Writing a DSL in Lua (2015)
DSLs, or domain specific languages, are programming languages that are designed to implement a set of features specific to a particular problem or field. An example could be Make , the build tool, which is a specially designed language for combining ...
An example could be Make, the build tool, which is a specially designed language for combining commands and files while managing dependencies. In this trivial example the benefits might not be obvious, but typically your DSL would be implemented in another module, and each place you invoke it is not necessary to bring each function into scope manually, but rather activate the whole sscope with run_with_env. append_all uses Lua’s built in function select to avoid any extra allocations by querying the varargs object instead of creating a new table.
Or read this on Hacker News