Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.forth Subject: Re: C to Forth (was Ting) Date: Thu, 19 May 2016 14:07:24 -0700 Organization: A noiseless patient Spider Lines: 25 Message-ID: <87shxdeoz7.fsf@jester.gateway.pace.com> References: <5736338d.13710740@news.eternal-september.org> <4762cab7-9c37-4137-9e9b-5a3ead1f8868@googlegroups.com> <20160514002835.6333f47c@_> <45KdnYh9FtAEUKvKnZ2dnUU7-cvNnZ2d@supernews.com> <42875847-66b1-49e6-b1fd-1ffcbe26c930@googlegroups.com> <87wpmuonmz.fsf@jester.gateway.pace.com> <2016May16.153714@mips.complang.tuwien.ac.at> <9cee1949-05d9-4f78-82c5-b9d9f512f2fa@googlegroups.com> <30f7a26d-ee8a-4bb1-a9e6-2fb9c5deec03@googlegroups.com> <938662b0-97b1-42dd-951c-df1fdafab845@googlegroups.com> <4ccd7da9-ce35-434d-afd5-f16c1324ede9@googlegroups.com> <0c344658-0e5b-403c-85b3-28a4d40a58aa@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="52eac348160ce62b68e4635eee7cc854"; logging-data="8577"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19sdVcQh2nWPVEdgTElKDus" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:WJq2m/tygsgMB3nKIGcP9F8GEaA= sha1:DOVs6xHfBBhQb/p4z+wbqDGKFY4= Xref: csiph.com comp.lang.forth:47325 Andrew Haley writes: >> Why do we need to rewrite an entire interpreter > The "entire interpreter" is a small piece of code, The dictionary/wordlist mechanism is part of the interpreter, so the code isn't THAT small. It would be great if the cross-compiler could re-use the host Forth's existing dictionary implementation. Maybe that's doable using just the ANS definitions, but it doesn't seem that easy. ANS could have defined a different wordlist interface that wouldn't have complicated implementations significantly yet would have made cross-compilation easier, I think. > There's no-one better than Chuck Moore on this: "Do not leave hooks on > which you can hang extensions. The things you might want to do are > infinite; that means that each has 0 probability of realization. A lot of the ANS spec, and the vocabularies of historical Forths pre-ANS, seems constructed for the specific purpose of providing enough stuff to write a self-hosted interpreter. Cross-compilation doesn't seem like an unpredictable or unlikely an extension. There is a proposed ANS spec for it, after all. Also, while it's reasonable to avoid expending extra effort implementing generality that you don't immediately need, if you can get the generality with no extra effort you might as well take it. In fact a lot of the time it makes the code simpler.