Live data from Hacker News

Show HN: Forsh – A Unix shell embedded in Forth

bitbucket.org

21–23 of 23 posts

Re: Show HN: Forsh – A Unix shell embedded in Forth

#21
post #9
post #4

Didn't the old Sun workstations boot into a Forth interpreter?

Was / is Forth good and useful? Bonus; is it fun?

What are your metrics?

What Forth is best at is boostrapping from bare metal to a reasonably high level language with the simplest design possible. Forth was first written at a time when there was a staggering amount of hardware in existence, so reimplementing the base language as quickly as possible was a huge plus. It's got a low floor but a high ceiling. It is a free-wheeling language that allows both very clever and very stupid things.

Unfortunately, this legacy means lots of fragmentation. There is not one cohesive community or set of standard libraries. Forth is very much a "do it yourself" language.

Forth can be very concise because all parameters are passed implicitly on the data stack by default. Parameters and arguments lead to a lot of duplication of expression in traditional languages because you need to give them explicit names both inside and outside the function.

If you prefer, it helps to treat it as a functional language where all functions take a stack and return a stack. All programs are a space separated list of function names. Of course, nothing stops you from using all the global variables you want.

Re: Show HN: Forsh – A Unix shell embedded in Forth

#23
post #10
post #9

Earlier quoted context omitted.

Was / is Forth good and useful? Bonus; is it fun?

It's fun to learn, and one of the first interpreted environments. What it enables is quick development on platforms with modest resources! Instead of compiling and executing you could develop quickly! Haven't used it for anything more than to do some examples in some tutorial. One thing that's nice about the language is that it's the simplest language you can implement on your own without going insane!

> without going insane

You make that sound like it's a BAD thing...

Post reply on HN