Re: Big thudly Forth...

From: Elizabeth D. Rather <erather_at_forth.com>
Date: Fri, 01 Nov 2002 10:01:10 -0800

At 10:55 AM 11/1/02 -0500, you wrote:
>...I always seem to run into a wall, sometimes like this:
>
>"I have fibs and squibs, they both curdle. However the curdle for the one
>is very different from the curdle for the other. Therefore, should I have
>fib-curdle and then squib-curdle? Oh, and right now, squibs also brindle,
>findle and glutch. However, fibs weren't doing those, so I didn't give
>them a prefix. I guess they need to be squib-brindle, squib-findle and so
>on. Yuck! This is awful! Brodie says hypenated names are the sign of a
>problem... Yeah, there's a problem here alright. I'll do it in C and use
>static functions."

Perhaps if you could leave out the cute names and tell us exactly
what feature you're looking for we could help. Sorry, I don't know
C, what's a static function?

>Perhaps it's just my aesthetic sense getting in the way. Perhaps my
>thinking is too flawed by using other languages and I still don't "get"
>it. Or, as you suggest, I'm not asking the right questions. Whatever it
>is, the best way I can describe it is a lack of a roadmap... Too little
>intelligence on what has been done before in such situations. With, say,
>Python, I have a well defined path to follow... Globals, then classes,
>then modules, which takes me as far as I need. With Forth, my stuff starts
>out pretty clean, but usually winds up a tortured mess at endgame.

To the extent that SWOOP is applicable to whatever you're doing,
some of those techniques are applicable. But the possibility for
clean organization and factoring are certainly there in Forth, much
more so (in my experience) than in less modular languages.

>Going through the examples of SwiftForth has been very helpful, but again
>they suffer from being too small (although Tetris has been very helpful on
>a number of levels (Ooh... Bad)). But what does a SwiftForth application
>for doing 3D animation look like? How do you deal with multiple modules
>and views and different controls and so on? I have some idea of what a big
>C app might look like because there are many examples available that I can
>study. This doesn't seem to be the case for Forth. There are a lot of
>different Forths, but not many examples of using them for something
>interesting.

It is unfortunate that most large Forth applications have been commercial
and proprietary in nature, not publishable. However, there have been
several applications published by folks here, as well as comp.lang.forth.
Consider also the organization of SwiftForth itself, which is in a way an
example of a very complex Forth program.

>I hope this explains my question. I'm a big fan of Forth, and I'm going to
>keep pounding at that wall. But if any of you have a sledgehammer lying
>around that you'd be willing to lend, I'd sure be glad of it!

I don't thing there's a generic "how to do big apps", only an appreciation
of the tools available, particularly the unique ones: DEFERs, defining
words, SWOOP, etc., and trusting your own sense of clean, logical
organization. Rather than imposing an external framework on large
applications, Forth lets you model the intrinsic shape of the application
itself.

The basic principles of top-down design and bottom-up implementation
and testing apply as much in Forth as elsewhere. I have experimented
with some of the formal design tools, and they can be helpful, but I
found that writing very high-level pseudo-code in Forth works just as
well.

Cheers,
Elizabeth

==================================================
Elizabeth D. Rather (US & Canada) 800-55-FORTH
FORTH Inc. +1 310-491-3356
5155 W. Rosecrans Ave. #1018 Fax: +1 310-978-9454
Hawthorne, CA 90250
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe sftalk" to listar_at_forth.com
For help with listar commands, send subject "help" to listar_at_forth.com
Archives are located at http://www.forth.com/sftalk -- check them out!
Search the archives! Visit http://www.forth.com/search for details.
Received on Fri Nov 01 2002 - 10:01:08 PST


Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!

This archive was generated 09-Feb-2012. Archive updated nightly.