The Beautiful Simplicity of ColorForth (2013)
blogs.msdn.com
blogs.msdn.com
http://blogs.msdn.com/b/ashleyf/archive/2013/09/21/chuck-moo...
http://www.infoq.com/presentations/power-144-chip
Very interesting IMHO!
[edit: I'm delighted to see a little more of this chip, after being rather exited about it when it was first announced/launched (just not quite 450USD exited). There are some fascinating notes on Moore's (now dead?) eval blog[1], such as the notes on driving a VGA display:
http://www.colorforth.com/video.htm
[1] http://www.colorforth.com/haypress.htm
]
(I have strong, negative opinions about FORTH, having seen at close-hand a few disasters that resulted from using the language, but I have to credit FORTH for being achingly spare and rather pretty).
More than one person has called forth a programmer "amplifier". If C++ has the capacity to blow off your whole leg, forth is more than capable of forming a black hole beneath you and sucking you in.
The episode that most sticks in my mind was when a cow-orker of mine at Atari tried to write a game in FORTH. He blew all his ROM space with runtime and framework and static bitmaps; game play was going to come later, as soon as he got his great FORTH-based game engine running. Ten months into a six month project, 20K into a 16K ROM and with frame times on the order of 5 FPS (utterly unplayable) he basically stopped giving his manager any status, and was fired. All this time, good performance, great game play and small code space were "just around the corner, like next week, maybe" because the magic of FORTH was going to save the day.
That was a near total failure of management, good engineering practice, scheduling and hiring, all at once.
At nearly the same time, a friend of mine was writing some great process-control stuff for another company, in FORTH. We had many conversations about the Atari programmer in question. My friend was pragmatic, conscious of his own faults, and probably the best FORTH programmer I've ever known.
"Not everyone can handle this stuff," he said.
A few years later I asked him if any of his FORTH code had survived when he left that company, and he smiled a little and asked me what I thought.
"They threw it all away, right?"
"Right."
I don't know how much that cost the company in question. Probably a lot.
In another case, there was a hardware bring-up engineer who wrote a bunch of tests and exercisers in FORTH. This was an initial win because he taught the hardware people FORTH, too, and they wrote a lot of their tests in it, and they were pretty productive. This was unarguably good stuff. But when it came to write native code drivers for the platform's OS we found all kinds of cycle-level timing issues that had been masked by FORTH's inner interpreter overhead, and I spent weeks chasing some of these, inserting magic NOP instructions to work around glitches.
So am I utterly negative about FORTH? No, it's a tool. I get really skeptical that you can ship a real product in it, though, and I think that FORTH's successes are in very specialized niches and not very visible.
Color FORTH made me laugh, though.
The Atari coin-op group had an internal version of FORTH that was actually pretty whizzy; one or two guys spent a fair amount of time on it. But no games actually shipped that used it.
(Those who remember MUCKs like TinyMUCK might have actually used a FORTH variant: MUF. I actually wrote a couple of MUF programs, although by that point the language supported lists and dictionaries so it wasn't quite so headbangingly tough for those of us who do not have stack-based brains.)
In a time where basic was alpha and omega in consumer micros, a british company decided to ship their cheap micro with a forth implementation. Needless to say it wasn't very successful, but I wish I had one.
I read some interview with the guys that designed the machine, and their stubbornness in not going for color video and pushing for forth kind of mirrors some of the sentiments about forth programmers shared here. They were definitely primarily engineers with little regard for the benefits of being conventional, which I can appreciate.
It is a beautiful language, if you can handle it.
You have two very very global variables to arrange your control flow.
Nothing is pure and everything can affect anything. It is very hard to reason and to draw borders.
FORTH excels at control jobs and other embedded tasks.
As a side note, I've done image processing with forth: I helped build a commercial HD video camera with it that shipped in the mid 2000s, and I found it well suited once we had the problem reasoned out well enough to build our DSL. Overall the product ended up being composed of forth/C/hand written assembly, and a bunch FPGAs. We shipped things with < 10 people, and I think the interactive/extensible mindset that forth gave us helped us get the product out the door successfully.
I'm really curious how you did that image processing stuff but I suspect it is not in any public repository :)
So I have an idea of what is going on.
In C you cannot have a variable number of ints pushed as arguments to procedure call due to change in one func signature.
(I also know about C calling convention, you can have old code linked, right)
Most languages provide more protection.
There was a time every Sun and Apple computer came with a FORTH interpreter in ROM
And there's a reason they don't any more. It was a pretty interesting way of enumerating device capabilities, and a terrible way of abstracting device driver details, which was why it was there. Having tried to beat Sun OpenFirmware Forth into making SBus device drivers "easier", I guess I fall into the "too dumb" category, because it was a disaster.
It is a beautiful language, if you can handle it.
Says every language zealot, ever.
The problem wasn't all that hard actually so I wrote a bit of C code that did the job in about 2 working days...
Now, there is nothing wrong with FORTH per-se, it's a great little language and it has some elements that I think are super elegant, in the same way that I think LISP is super elegant (though I'd have a much easier time programming some problem in FORTH than in LISP simply because I have a lot more FORTH experience).
When I looked at the code I decided that FORTH was the wrong tool for that particular job, doing it in C (to great scorn of the original German dude who called C sneeringly a 'great' language because of the larger runtime) made the job very much easier.
The same 'it will work tomorrow' attitude was what kept the project going for all the time that went into it (multiple years), I think in part this was because the guy was so nice and a close buddy of one of the people that ran that place. But when push came to shove the un-elegant sledgehammer of C rammed that particular nail in in record time.
Image processing in FORTH is not the best fit, though I can see some ways in which you could make it fit. Maybe if I tried my hand at it by tomorrow I could have a working prototype ;)
... I also remember reading that C. Moore added the syntactically significant coloring to help with his own visual impairment.