Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!uunet!willett!ForthNet From: ForthNet@willett.UUCP (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: Category 2, Topic 8 Message-ID: <139.UUL1.3#5129@willett.UUCP> Date: 5 Jan 90 01:27:08 GMT Organization: Latest Link in ForthNet Chain Lines: 31 Category 2, Topic 8 Message 31 Sat Dec 23, 1989 NMORGENSTERN [Leonard] at 14:16 EST To: Silver, Rutgers University >I go into cold sweats thinking about playing directly with the >underlying machine's guts, do you Forthers not have terrible >problems switching between architectures? Yes, we get cold sweats, a lot. I also got them the first time I drove a car by myself. Actually, the real danger begins when you start feeling confident. Switching between architectures, never simple, is actually easier in Forth than in many other languages. To illustrate, suppose that you want to use the obscure MS-DOS call "Redirect Device" which is Int 21H Function 5H Subfunction 03H. Simple enough: write a CODE definition, and give it a suitable name, say REDIRECT. If you port the application to Unix, and Unix has an identical or almost identical function, you would write the word REDIRECT differently, of course, but the action and the name would be the same. The problem arises when the Unix version differs significantly from the MS-DOS version. Then you have to make a decision: keep the action as it was, gaining portability, but possibly losing efficiency under the new system, or rewrite it. And if the latter, what should it look like? Not an easy choice of course, but once you have made it, writing the new word in Forth is straightforward. The same principle holds for microprocessor architectures, printers & other peripherals, etc. The problem lies not in Forth, but in the incompatibility of the 2 systems. ----- This message came from GEnie via willett through a semi-automated program. Report problems to: 'uunet!willett!dwp' or 'willett!dwp@gateway.sei.cmu.edu'