* support for C++ ?
@ 2007-06-26 2:20 Mathieu Bouchard
2007-06-26 5:11 ` Josh Triplett
0 siblings, 1 reply; 5+ messages in thread
From: Mathieu Bouchard @ 2007-06-26 2:20 UTC (permalink / raw)
To: linux-sparse
[-- Attachment #1: Type: TEXT/PLAIN, Size: 339 bytes --]
Are there any plans for supporting C++ or any subset thereof? (e.g.
parsing G++4 syntax but perhaps skipping over some constructs that are
difficult to handle if it's too much work for now)
thanks.
_ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: support for C++ ?
2007-06-26 2:20 support for C++ ? Mathieu Bouchard
@ 2007-06-26 5:11 ` Josh Triplett
2007-06-26 11:01 ` Jeff Garzik
0 siblings, 1 reply; 5+ messages in thread
From: Josh Triplett @ 2007-06-26 5:11 UTC (permalink / raw)
To: Mathieu Bouchard; +Cc: linux-sparse
[-- Attachment #1: Type: text/plain, Size: 1135 bytes --]
Mathieu Bouchard wrote:
> Are there any plans for supporting C++ or any subset thereof? (e.g.
> parsing G++4 syntax but perhaps skipping over some constructs that are
> difficult to handle if it's too much work for now)
To the best of my knowledge, nobody involved in the Sparse community has any
plans to attempt C++. I also think that a subset of the language capable of
handling any significant number of common programs would end up containing
most of the language. Even basic support for C++ would require large changes
to the parser and to the Sparse data structures, and that doesn't even count
the huge can of worms that would open once you start running into interactions
between Sparse-annotated types and inheritance or overloading.
I certainly won't rule the idea out; if someone wants to submit clean patches
adding C++ support to Sparse, I would take them. At the lowest level, code
should still end up looking much like the current Sparse bytecode format.
However, such a project would require a monumental coding effort.
The same thing applies to other C-like languages.
- Josh Triplett
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: support for C++ ?
2007-06-26 5:11 ` Josh Triplett
@ 2007-06-26 11:01 ` Jeff Garzik
2007-06-26 13:10 ` Josh Triplett
0 siblings, 1 reply; 5+ messages in thread
From: Jeff Garzik @ 2007-06-26 11:01 UTC (permalink / raw)
To: Josh Triplett; +Cc: Mathieu Bouchard, linux-sparse
Josh Triplett wrote:
> To the best of my knowledge, nobody involved in the Sparse community has any
> plans to attempt C++. I also think that a subset of the language capable of
> handling any significant number of common programs would end up containing
> most of the language. Even basic support for C++ would require large changes
> to the parser and to the Sparse data structures, and that doesn't even count
> the huge can of worms that would open once you start running into interactions
> between Sparse-annotated types and inheritance or overloading.
Indeed. The gcc people even wrote their own hand-coded C++ parser for
similar reasons, so I can't see it being an easy integration into
sparse. You might as well fork at that point.
Jeff
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: support for C++ ?
2007-06-26 11:01 ` Jeff Garzik
@ 2007-06-26 13:10 ` Josh Triplett
2007-06-26 13:21 ` Derek M Jones
0 siblings, 1 reply; 5+ messages in thread
From: Josh Triplett @ 2007-06-26 13:10 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Mathieu Bouchard, linux-sparse
[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]
Jeff Garzik wrote:
> Josh Triplett wrote:
>> To the best of my knowledge, nobody involved in the Sparse community has any
>> plans to attempt C++. I also think that a subset of the language capable of
>> handling any significant number of common programs would end up containing
>> most of the language. Even basic support for C++ would require large changes
>> to the parser and to the Sparse data structures, and that doesn't even count
>> the huge can of worms that would open once you start running into interactions
>> between Sparse-annotated types and inheritance or overloading.
>
> Indeed. The gcc people even wrote their own hand-coded C++ parser for
> similar reasons, so I can't see it being an easy integration into
> sparse. You might as well fork at that point.
While a C++ parser would add significant complexity to Sparse, I would still
prefer to integrate it rather than encouraging people to fork. I think a
reasonable amount of code sharing would still exist between the C and C++
code, and ideally almost all of the backend code would support both.
- Josh Triplett
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: support for C++ ?
2007-06-26 13:10 ` Josh Triplett
@ 2007-06-26 13:21 ` Derek M Jones
0 siblings, 0 replies; 5+ messages in thread
From: Derek M Jones @ 2007-06-26 13:21 UTC (permalink / raw)
To: Josh Triplett; +Cc: Jeff Garzik, Mathieu Bouchard, linux-sparse
Josh,
> While a C++ parser would add significant complexity to Sparse, I would still
> prefer to integrate it rather than encouraging people to fork. I think a
> reasonable amount of code sharing would still exist between the C and C++
> code, and ideally almost all of the backend code would support both.
Experience suggests that a C++ front end is around a factor of seven
times larger than a C front end.
There are many more syntactic ambiguities in C++ that require
symbol table information to resolve (even then life can be tough).
Code sharing would be possible in the sense that if a C++ parser
were implemented it would be close to handling C out of the box.
--
Derek M. Jones tel: +44 (0) 1252 520 667
Knowledge Software Ltd mailto:derek@knosof.co.uk
Applications Standards Conformance Testing http://www.knosof.co.uk
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-06-26 13:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-26 2:20 support for C++ ? Mathieu Bouchard
2007-06-26 5:11 ` Josh Triplett
2007-06-26 11:01 ` Jeff Garzik
2007-06-26 13:10 ` Josh Triplett
2007-06-26 13:21 ` Derek M Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).