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

Discussion in 'C++' started by DeMarcus, Aug 23, 2010.

  1. DeMarcus

    DeMarcus Guest

    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! ]
     
    DeMarcus, Aug 23, 2010
    #1
    1. Advertising

  2. DeMarcus

    Pavel Guest

    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
     
    Pavel, Aug 23, 2010
    #2
    1. Advertising

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

    ==================

    [ See http://www.gotw.ca/resources/clcm.htm for info about ]
    [ comp.lang.c++.moderated. First time posters: Do this! ]
     
    Jerry Stuckle, Aug 23, 2010
    #3
  4. DeMarcus

    Öö Tiib Guest

    On 23 aug, 04:05, 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?


    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! ]
     
    Öö Tiib, Aug 23, 2010
    #4
  5. DeMarcus

    Frank Buss Guest

    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,
    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! ]
     
    Frank Buss, Aug 23, 2010
    #5
  6. On Aug 22, 6: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?


    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! ]
     
    Joshua Maurice, Aug 23, 2010
    #6
  7. DeMarcus

    Ian Collins Guest

    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! ]
     
    Ian Collins, Aug 23, 2010
    #7
  8. DeMarcus

    Guest

    In article <>,
    Joshua Maurice <> wrote:
    >On Aug 22, 6:05 pm, DeMarcus <> 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! ]
     
    , Aug 23, 2010
    #8
  9. 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! ]
     
    Johannes Schaub (litb), Aug 23, 2010
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    614
  2. Ioannis Vranos
    Replies:
    35
    Views:
    935
    Kelsey Bjarnason
    Feb 7, 2008
  3. Ioannis Vranos
    Replies:
    57
    Views:
    1,676
    Ioannis Vranos
    Feb 22, 2008
  4. Ioannis Vranos
    Replies:
    23
    Views:
    936
  5. David Mark
    Replies:
    17
    Views:
    242
    David Mark
    Mar 23, 2010
Loading...

Share This Page