Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!goya!esink@turia.dit.upm.es From: esink@turia.dit.upm.es (Eric W. Sink) Newsgroups: comp.lang.c++ Subject: C < X < C++, worthwhile(X), solve for X Keywords: implementation, object oriented, sanity Message-ID: <1991May23.115050.5755@dit.upm.es> Date: 23 May 91 11:50:50 GMT Sender: @dit.upm.es Reply-To: esink@turia.dit.upm.es (Eric W. Sink) Followup-To: comp.lang.c++ Organization: Dept. Ingenieria de Sistemas Telematicos, dit, upm, Madrid, Spain Lines: 54 Nntp-Posting-Host: turia.dit.upm.es I've been thinking about augmenting a C compiler with some object oriented features. Several months ago, I posting a question to the net, asking how difficult it would be to modify a C compiler into a C++ compiler. I'm fairly familiar with both languages, but have only a little understanding of how C++ is traditionally implemented. Steve Clamage responded to my question by email, I assume he doesn't mind my paraphrasing his response (I lost the original note from Steve) : Hard. Really hard. Most people don't realize just how difficult is to parse C++. Any quantitative estimate of the effort would no doubt be ruinously low. All known attempts at making a C++ compiler out of a C compiler have failed. [Steve, feel free to post and correct my paraphrase if necessary, but I think I got the gist of it] Well, I dropped the idea for quite a while, and have just picked it back up again. In light of Steve's prophesy, I have lowered my aim a bit. Q: Given a working ANSI compliant C compiler, suppose that you want to modify it to compile an object oriented superset of C. This language must be a subset of C++. Handling all of C++ is deemed to be not worth the effort for your project. What features of C++ would you implement ? Is there a subset of C++ which can be implemented with reasonable effort, which would be useful ? I am speculating that features like operator overloading, exceptions, templates, multiple inheritance are out of the question. The features I would *like* to try to implement are : member functions, virtual and otherwise inheritance anything else that would not be too hard (how about simply the ability to intermix declarations with statements within a block) Feel free to change my list, that's the point of the question. Any responses appreciated. Those who want to tell me that the creation of non-standard object oriented C like languages is a waste of time should keep in mind that I do not attend to win the world over with my language, merely to learn from its implementation and gain the ability to use it myself. Thanks in advance, Eric Eric W. Sink | "If no one is criticizing |Opinions Departamento de Telematica | your work, it is possible |mine - Universidad Politecnica de Madrid| that you are not doing |all of esink@turia.dit.upm.es | anything." -George Verwer |them.