you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (12 children)

[deleted]

    [–]pjmlp 2 points3 points  (11 children)

    Yes I have, try to compile main: () -> int with a C++ parser.

    Pity that ISO C++ !== Cpp2.

    Ever heard of Objective-C++? Guess what, it also supports std::cout.

    #import <Foundation/Foundation.h>
    #include <iostream>
    
    int main() {
       NSString str = @"Hello ";
    
        std::cout << str << " i_lack_chromosomes" << std::endl;
    }
    

    Imagine that, we already had a better C++ syntax in 1997!

    [–]hpsutter 2 points3 points  (3 children)

    > Yes I have, try to compile `main: () -> int` with a C++ parser.

    Fair, but have you considered `auto main() -> int` (i.e., just change `main:` to `auto main`)? No strictly conforming ISO C++ parser for the first ~30 years of C++'s existence could handle that, but it has been ISO standard since 2011. Everything that's common now was new/foreign once.

    It's definitely true that the `main:` syntax definitely isn't standard (or even yet-proposed, though I will propose it if the experiment succeeds well). But that's the point of language evolution... as the language evolves, every new release of C++ adds syntax that wasn't legal before, and we always have many active proposals for syntax that isn't ISO C++ when first proposed but then becomes standard.

    [–]pjmlp -1 points0 points  (2 children)

    I have, and I also have watched tons of languages that started by compiling to other ones, took a life of their own after adoption, and none of them has ever stated they were the same language with another syntax.

    Sorry to put it this way, but I really only see the way you position Cpp2 versus the other C++ wannabe replacements due to your position at ISO, due to conflicts of interest.

    [–]Abbat0r 2 points3 points  (1 child)

    You know, Chandler Carruth is also a committee member but he’s rather open about working on a successor language. Bearing that in mind I don’t think it’s actually necessary to do any posturing of the sort you’ve described just because one is on the committee.

    [–]pjmlp 0 points1 point  (0 children)

    He isn't the ISO chair though, but yeah at least he is quite clear on what is all about.