Hacker News new | ask | show | jobs
by kolev 4071 days ago
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.
1 comments

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.