On Mon, Jun 11, 2012 at 05:45:12PM +1000, Chris Jones wrote: > Is it possible to modify the source code of gcc to enable to > compilation of a completely new programming language, as yet > unrecognized? How much of a big job would I be looking at for such a > task?
It is certainly possible, and it has been done (e.g. for Pascal, Oz?, D). In the past the C++ & Go front-end have also existed [separately], but are now merged into GCC. Look into them for examples... The difficulty of the task depends a lot upon the syntax and semantics of your new programming language (e.g. making a Pascal front-end is probably simpler than making an Haskell front-end). For example, C++ template expansion is done currently in the C++ front-end and this is a massive amount of work. If you don't know much about GCC internals, consider that you'll need many months (you need to understand GCC first before extending it, and that requires time). Notice that LLVM (which I don't know much) was designed to be a library usable to hack compilers. In contrast, GCC is a program (not a library) and you need to dive into it. You could also consider implementing your programming language as a translator to C code (with GCC extensions). Good luck. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mines, sont seulement les miennes} ***