
A simple Forth-like language intended for DSL creation, implemented in Lua - IonoclastBrig
https://github.com/IonoclastBrigham/firth
======
IonoclastBrig
I 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-...](http://blog.ionoclast.com/2015/05/firth-pre-
alpha-1-a-forth-like-language-for-dsl-creation/)

~~~
corysama
Have 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
Oh, 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
You 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
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.

~~~
IonoclastBrig
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.

------
henryscala
Stack based language is simple and cool. Although I did not use Forth, I once
used qinmishu([http://qinmishu.org](http://qinmishu.org)).

~~~
IonoclastBrig
Translated 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...

