This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Extending Gcc For a New Language
- From: "Marty Hauff" <marty dot hauff at rmit dot edu dot au>
- To: <kevin at atkinson dot dhs dot org>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Thu, 06 Mar 2003 12:13:36 +1100
- Subject: Re: Extending Gcc For a New Language
Kevin,
I too am doing a PhD and have been drawn towards GCC. My specific interest area is Hardware / Software Co-design - i.e. how do you find the optimal mix of hardware and software for an embedded application. I was interested in your email because I thought about constructing a new language for co-design - i.e. create a language that combined the best of both hardware and software constructs. I opted against pursuing the new language idea mainly because that is not where my skill area is. I'm more of a hardware person. One thing that I did conclude, however, is that a co-design language will eventually need to compile code for hardware that may or may not be fully defined. My PhD work is therefore focussing on developing a method for easily porting GCC to new targets so that the hardware can be tweeked (change register sizes, number of alus etc) and an application can be recompiled for the new target. By doing this iteratively, hardware/software mixes can be investigated and hopefully optimized (fingers crossed).
Anyway, if my area of interest is of any use to you I would be interested in collaborating.
Enjoy
Marty
>>> Kevin Atkinson <kevin at atkinson dot dhs dot org> 6/03/03 11:49:31 >>>
For my Ph D I am seriously considering designing a new System Program
language. Unlike many other new languages, my new language will be
designed to be suitable for low-level programming tasks such as written
kernels and operating systems, It is designed to replace C and C++
(wishful thinking I know).
For the implementation I am considering two choices
1) Writing the compiler in its own language that emits C (or perhaps
C++) code and then uses gcc to compile it.
2) Extending Gcc to support the new language.
Because my language will offer features not currently supported by C or
C++ (and probably Java, Ada, and Fortune but I don't know enough about
those languages to be sure), it will me more than simply writing a new
front end. Some of the features the language may offer:
* Type inference in the style of most functional programming languages, but
perhaps a bit more limited. Generally global variables and function
parameters will have the types specified, but the compiler will be
expected to infer the types for local variables.
* No user written header files, instead the compiler will emit the
necessary information. When no optimizations are used it will only emit
function phototypes and the like. When using optimization it will emit
more such as function definitions for functions which are good inlining
candidates.
* An optional garbage collector. When active the collector will only be
used for some objects, AND the user will be allowed to free objects
explicitly. (I know has support for garbage collection but I don't know
how powerful it is and if it can handle objects being freed by the user)
* Very precise typing of objects. Types can be limited by arbitrary
boolean expressions such as limiting an integer to a particular range. If
the compiler can not verify the conditions at compile time it is expected
to be able to optionally emit code to check for it at runtime.
I think that should cover it for now. I will be about a year before I
give any serious thought into my new language. So don't expect to much
specific information.
--
http://kevin.atkinson.dhs.org