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

D

DeMarcus

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
 
P

Pavel

DeMarcus said:
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
 
J

Jerry Stuckle

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.
(e-mail address removed)
==================

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

Öö Tiib

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.
 
F

Frank Buss

DeMarcus said:
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 address 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! ]
 
J

Joshua Maurice

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.
 
I

Ian Collins

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.
 
N

nmm1

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.
 
J

Johannes Schaub (litb)

DeMarcus said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top