uLisp vs. FORTH: how do they compare?


#1

I’ve programmed in LISP before (well, a long time ago), and I remember feeling highly productive while using it. However, I was using it on a high end machine.

I haven’t tried FORTH. Is uLisp comparable to FORTH for microcontroller programming, or is one language decidedly better than the other for that purpose?


#2

FORTH I found super annoying.

Imagine it a bit like a “one-dimensional list language” if you will.

The stack-based notation is what is most hyped about it as “unusual”, though in reality, you will get used to that really quickly, just like to LISP’s parentheses. “Looks weird”, but is not really that much of a deal.

What * is * a big deal for me is the sheer amount of babysitting this language needs. “You can define anything” translates directly to “barely anything is ever compatible, you must do everything yourself, the amount of detail is mind-blowing”. The famous stack really means you must yourself pay attention to what is on it at all times; in LISP, you call a function, it does something, then it collects its garbage and gives you somethibg else. FORTH really feels like having one C-array in which anything you want is done with two pointers.l, and sometimes the array gets changed in some parts, and sometines it doesn’t.

That is the very reason why FORTH systems tend to be small: they are outsourcong all sorts of micro-management to the user, to YOU. And no, it is NOT all that fun to handle it.


#3

One of the things I’m liking about uLisp is the ease of doing c-extensions to it. Since most embedded microcontroller libraries for sensors and such seem to be written in c, that means being able to leverage those libraries without having to rewrite them. So, a big kudos for that. :)

I’m not sure if Forth can do that. However, what peaked my interest in Forth was this guy (https://www.youtube.com/watch?v=dvTI3KmcZ7I) who gave a tantalizing overview of how he uses Mecrisp Forth on an ARM Cortex M microcontroller (a “blue pill” in his example). For instance, I was impressed that it can do its own on-the-fly inline optimizing compilation of Forth, all on the target microcontroller itself. The result appears to be compact and reasonably efficient code. Can uLisp also be made to do that too?