3 ms·
A simple Forth-like language intended for DSL creation, implemented in Lua
- IonoclastBrig 11y agoI wrote a pretty detailed blog article about the motivations and some design aspects of the project. If you want to play with a new little toy, I'd love any (constructive!) feedback, bug reports, pull requests, etc. http://blog.ionoclast.com/2015/05/firth-pre-alpha-1-a-forth-like-language-for-dsl-creation/ http://blog.ionoclast.com/2015/05/firth-pre-alpha-1-a-forth-...
- corysama 11y agoHave you seen http://terralang.org http://terralang.org ? With a little work, your DSL could be generating stand-alone, statically compiled executables and c-linkable libs :D
- IonoclastBrig 11y agoOh, I hadn't heard of that. Sounds interesting... I've also considered at some point switching to an LLVM backend, which would let me JIT on the fly or build executables.
- corysama 11y agoYou just exactly described Terra :) You run Lua to construct sequences of code in the language Terra. The Terra functions can be jitted or AOT compiled through LLVM.
- kolev 11y agoAlthough 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.
- IonoclastBrig 11y agoForth'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.
- henryscala 11y agoStack based language is simple and cool. Although I did not use Forth, I once used qinmishu(http://qinmishu.org http://qinmishu.org).
- IonoclastBrig 11y agoTranslated from qinmishu.org: "Different Chinese and English, Chinese and English programming programming should be somewhat different fishes." Apparently google isn't very good at Chinese...