Izo (***@siol.net) wrote:
: WLad wrote:
: > There is an idea to add Component Pascal to GCC.
: >
: > Is there possible?
: >
: > I don't know anything about mechanisms of adding new frontends to GCC.
: > I don't know what about GC realization if I implement new language for GCC.
: > I don't have any idea concerning dynamic linking (in sense of Component
: > Pascal) at other systems.
: >
: > It seems I will work in QNX. It very interesting system. I want to have
: > habitual IDE (or at least language) in this system.
: >
: > Does anybody have any info concerning this all?
: >
: The PL2 / Pascal - ish languages within the gcc compiler tree are two
: right now: ADA (you can find it on the gnu web page) and GNU Modula-2 (
: http://floppsie.comp.glam.ac.uk/Glamorgan/gaius/web/GNUModula2.html ,
: Gaius Mullay, ***@glam.ac.uk , ***@glam.ac.uk )
The most Pascalish front end to GCC is GPC (http://www.gnu-pascal.de/).
You should consider that GCC was not designed for Oberon type systems.
Problems are:
-- no support for garbage collection (you have to use conservative
garbage collector)
-- long compilation time
-- no special support for dynamic linking
That does not exclude use of GCC. However you should consider dual
strategy: GCC compilation for maximal runtime speed and some other
compiler (or compiler+interpreter combo) for fast changing code.
And you will have to do some dirty work to get dynamic linking going
-- most system allows you rather easily to link in new code, but
hot replecement is more tricky.
You may look at Java, semantically Java seems to be much closer to Oberon
then traditional Pascal.
I you want just to start with GCC: do not worry about GC or dynamic
loading. Boehm conservative garbage collector works reasonably well
-- it is used by gcj (GNU Java). And there is no chance to use precise
garbage collector with GCC output. IMHO dynamic loading can be added at
the end -- you need to generate proper tables for linker/loader but that
should be easy if you have needed info in compiler.
Main work in front end is:
-- parsing
-- handling declarations
-- expanding some built-in magic
generating code is reasnably easy (as most works is done by the backend).
For starters you may look at:
http://cobolforgcc.sourceforge.net/cobol_14.html
The text is slightly outdated, but will give you needed background.
--
Waldek Hebisch
***@math.uni.wroc.pl