home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!demon!cix.compulink.co.uk!spelk
- Newsgroups: comp.lang.forth
- From: spelk@cix.compulink.co.uk (MPE Ltd)
- Subject: cross compilers
- Reply-To: spelk@cix.compulink.co.uk
- Date: Tue, 15 Sep 1992 00:04:00 +0000
- Message-ID: <memo.627478@cix.compulink.co.uk>
- Sender: usenet@gate.demon.co.uk
- Lines: 63
-
-
- >The first step in standardising cross compilers should be to write
- >a clear explanation of how a cross compiler works and publish code
- >that does it in an efficient manner. We will know the code is good
- >when it gets copied into various new Forth systems.
-
- >>Sorry, I have to disagree with this. This seems to be saying that
- >>we should have one cross-compiler, period....which would by default
- >>be standard! I'd rather see variety in cross-compiler approaches.
-
- Then we would have to standardise their features. In practice the
- Forth source code to be passed through a cross compiler is
- standardised by the standard/dialect being used. Any deviation
- from this is usually recognised as a deviation or failure by
- both the author and the user. Most of us who develop cross
- compilers work hard to minimise these deviations. I will find
- it hard to summon any enthusiasm for standardising what are quite
- rightly regarded as implementation deficiencies.
-
- It is only the control of the cross compiler that could be
- standardised. For example how do you define the base address of the
- output.
- addr ROM-BASE
- addr n ORG/DB
- addr ROM-ORG
- have all been used. How are named labels defined? How are equates
- handled. Since I hear many statements that Forth has a major role
- to play in the embedded systems area, which is the domain of cross
- compilers for many users, surely the ANSI committee is neglecting
- a substantial proportion of users by choosing not to consider thes
- issues for the moment. Perhaps the major cross compiler vendors
- (MPE, LMI, Forth Inc ...) may care to prpare a joint submission?
- MPE would be willing to coordinate this.
-
- The next step would be to standardise assembler syntax -
- assembler facilities are VERY important when cross compiling
- a kernel. For example, even within an 8086 assembler the following
- may be found between Forth implementations.
- MOV AX, # 0100
- MOV AX, 0100
- MOV AX 0100
- AX, 0100 MOV
- AX, # 0100 MOV
- # 0100 AX MOV
- Trying to standardise that many variants across twenty or thirty
- processors is an udesirable task.
-
- >BTW, I think Stephen Pelc has devised a useful nomenclature
- >for metacompilers:
- >a "cross-compiler" can produce code for a different CPU.
- >A "recompiler" --
- >e.g. Pygmy -- can simply regenerate the kernel for the host CPU;
- >it can't produce code for a new CPU.
- >I think "metacompiler" is the general class. (Please correct me if
- I'm
- >wrong, Stephen.)
-
- Right, except that "metacompiler" is misnomer that should be avoided.
- A metacompiler produces a compiler for another language. Metacompiler
- is the general term for tools such as YACC, and Forth cross compilers
- do not yet perform that task. I use the term cross compiler as the
- general class. The term target compiler is sometimes used for cross
- compiler.
-