My experience is that everybody says cross-compilation in Forth is "easy" or "well-established," etc.. As soon as the person begins to describe it however, it becomes obvious that the person doesn't know how it works.
In private correspondence, Jeff Fox said this:
---------------------------------------------------------------------------
You are right that a target compiler can be simpler than when one has
to include an interpreter and a compiler inside an application. There
are times when one does want an interpreter and/or a compiler in an
application but not always.
It is also true that the proposed ANS target compiler standard is
way overly complicated. Have you seen it? It doesn't sound like
that is your style.
I am about to post two new pages, One is Factoring and one is
Smarter than a First Grader? I expect that many people
will think that I am overstating my opinions. Like many of
the essays and tutorials I have posted they are both
related to people asking the same dumb questions and saying
the same dumb things in c.l.f but never learning the answers
or why some things are dumb.
---------------------------------------------------------------------------
He may have been referring to the same document that you are referring to (I have not read it; I have never actually read anything about Forth cross-compilation whether ANS-Forth or otherwise). As to those pages that he intended to post, I don't think he ever did. This email was dated 4/27/2011 and he died 5/4/2011.
On the subject of people making statements about Forth cross-compilation that indicate that they don't know what they are talking about, this thread contains some doozies:
https://groups.google.com/forum/#!searchin/comp.lang.forth/lc53/comp.lang.forth/wP5nw1ClzsM/E-TV9v2y9RoJ
I recommend that everybody read this thread --- there is a lot of good stuff in there!
On Friday, December 4, 2009 at 1:19:24 PM UTC-7, Anton Ertl wrote:
> Jerry Avins <
j...@ieee.org> writes:
> >What's this about? Are host/Ttarget systems covered by ANS Forth?
>
> No. Cross compilers are not supported by Forth-94, nor in the current
> draft of Forth200x. There is a cross-compiler proposal, and there are
> people working on getting it ready for Forth 200x (or 201x).
>
> - anton
According to Tessa Bonting, writing a cross-compiler in ANS-Forth is something that a C-student can accomplish, but yet nobody knew how to do it in 2009 --- apparently the Forth-200x committee were all D students!
On Tuesday, December 8, 2009 at 3:18:13 PM UTC-7, Stephen Pelc wrote:
> On Tue, 8 Dec 2009 14:32:02 -0500, Jonah Thomas <
jeth...@gmail.com>
> wrote:
>
> >Suppose you extended the cross-compiler so that the TARGET could be the
> >HOST . Then you'd have a clear distinction between COMPILER words and
> >regular words, but the distinction between HOST and TARGET would have
> >disappeared.
>
> There are three types of compilation involved
> 1) Host compilation
> 2) Clone compilation (target CPU same as host and memory matches)
> 3) Cross compilation (target CPU is not host CPU)
>
> In the third case you have to simulate *everything* when dealing
> with both the definition and execution of defining words. It's not
> easy. You also have to extend the normal Forth compiler by at least
> two time frames. Forth cross compilers are much more complicated
> and much more subtle than they appear to be.
>
> That's one reason why the cross compiler proposal is the way it is.
> The big downside of the proposal is that the original was written in
> a hurry to satisfy EuroPay. It also reflects the state of Forth cross
> compiler design of about 15 years ago. I have prototyped a design
> for which the current proposal is inappropriate.
>
> Stephen
This is totally not true! There is no need to simulate the target processor on the host machine at compile-time. I think Stephen is referring to a technique that was used way back in the early 1980s. At that time people had a 6502 Forth system running, but compilation took too long. Their solution was to simulate the 6502 on a PDP-11 and run their Forth system in the simulator for improved speed. In a way this was cross-compilation, because the compiler was running on a PDP-11, but it wasn't really cross-compilation because it was just the traditional Forth system running the same way that it would have run on a 6502, just somewhat faster.
On Thursday, November 26, 2009 at 3:24:06 AM UTC-7, Anton Ertl wrote:
> Hugh Aguilar <
hugoa...@rosycrew.com> writes:
> >On Nov 25, 4:14=A0am,
an...@mips.complang.tuwien.ac.at (Anton Ertl)
> >wrote:
> >> >On Nov 25, 8:57=3DA0am, Hugh Aguilar <
hugoagui...@rosycrew.com> wrote:
> >> >> I don't use gforth. What does that error message mean? What is a
> >> >> "compile-only word?"
> >>
> >> A word without interpretation semantics.
> >>
> >> >It doesn't like you taking the address of ";" , though I don't
> >> >understand why.
> >>
> >> Because ";" has no execution or interpretation semantics. =A0The
> >> execution token returned by ['] represents the execution semantics,
> >> but since ";" does not have that ...
> >
> >I don't understand how a word can not have execution semantics.
>
> That's quite simple: By not defining execution semantics in the
> definition of the word in the standard document. Look up the
> definition of ";" in the standard, and you will see that there is no
> "Execution:" section there; and there are other labeled sections
> there, so the "omitted label" sentence of 3.4.3.1 does not apply.
>
> >For immediate words (IF, ;, etc.)
>
> IF and ";" are not immediate words in the standard. A system can
> implement them as immediate words, but a program cannot rely on their
> immediacy.
>
> >I looked up ['] in the ANS-Forth document and it says:
> >
> >"Place name's execution token xt on the stack."
>
> What's the execution token of a word that has no execution semantics.
>
> Hmm, since you think that ";" is immediate, I guess you want an
> execution token that, when executed, performs the compilation
> semantics. You can get that as follows. Before the rest of the
> program, define:
>
> : ; postpone ; ; immediate
>
> Now you have an immediate ";" with an execution semantics that's the
> same as the compilation semantics, and you can tick it.
>
> >What I am saying is that I didn't have any warning that what I was
> >doing in MACRO: was going to be a problem.
>
> A system that would tell us all non-standard usages would be nice, but
> we don't have that. For now the solution is to test on as many
> systems as possible.
>
> - anton
This last one is a super-doozy! Here Anton Ertl invents disambiguifiers. I forgot about this, and it was years later when I invented disambiguifiers myself. Now, the irony is that everybody (including Anton Ertl) refuses to accept my disambiguifiers --- this is despite (actually because of) the fact that disambiguifiers are the key to allowing the ANS-Forth programmer to write his own outer-interpreter, which is the key to writing a cross-compiler --- nobody at Forth Inc. or MPE wants this to happen, because they make most of their money on selling cross-compilers and they don't want any competition.
Also, btw, is it pretty humorous the way that Anton Ertl says that we have to just test our programs on as many ANS-Forth systems as possible to find out if the programs are ANS-Forth compatible?
ANS-Forth is just too much fun! More fun than a barrel of monkeys!