Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > What do you think about a C++ educational compiler?

Reply
Thread Tools

What do you think about a C++ educational compiler?

 
 
DeMarcus
Guest
Posts: n/a
 
      08-23-2010
Hi,

(Many of you may find this off topic, but I consider it being of C++
educational value.)

What would you think of having your compiler not just give you an error
message, but also tell you what paragraph in the standard you broke?


Regards,
Daniel

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

 
Reply With Quote
 
 
 
 
Pavel
Guest
Posts: n/a
 
      08-23-2010
DeMarcus wrote:
> Hi,
>
> (Many of you may find this off topic, but I consider it being of C++
> educational value.)
>
> What would you think of having your compiler not just give you an error
> message, but also tell you what paragraph in the standard you broke?
>
>
> Regards,
> Daniel
>

Sounds like a great idea to me.

-Pavel
 
Reply With Quote
 
 
 
 
Jerry Stuckle
Guest
Posts: n/a
 
      08-23-2010
On 8/22/2010 9:05 PM, DeMarcus wrote:
> Hi,
>
> (Many of you may find this off topic, but I consider it being of C++
> educational value.)
>
> What would you think of having your compiler not just give you an error
> message, but also tell you what paragraph in the standard you broke?
>
>
> Regards,
> Daniel
>


I'm not sure what advantage this would have. I think very few people
have copies of the standard. I think it would just be more confusing to
a lot of people. And what do you do if it violates multiple paragraphs
(as a lot of syntax errors do)?

I also think it would be a large cost for the compiler developers to
implement such a feature.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
http://www.velocityreviews.com/forums/(E-Mail Removed)
==================

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

 
Reply With Quote
 
Öö Tiib
Guest
Posts: n/a
 
      08-23-2010
On 23 aug, 04:05, DeMarcus <(E-Mail Removed)> wrote:
> Hi,
>
> (Many of you may find this off topic, but I consider it being of C++
> educational value.)
>
> What would you think of having your compiler not just give you an error
> message, but also tell you what paragraph in the standard you broke?


Interesting idea. Diagnostics of compilers are usually documented
somewhere so you may take the list and try to match it with standard.

There are likely problems however. Compiler vendors are already
putting lot of effort into making the diagnostics as helpful they can.

It is difficult since compiler is just a program and it has limits.
For example compiler tells that it did not expect ';' at that spot or
that it found a name that is unspecified for it. It rarely can tell
what exactly you did likely want to do so it does not know what you
did violate.

Such a teaching compiler however should instead understand what you
did try to do. It is often hard even for other human being without
asking from the author of non-compiling code.

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

 
Reply With Quote
 
Frank Buss
Guest
Posts: n/a
 
      08-23-2010
DeMarcus wrote:

> What would you think of having your compiler not just give you an error
> message, but also tell you what paragraph in the standard you broke?


This would be a good idea. And I would like to have a C++ compiler, which
would detect all undefined behavior locations in my code, too

--
Frank Buss, (E-Mail Removed)
http://www.frank-buss.de, http://www.it4-systems.de

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

 
Reply With Quote
 
Joshua Maurice
Guest
Posts: n/a
 
      08-23-2010
On Aug 22, 6:05 pm, DeMarcus <(E-Mail Removed)> wrote:
> Hi,
>
> (Many of you may find this off topic, but I consider it being of C++
> educational value.)
>
> What would you think of having your compiler not just give you an error
> message, but also tell you what paragraph in the standard you broke?


It would be very nice if the standard was intelligible. As is, it
would be of some minor use, but as I've said in other threads: C++
programmers program more to accept practice and known implementations
than they do to the often vague, unclear, poorly organized official
standard.

As is, I much prefer error messages which say "Did not expect <x>.
<blah blah blah>. Did you mean for the dependent name to be a type?
Try using "typename"." which some modern compilers will do.


--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      08-23-2010
On 08/23/10 01:05 PM, DeMarcus wrote:
> Hi,
>
> (Many of you may find this off topic, but I consider it being of C++
> educational value.)
>
> What would you think of having your compiler not just give you an error
> message, but also tell you what paragraph in the standard you broke?


That's probably something best left to the tools that are used with the
compiler, such as an IDE. Some diagnostics are verbose enough now
without adding to them.

--
Ian Collins

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

 
Reply With Quote
 
nmm1@cam.ac.uk
Guest
Posts: n/a
 
      08-23-2010
In article <(E-Mail Removed)>,
Joshua Maurice <(E-Mail Removed)> wrote:
>On Aug 22, 6:05 pm, DeMarcus <(E-Mail Removed)> wrote:
>>
>> (Many of you may find this off topic, but I consider it being of C++
>> educational value.)
>>
>> What would you think of having your compiler not just give you an error
>> message, but also tell you what paragraph in the standard you broke?


Infeasible. Firstly, each version of the standard differs, sometimes
drastically. Secondly, many errors don't correspond to any single
location in the standard, and sometimes even correspond to no location
at all (i.e. using a syntactic form that does not exist).

>It would be very nice if the standard was intelligible. As is, it
>would be of some minor use, but as I've said in other threads: C++
>programmers program more to accept practice and known implementations
>than they do to the often vague, unclear, poorly organized official
>standard.


Look on the bright side - it's better than many. A standard should
favour precision over readability, but I agree that it isn't as good
on the former as it should be.

>As is, I much prefer error messages which say "Did not expect <x>.
><blah blah blah>. Did you mean for the dependent name to be a type?
>Try using "typename"." which some modern compilers will do.


Yeah. Fine when you make an obvious, common error. When you make
a more subtle one, you have to reverse engineer the message to find
out what it is objecting to.


Regards,
Nick Maclaren.

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

 
Reply With Quote
 
Johannes Schaub (litb)
Guest
Posts: n/a
 
      08-23-2010
DeMarcus wrote:

> Hi,
>
> (Many of you may find this off topic, but I consider it being of C++
> educational value.)
>
> What would you think of having your compiler not just give you an error
> message, but also tell you what paragraph in the standard you broke?
>


Many compilers already do that. They give error codes.

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If you think you must modify the hash, think again David Mark Javascript 17 03-23-2010 08:08 PM
So You Think You’re Reading - No Dear You’re Screening,,,,, danbloom Digital Photography 2 03-02-2009 03:31 AM
Do we have educational IDEs? hiwa Java 63 06-01-2005 03:08 AM
Educational or Experience Requirements Roy MCSD 6 03-07-2004 11:15 PM
Help with educational route Magan MCSE 7 01-05-2004 07:44 PM



Advertisments