Question:
I've written a paper recently about a typed functional stack-based
language, which is closely related to Forth, at http://www.cat-
language.com/paper.html
I'm writing here to request comments from the Forth community since
the paper makes a lot of references to the Forth language, and
research done into type systems and lambda expressions for Forth.
Any suggestions or criticisms would be most welcome,
Answer:
Since you ask so kindly:
Your paper consciously avoids "side effects" and explains some theoretical
background or design motivation. But I am an engineer and fail to see what
practical advantages CAT has over Lisp or Haskell, apart from using stacks.
As you probably know, Cat differs from Lisp in that it it has a static
type syste which distinguishes pure from impure code. This makes it
much easier to write a compiler for Cat that can generate more
efficient code (no need for runtime tests, and more sophisticated
optimizations can be performed). A type system also can signficantly
improve development time by reducing the number of run-time errors,
and the required number of tests.
Cat differs from Haskell in that the language semantics and syntax are
much simpler. It is much easier to write an interpreter or compiler
for Cat than Haskell. This makes it potentially much more portable. It
is also easier to write automated code analysis tools which I think is
hugely beneficial for real-world software development.
Does this seem like a convincing argument?
From an engineer and the author of Fractor I had expected a more
substantial response.
So let me nail it down more deeply:
AFAIU Cat features static type-checking, functional programming
capability, and offers stacks for parameter passing like Forth.
I know the benefits of static type checking and appreciate Stefan
Bechers work.
Cat may be unique in providing the expressiveness of functional
programming with the efficiency of Forth. I am just wondering for which
class of problems that might be particularly useful: perhaps pattern
recognition, compiler construction, signal processing ... ??
You may know the answer, I do not, that's why I am asking.