Re: Building a compiler variant

Lex Spoon <lex@cc.gatech.edu>
26 Feb 2004 01:10:05 -0500

          From comp.compilers

Related articles
Building a compiler variant anglewyrm@hotmail.com (AngleWyrm) (2004-02-12)
Re: Building a compiler variant lex@cc.gatech.edu (Lex Spoon) (2004-02-26)
Re: Building a compiler variant nospam@nspam.net (Bill Cunningham) (2004-05-08)
| List of all articles for this month |
From: Lex Spoon <lex@cc.gatech.edu>
Newsgroups: comp.compilers
Date: 26 Feb 2004 01:10:05 -0500
Organization: Georgia Institute of Technology
References: 04-02-114
Keywords: C++
Posted-Date: 26 Feb 2004 01:10:04 EST

"AngleWyrm" <anglewyrm@hotmail.com> writes:


> Hi,
> I want to change the functionality and behavior of a keyword (in
> C++). And to do so probably requires that I make a customized
> compiler. Yes, I know, limited audience ;)
>
> But nonetheless, the dauntingly humungous bite sounds like it could be fun!
>
> Can anyone recommend a good starting point for this adventure?




The moderator had a good suggestion.


I might suggest choosing a different basis than C++ for future
projects. In particular, languages like Scheme and Lisp have good
macro systems, which in turn make it quite easy to experiment with
language features. Additionally, any *simple* language would be an
improvement over C++. If you want an OO language, Smalltalk may be
worth looking at; it has something like 6 expression types in the
grammar. You can make radical changes relatively easily. Once you
have figured out exactly what you want the feature to do, then you may
consider coming back and adding it to C++ later.


Also, if you work in C++ you might want to consider abusin--I mean,
*using* the template system and the operator overloading. MacNamara's
FC++ has done some incredible stuff that you would think requires a
preprocessor, so you might want to go take a look at it. By sticking
with templates and operators, you end up with something that can run
anywhere that C++ is available.




-Lex


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.