Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!willett!dwp From: dwp@willett.UUCP (Doug Philips) Newsgroups: comp.lang.forth Subject: Re: PUZZLES AND PROBLEMS Message-ID: <1446.UUL1.3#5129@willett.UUCP> Date: 2 Aug 90 02:10:55 GMT References: <1429.UUL1.3#5129@willett.UUCP> Organization: String, Scotch tape, and Paperclips. (in Pgh, PA) Lines: 67 In <1429.UUL1.3#5129@willett.UUCP>, W.BADEN1 [Wil] writes: > The purpose of subroutines is to package "What to" whatever the language. The > level of a language is a measure of how much has already been piled up for > you, or conversely how much you have to pile up to do what you want to do. In > this ordering Forth clearly stands between Asm and C. Hmmm. I don't quite follow this here. I would be more inclined to put C and Forth at about the same level. If you look at the language itself and not the libraries. I say that because while PD or ShareWare versions of Forth are pretty bare bones, so are most PD or ShareWare C's. As a side note, it tickles me to see the ratio of PD/ShareWare Forths to C's versus the ratio for commercial products. Anyway, from the ads I've seen, the libraries available for Forth are comparable to those available for C. The real issue is, I think, the language itself. Both C and Forth provide basic "machine" types. C provides structures/unions which most PD Forth's don't; I don't know if commercial systems do or not. C and Forth provide the same style of looping and branching constructs, with, perhaps, the exception of C's "switch", but again, I don't know about commercial Forth's. C provides global, module and block scoping. Forth has vocabularies. Commercial Forth's may have locals (like block scoping). C is traditionally compiled, but interpreters are becoming available. Forth is traditionally interpreted, but subroutine threading is often available. C defers I/O to the runtime library. Forth has it built in. C defers memory management to the runtime library. Forth has some memory management built in. C often lets you escape to machine code with "asm()" statements. Forth has ;CODE. C has separate compilation. Forth has vocabularies, but that isn't really the same thing. Forth's ability to drop into assembly code allows one to interface with other languages. I don't know how common this is with commercial systems. I think I hit all the main points (until I irrevocably send off this message anyway!). The point I'm trying to make is that although one might technically rate C higher on the basis of the above comparison, I would argue that Forth is not clearly between C and ASM. I would say that it is more more clearly close to C. > All sufficiently powerful languages have this ability. This is the way > applications are programmed in every language. What Forth shares with Lisp > and APL is the ability to grow into your application. (Tell me, does > SmallTalk have this too?) I've not written much SmallTalk, but the literature seems to support that view. Rapid prototyping, interpreted self-modifying system. etc. > As an application is built, every component should be checked. With > conventional development this means that scaffolding must be rigged for each > component. This scaffolding, which may become much larger than the final > appplication, is thrown away. Forth's mode of development reduces and often > eliminates scaffolding. Forth is losing this advantage. There are products available for interpreting C code. Often they are billed with the same advantages that the Forth environment has, plus the advantage of "compiling" the production version of the code to "recover" the traditional speed advantage. Lisp, Forth, Smalltalk, APL and probably others I don't even know about, all provide a nice interactive environment for prototyping and development. Forth is the only one (maybe APL too) that can do so in very spartan quarters. That environmental economy is a *second* order effect of the Forth philosophy, not a *first* order one. As resources become cheaper Forth will have to rely more on its *first* order attributes in order to retain/attain superiority or popularity. -Doug --- Preferred: willett!dwp@hobbes.cert.sei.cmu.edu OR ...!sei!willett!dwp Daily: ...!{uunet,nfsun}!willett!dwp [in a pinch: dwp@vega.fac.cs.cmu.edu]