Kevin -

This is likely to be a *very* hard project. Indeed it may be impossible
without rewriting a substantial part of tcc. tcc's parser and lexer are
written by hand, so you'd have to wrap your head around that. Furthermore,
getting proper late-time binding to work would require some pretty
sophisticated knowledge of C. Building the correct metaobject system to
handle templates is bound to be tricky. You have already mentioned (in a
different thread) that you are new to C, so I would disuade you from
picking up this project until you have more real world experience with C.

I propose two alternatives that might be good for you given your current
experience with C. First, I highly recommend this book about a C object
system called OOC <http://www.cs.rit.edu/~ats/books/ooc.pdf>. Once you've
read that, you might consider either (1) creating an ooc-like system that
tcc can use, or (2) writing a preprocessor which could convert C++
constructs into C. This combination would give you some real practice
working with some of the more sophisticated contructs in C, as well as
wrapping your head around the more complicated issues in C++ such as
managing namespaces, templates, inheritance, etc.

I am certainly not the most wisened person on this list. If I have made a
poor suggestion, I would appreciate if somebody could call it out for me.
For example, does anybody know if GObject provides a better starting place
than ooc.pdf for learning about object orientation in C?

David


On Mon, Dec 16, 2013 at 4:34 AM, Kevin Ingwersen
<[email protected]>wrote:

> Hey!
>
> I was just looking into the source, and especially at the actual
> „compiler“ part, in order to see if one could add a language to it.
> Is that possible? Because if so, I was curios about trying to get C++
> working.
>
> Kind regards, Ingwie
> _______________________________________________
> Tinycc-devel mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>



-- 
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to