Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!news.szaf.org!news.gnuher.de!rz.uni-karlsruhe.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail From: Bernd Paysan Newsgroups: comp.lang.forth Subject: Re: CASE mis-understanding? Date: Tue, 04 Mar 2014 01:31:52 +0100 Organization: 1&1 Internet AG Lines: 51 Message-ID: References: <52e54d17.461102185@news.demon.co.uk> <7xppmks7v9.fsf@ruckus.brouhaha.com> <2014Feb18.181426@mips.complang.tuwien.ac.at> <7xmwhoi4px.fsf@ruckus.brouhaha.com> <2014Feb20.180722@mips.complang.tuwien.ac.at> <7xa9dls56m.fsf@ruckus.brouhaha.com> <53072856.716237921@news.demon.co.uk> <2014Feb22.142818@mips.complang.tuwien.ac.at> <2014Feb24.170538@mips.complang.tuwien.ac.at> NNTP-Posting-Host: p4ffb90cb.dip0.t-ipconnect.de Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: online.de 1393893113 22506 79.251.144.203 (4 Mar 2014 00:31:53 GMT) X-Complaints-To: abuse@einsundeins.com NNTP-Posting-Date: Tue, 4 Mar 2014 00:31:53 +0000 (UTC) User-Agent: KNode/4.11.5 Xref: csiph.com comp.lang.forth:28891 Anton Ertl wrote: > Bernd Paysan writes: >>Yes, please! Well, I actually don't want a language similar to C, > > Maybe PAF (portable assembly Forth) fits the bill? Well, if we do the compiler ourself, I'd rather go the full way, i.e. Gforth as a native compiler. The whole "trusted stuff" you need for secure communication like net2o involves the compiler, as well, and I'd rather trust a compiler with a few thousand lines of Forth code than GCC. >> but if it >>must be similar to C for popularity reasons, that's the way to go. > > C is more than its standardized subset; it may not be standardized, > but that does not mean that it is just "similar to C"; it is C. > > Terminology aside, C has a huge established code base (whereas the > standardized subset of C probably consists of nothing but a few > example programs), and the infrastructural significance of C means > that it is not very practical to avoid it. > > E.g., if we implement PAF or Gforth as a native-code compiler written > in itself, we still need to interface to the OS and the interfaces are > typically defined in C. Actally, you can use SWIG to extract the call requirements, and generate the ABI calls yourself. There's no need for a full-blown C compiler. > We also need some way to bootstrap our code; generating an executable > is platform-specific and changes over time. Several Forth systems > have a small C program that loads the Forth system as an image, and > executes it; that leaves the job of dealing with executable formats > and such to the C compiler, but it fails to get rid of the adversarial > component in the system. I've written this loader in assembler for Atari ST and DOS. The good thing about small loaders is that you can even get the binary right out of a Forth program (I did this on the Atari), because a small loader doesn't need many of the more complicated features, and if you have options, you can use the simplest binary format available (a.out is completely sufficient). It mmaps some memory, opens and reads a file, and performs the relocation if necessary. That's all. You can do that all by direct calls to e.g. the Linux kernel, and bypass all the libc stuff. -- Bernd Paysan "If you want it done right, you have to do it yourself" http://bernd-paysan.de/