The main problem is that you're not supposed to use it but just study it. You can for example write few lines of pre-iso C++ and see how an implementation (the CFront) translates it to pure C. It may be useful to see a possible implementation of vtbl and virtual function calls for example. The ARM from Stroustrup is a very valuable source to understand possible internal representation of C++ in C.
Don't expect to write real C++ code which, except for simple example, will not run on any other implementations. If you write anything with CFront, you'll have to rewrite your code for any modern C++ compiler. We don't have the permission to extend Cfront, for the best, we are just allowed to make few patches to let it work on the target C compiler. No more!! We are not allowed to fix bugs or implement missing things from any of the C++ standards. So, Cfront interest is very limited. -----Original Message----- From: Tinycc-devel [mailto:[email protected]] On Behalf Of Steffen Nurpmeso Sent: Tuesday, November 02, 2021 18:35 To: [email protected] Cc: [email protected] Subject: Re: [Tinycc-devel] CFront for TinyCC? Christian Jullien wrote in <[email protected]>: |Hi Domingo, |This is very interesting but I wonder what it will be used for? | |Stroustrup and others explicitly say that CFront should not be used \ |for any purpose except for historical research purpose: | |http://www.softwarepreservation.org/projects/c_plus_plus/index.html#rele\ |ase_30 |"The source code in this section is posted with the permission of the \ |copyright owner for historical research purposes only." | |It's fine if you use it within this scope otherwise you should not \ |promote this dev. as a way to have a "kind of" C++ on top of tcc. Oh i _always_ hated that thing one had to read after egcs ended in g++ saying "generates real object code"! I love languages like Nim (never used it but i think it really rocks programmers) who provide a syntax and hints that rock programmers, but preprocesses the outcome to plain C that can be build with basic compilers! Isn't that just fantastic?? However as far as i know they simply failed to pimp that thing for templates etc, which is why they gave up on it? I personally would love to be able to write C+, a bit of namespaces, simple templates and objects with methods (as opposed to functions with objects) on top of plain C. That is overly cool. I did not know about cfront-3, thanks for the pointer, i will try it once i have new bandwidth. It once tried to bring cfront to live from an archived version from the beginning of the 90s or so, i have forgotten where that came from. Non-Plan9. But i gave up, too much effort for some island that will never make it. Cool! --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) _______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel _______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
