Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!UTRCGW.UTC.COM!RAYBRO%HOLON From: RAYBRO%HOLON@UTRCGW.UTC.COM ("William R Brohinsky", ay) Newsgroups: comp.lang.forth Subject: Eric's funny for the day Message-ID: <9102141832.AA19990@ucbvax.Berkeley.EDU> Date: 14 Feb 91 13:47:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: "William R(ay) Brohinsky" Organization: The Internet Lines: 79 Eric Johansson write>>>>>> Subj: RE: ANS TC Magnet for Cont. Ref. Set And speaking of interesting opinions, here is another.... read with a bit of salt :-) There is one way I could agree to shrinking the ANSI wordset thereby eliminating all of these controversies over the string or file or ... wordsets. Define a standard way of calling C functions from forth. Then anyone could use all the functions in libc.a or any other C library and not need to reinvent the wheel (or words) in forth. Think about it, interface to C in an standard sequence and all the issues of strings, files, floating point, networking, GUI are mostly solved. Use the C names, with the C specified arguments in a forth context. real easy. But I figure this will never fly because the forth hackers of the world have their egos too wrapped up in reinventing the wheel in the forth way to get any real work done and make money using forth. >>>>>>>>> Ha, ha, ha! This is exactly what J-forth and (in a slightly clunkier fashion, IMHO) Multi-forth do on the Amiga. There's only a few objections I'd have to `standardizing' that: Can you get TurboC to use libraries compiled for use with MicroSoftC on the PC? Can you get C libraries at reasonable cost for the 68hc11? (I know right off of two compilers that run in the $1000 range!) Also, if you actually roll-your-own C library interface, you have to know how the compiler it is intended for keeps its stuff on the stack, which I believe is implementation dependant, and not specified in the ANSI standard. That you must have a stack, that's standard. How you keep things there (in what order) is up to you and your machine. In addition, this can be easily done on one platform, like the Amiga, because the whole hardware-software interface is determined by EXEC. There are other systems that don't have such a strict (nor so benevolent a) dictator. The Amiga also has the ability to share libraries, while talk of this is just now happening for some other OSs. Using another language's libraries is OK if they're there... Also, once you have a whole set of libraries, you have to have a way to add to them or modify routines: this is what forth is all about. If I don't like emit, or want it to emit somewhere's else... I can change it. With C libraries, you need the source (no real decompiler possible), you need a librarian, and you need to be able to compile into the library...Why not use C in the first place? Or you suggesting that we take all of the C library routines, and write them in forth, verbatim (as it were)? Then, I guess the next thing to do is to change WORD and EXPECT, etc. to work with Zero-terminated strings, and trash enumerated strings... After all, enumerated strings are fine if you want speed, but we're talking C libraries here... What you'll end up with, IMHO (alright, IMRO, R for righteous?), is C. And you'll still have a big hole where FORTH used to be, and a lot of people using un-standardized forths to fill the hole because there won't be a real FORTH any where near the standard... [NOTE: this is not a flame. [TINF?] The idea is OK for practice where the operating system (and its implementation) make a c-like interface and library access desirable, but I don't think it belongs as a foundation of the standard. These sorts of things become non-portable real quickly... >--- eric > >-- >... >^^^ eric johansson UUCP ...!uunet!wang!harvee!esj esj@harvee.uucp >* * a juggling fool AT&T (617) 577-4068 (w) > o HAM ka1eec >\_/ CSNET johansson%hydra@polaroid.com > or hydra!johansson@polaroid.com > source of the public's fear of the unknown since 1956 raybro