Re:A simple Forth-like language intended for DSL creation, i...
by kolev on Friday May 01, 2015 @06:24PM
(#9474896)
Although I love old-school languages like Forth, Smalltalk, and LISP, I find it weird to use Forth for a DSL. I looked into the example and it's not very readable, to be honest.
[ Parent
| on HN ]
Re:A simple Forth-like language intended for DSL creation, i...
by IonoclastBrig on Friday May 01, 2015 @07:32PM
(#9475180)
Forth's entire raison d'être is to provide a simple basis for building DSLs, in some sense. The reason it works so well is that not only can you attach any compile-time and/or runtime semantics you want to any arbitrary input token, but you can override, extend, and manipulate the parser, compiler, and interpreter like any other provided service.
The syntax is terse and a bit difficult to parse if you're not familiar with forth, since I follow many of their naming conventions. This is mostly at the lowest levels of code, though; it is expected that you'll end up building your own convenience functions and syntax extensions along the way.