This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
On 11/06/2012 09:45, Chris Jones wrote:So it seems I have two options really. Use a translator to implement my language with gcc. Or I could develop a new front-end for it to integrate it into gcc. Am I right?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?
I would think that would depend entirely on the language you want to implement. If your language has similar principles to existing gcc languages, then most of the middle-end and back-end could be left untouched. But if it has major differences, you might need to change gcc in all sorts of difficult places.
I guess the best guide here would be to look at the integration of Go into gcc - I believe it is the most recent addition to gcc.
You could also consider a stepping stone of making a translator between your new language and C (or C++, D, Go, etc.), then using gcc to compile the C code. It is not going to be optimal, but it could be useful in developing your language, testing the concepts, developing the libraries, etc. And it will also help answer your question - if you can make a reasonably efficient translator to C (using any gcc extensions as needed), then you can expect a reasonably straightforward job in writing a gcc front-end to the language. But if you find concepts that are particularly alien to C, then you are going to have a bigger job writing a gcc front-end.
-- Chris Jones
OpenSUSE Linux x86_64 (PC)|Android (Smartphone)|Windows 7 (Laptop)|Windows XP (Gaming) Kernel developer|Lead Developer of SDL|Lead Developer of Nest Linux|Gamer and Emulator nut|Web Services|Digital Imaging Services Controllers: Rapier V2 Gaming mouse|Logitech Precision|PS3 controller|XB360 controller|Logitech Attack 3 j/stick Emulators: Fusion|Gens|ZSNES|Project64|PCSX-R|Stella|WinVICE|WinUAE
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |