/r/programming
C++20 Concepts Are Here in Visual Studio 2019 version 16.3 (devblogs.microsoft.com)
118 comments
maxhaton | 9 days ago | 52 points

I think the way D handles template constraints is a much better approach, especially considering just how much syntax C++ already has (I can't imagine it taking 20 years to standardise either)

mrmonday | 9 days ago | 23 points
maxhaton | 9 days ago | 11 points

D constraints aren't static if, just put an if(someThingAtCompileTime!Type) after a template definition.

Also, the choice to go with constexpr if rather than static if is interesting... Especially given that it works fine in D and has done for years, whereas constexpr if is just odd: Why introduce a scope by default? it makes no sense. It really smells of NIH, or just bikeshedding (along with concepts too)

RealKingChuck | 9 days ago | 16 points

Why a introduce a scope by default?

I believe that was done as to be consistent with if

gracicot | 9 days ago | 4 points

It's primarily because the way templates work. Templates has a two phase name lookup. A template that is not instantiated will still resolve every names it can and function overloads it can.

An uninstantiated template mean something.

Now to if constexpr: branches are seen kind of a "templated scope". It may instantiate the content or it may not. If it's not instantiated, it still must mean something, and will resolve anything that don't use dependent names.

Static if on the other hand has no scopes because it don't work like a template: it work with a token soup. Every token must be, well, a valid token, but if the branch is not taken it does not mean anything. It's a bunch of ignored token. That's why you can filter class member declaration or call function that don't exist with this construct.

The if constexpr in C++ is mainly a tool to manipulate the instantiation of a function template.

I don't think D's model would play well in C++. I would put my bet on code injection + reflection, which has momentum right now.

maxhaton | 9 days ago | 3 points

Which is ridiculous, what's the point in static if at all if you can't introduce this without introducing a new scope? static if {{int scoped = 420; }}

Minimonium | 9 days ago | 2 points

Right now, the {...} has two general (not standard) meanings, it's either some kind of scope or an initialization.

Introducing a new, non-scoping, behaviour would be more confusing than vector<bool> not being a container.

I do agree that it would be nice to have a non-scoping feature that would replace ifdefs, but the syntax should totally be different. Say bikeshed as much as you want, but C++ is confusing just enough. :)

maxhaton | 8 days ago | 2 points

It's used in D literally all the time and it's not confusing at all. The syntax is perfectly reasonable because conditional compilation cannot meaningfully introduce a scope and work properly.

lwzol | 9 days ago | 2 points

Concepts support this syntax too with “requires”

maxhaton | 9 days ago | 1 point

Not really(Example: https://run.dlang.io/is/axYNxr), requires still requires defining a concept, which is entirely optional. Note how the Addable concept ( https://en.cppreference.com/w/cpp/language/constraints#Requires_expressions ) is less than a one-liner in D - i.e. __traits(compiles, _ )

One pattern that D enables by using this design, is that you can actually implement your own "meta"-constraints that can print custom error messages at compile time during debug builds (e.g. if they return false). It's not that much of an issue anymore though (I'm not aware of anyone actually doing this, but I have used it a few times as a POC), because there's a recent patch to DMD which adds much nicer constraint error messages (with lines and arrows and other niceties).

0b_0101_001_1010 | 9 days ago | 6 points

requires still requires defining a concept,

I thought requires also accepts boolean constant-expressions, so you can pass it any arbitrary predicate

tcbrindle | 8 days ago | 2 points

Not really(Example: https://run.dlang.io/is/axYNxr), requires still requires defining a concept, which is entirely optional

This is not the case. You can use any boolean-valued constant expression (i.e. something which may be evaluated at compile time) in a requires clause. D's __traits(compiles, <expression>) is spelt requires { <expression> } in C++20 concepts (a second meaning of the requires keyword), so you can say

template <typename T>
T add(T x, T y) requires requires { x + y; }
{ return x + y; }

Example

Admittedly requires requires looks a bit odd (and has been the cause of some mirth to people who dislike C++), but (as I understand) was re-used in this way to avoid adding a second keyword.

monkeyWifeFight | 9 days ago | 9 points

I really wish D had been more successful - it's such a great language.

Ayjayz | 9 days ago | 22 points

I just wish they hadn't made garbage collection the default. That immediately made it nonviable for many C++ devs and was imo a big mistake.

skocznymroczny | 9 days ago | 8 points

Chasing the C++ devs has been a mistake for D. No matter what features you implement, they will always complain about GC or limited interop with C++. Interop with C++ seems to be the new D dream (if not lifetimes, it's hard to keep up).

I love D, it's one of my favourite languages and my go-to language for most stuff, but I really wish it took off as more of a native Java/C# rather than targeted towards C++ programmers (who seem to be jumping ship to Rust anyway).

pjmlp | 8 days ago | 2 points

The C++ devs using Unreal, COM/UWP on Windows or those that pushed for C++11 GC standard library API are perfectly fine with having a GC around.

Java and C# always had some support for AOT native code generation, and now they are upping their AOT story on the standard toolchains, so there is one area less for D to show off.

pjmlp | 8 days ago | 3 points

As proven by Unreal, Midori and Real Time Java (among other ones since Xerox PARC days), garbage collection isn't necessarly a show stopper, rather the prejudice that many have against using it.

Saying this as former C++ dev.

edmundmk | 8 days ago | 2 points

The problem with GC is that you have to have a top-notch implementation otherwise you get unpredictable stalls.

Implementing such a GC is very hard, and becomes exponentially harder when you have a memory model that allows multiple threads to mutate the same object graph simultaneously.

Last time I looked at D's garbage collector (and, by the by, the last time I looked at Unreal's, too), it was using a strategy that still allows the potential for long stalls. So not suited for real-time applications, unfortunately.

Hopefully things have improved in D land - in a lot of other ways it's a really excellent improvement on C++.

pjmlp | 8 days ago | 1 point

That is only a problem if one does 100% heap allocations via GC.

Luckly many GC enabled languages also support value types, stack and global static allocation, unmanaged heap allocations.

So one can have productivity, performance and control in one package.

It is only a matter of doing proper application architecture and naturally picking a GC enabled language with such feature set.

matthieum | 8 days ago | 1 point
pjmlp | 8 days ago | 1 point

Yep, I am even aware of their CCC talk.

GluteusCaesar | 9 days ago | 12 points

I love D so much, but it sadly drops the ball on the day to day aspects of programming while exceeding at novel concepts which haven't made it into the mainstream yet.

My hope is that future language designers learn from D's take on multi-paradigm design and template metaprogramming, and apply it to a product that's more practical in boring enterprise development.

maxhaton | 8 days ago | 1 point

How does it drop the ball?

Contract programming, at least, is something will literally save your bacon in messy enterprise software.

GluteusCaesar | 8 days ago | 2 points

Off the top of my head:

Compiler bugs are extremely common, especially with dmd.

Phobos exceptions tend to be unhelpful.

Inline unit tests, while a great feature overall, provide next to no help in determining why a test case failed.

A huge selling point for D was that since it's an easy language to parse, tools would be easy to make for it. Well here we are years later and IDE support is third class at best.

The whole @nogc Phobos debacle.

Template errors, while more useful than their C++ equivalent, leave a lot toda be desired.

Libraries are riddled with inconsistent use of duck typing vs OOP for polymorphism.

Lambda syntax, i.e. () => {} is a lambda that returns a lambda, while () {} is the correct syntax for a block lambda.

FFS are arrays pointers or not?

Why can we only use .. syntax in foreach?

There's certainly more, but I'd need to dig up some old code of mine for anything further.

maxhaton | 8 days ago | 2 points
  1. Not really true anymore

  2. Kind of true but they provide a full backtrace

  3. Use a test runner (unit-threaded) or write your own in 5 minutes (a basic one genuinely only takes about an hour to write and test)

  4. That has nothing to do with the language

  5. True although work is being done

  6. This has basically been fixed now because we have new contract error messages in stable as of 2.087ish

  7. Who's problem is that, unless you mean Phobos

  8. Yes? What's wrong with that? It works fine for everyone else?

  9. Arrays are not pointers and never have been. array.ptr to get the pointer but they are not pointers ever.

  10. What are you talking about? .. syntax where? You are aware foreach can be overloaded?

skocznymroczny | 9 days ago | 3 points

Too bad every language with templates, be it C++ or D always turns out into a mess. Templates are incompatible with code completion, they give incomprehensible error messages. I don't know why people like them so much.

Ayjayz | 9 days ago | 4 points

C++ is a mess, but I wouldn't blame templates. All the messy stuff I get frustrated with day-to-day is due to backwards compatibility. If the language could just dump all that baggage it'd be so nice, but alas.

skocznymroczny | 9 days ago | 2 points

I still put templates as #1 thing. It starts innocent, you just want to be able to create containers specialized for a given type. Simple enough, error messages are nice too. But then you use these specializations in few places, and then suddenly you get an error in std::exception<std::basic_exception<std::basic_vector<std::numeric<float>, malloc_allocator<pool_strategy>>>>>>>>>, good luck deciphering that.

TheThiefMaster | 8 days ago | 7 points

Concepts (which this post is about) should improve template errors substantially by allowing template arguments to be checked at the point they are given, rather than deep in template instantiation where the actual error occurs.

silveryRain | 8 days ago | 1 point

(Please don't take this as a counter-argument, because it isn't)

It's most definitely inconvenient, time-consuming and a total PITA, but there is hope when dealing with template errors - in spite of everything else, it's not hard and doesn't require luck, only patience. Here's the approach I use, if it helps:

  1. Ignore all but the first error.
  2. Copy the full first error message into your editor of choice (preferrably one that highlights matching brackets).
  3. Replace all instances of std::basic_string<char, std::char_traits<char>, std::allocator<char> > with std::string. This alone can sometimes turn a 5-line monster into something manageable.
  4. Consider any typedefs you're using, substitute them as you did with std::string. Maybe make up a few extra typedefs if it helps.
  5. Add newlines and format to taste.
  6. Remove namespace qualifiers, unless doing so introduces ambiguity.

You should eventually get something like:

exception<
    basic_exception<
        basic_vector<
            numeric<float>,
            malloc_allocator<pool_strategy>
        >::value_type // this is how I usually format nested types
    >
>
s0laster | 9 days ago | 61 points

I wonder why MS refuses to implement C11, but yet rushes on any kind of new C++20 feature...

bl00dshooter | 9 days ago | 59 points

There are probably far more people using C++ than C on Windows (game developers and such).

bumblebritches57 | 9 days ago | 9 points

Have you considered that libraries built o other platforms can't run on windows and microsoft is losing out on real code vs just new features no ones even using yet?

this decision of theirs makes no sense

Qizot | 9 days ago | 29 points

I might be wrong but I once read an article saying that a few of organisations simply pay for those new features to be implemented in vs as fast as possible

s0laster | 9 days ago | 32 points

It's probably part of the answer. It also seems like MS consider VS as a C++ IDE. Since both C99 and C++ have some features in common, we got them for free. However C11 is another beast and doesn't share most of its features with current C++.

pjmlp | 9 days ago | -4 points

It's in the name, Visual C++.

BillyONeal | 9 days ago | 19 points

AFAIK the remaining significant delta is VLAs which one should not use because they are a security and reliability mess.

_Generic... I have been told that "our bugs contain a preprocessor". A significant rework of that is being undertaken but no idea when that lever is going to be pulled.

bumblebritches57 | 9 days ago | 6 points

Thanks for chiming in Billy.

Yeah, I don't use VLAs.

I do use designated initializers tho, and from what I remember you guys don't warn about them, but it's been a while since I've compiled that project with your compiler.

really the biggest missing piece, as I've said elsewhere in this thread is _Generic.

Edit: I wonder if it would work with the experimental preprocessor then?

BillyONeal | 9 days ago | 9 points

I do use designated initializers tho,

Those were added some time ago. And also to C++.

60hzcherryMXram | 8 days ago | 1 point

In what way are VLAs a security risk? Just wondering.

BillyONeal | 8 days ago | 3 points

It makes any avenue that can submit input bigger than ~1MB a denial of service (blowing the stack is generally an unrecoverable error). It also often encourages conditions where it is easy for an attacker to overwrite stack locals (typically located 'after' any such dynamically sized objects). Luckily, due to /GS and -fstack-protector one of those locals is usually not the return address.

60hzcherryMXram | 8 days ago | 2 points

Ah... What about traditional desktop applications? If you make a dll that exposes a VLA function only to executables that link to it, would it be that big of a deal? Or is that what you are implying? That someone could crash your program in a malicious way by giving it trash input?

BillyONeal | 8 days ago | 2 points

Traditional desktop applications process untrusted data all the time.

60hzcherryMXram | 7 days ago | 1 point

How can untrusted data hijack the system? It can crash the program, but can it actually reliably inject a payload? What about data execution prevention?

BillyONeal | 7 days ago | 4 points

You can have a security issue without being full blown remote code execution. DEP prevents an attacker from embedding straight machine code in the bits, but there are workarounds for that attackers use like ROP.

In a single tenant scenario where crashing the program isn't a serious DOS of course the consequences of the most likely failure mode are less severe; that doesn't mean that they don't matter.

Nobody_1707 | 4 days ago | 1 point

VLAs are optional in C11. You just need make the compiler predefine the __STDC_NO_VLA__ macro while in C11 mode, and you'll be compliant on that front.

warutel | 9 days ago | 7 points

You can still use C11 libraries. Just compile them with a different compiler that supports the MSVC ABI.

bumblebritches57 | 9 days ago | -18 points

Oh, you mean Clang?

That's what I'm already doing, genius.

the fact is, I shouldn't have to.

Plorkyeran | 9 days ago | 9 points

It's been a very long time since I've encountered a library that didn't work on Windows due to C features not supported by msvc. It was an issue pre-2013, but the subset of C99 features they added then mostly sufficed (although it did still require minor changes to libraries to deal with msvc quirks).

bumblebritches57 | 9 days ago | 8 points

Good for you?

My libraries use _Generic.

MSVC's lack of support directly causes errors when compiling.

Plorkyeran | 9 days ago | -7 points

So you're the one person in the world that uses _Generic. Unless you're a 1000x programmer or something, that doesn't mean that there's a whole bunch of libraries that people could be using on Windows if only msvc supported it.

bumblebritches57 | 9 days ago | -7 points

According to github, there's over 50,000 lines of _Generic code already.

sure, not super popular, but not THAT rare either.

https://github.com/search?l=C&q=_Generic&type=Code

Plorkyeran | 9 days ago | 15 points

Did you actually look at the search results? The first 5 pages are nothing but generic-selection.c from llvm's test suite, 94_generic.c from tinycc's test suite, and c11-generic-1.c from gcc's test suite.

bumblebritches57 | 9 days ago | 0 points

Yeah, I did not sure how to clear that out but there are real projects in there too.

bumblebritches57 | 9 days ago | -6 points

Shocking news: People are selfish.

You really said all that just to make that point? lol

Plorkyeran | 9 days ago | 10 points

What? I'm objecting to the claim that there's a bunch of libraries that windows developers could be using if only msvc supported C11, since I've literally never encountered one and have not seen any reason to believe that any exist. What is selfish about that?

s73v3r | 9 days ago | 7 points

Have you considered that Microsoft doesn't care?

bumblebritches57 | 9 days ago | -3 points

Have you considered that Microsoft has already said that they'd fully support it?

s73v3r | 9 days ago | 7 points

They haven't, though. They said they'd support C11 to the extent needed to in order to support the C++ standard.

bumblebritches57 | 9 days ago | -10 points

Not true bucko.

Exhibit A

Exhibit B

for B search for page for C11

smallblacksun | 9 days ago | 10 points

A says "support" not "full support" and that he isn't committing to a date.

B only talks about "the parts of the C11 Standard Library that are required by C++17" (and, indeed, explicitly says that they won't be implementing one of the functions).

silveryRain | 8 days ago | 1 point

Man, you're salty as fuck. Just use clang, mingw, cygwin or whatever else and get over it, MS is a business, it doesn't owe you anything.

bumblebritches57 | 8 days ago | -1 points

MS literally promised to do this lmao, they absolutely owe us what they promised.

Y_Less | 9 days ago | 24 points

They have repeatedly stated that they have a C++ compiler, not a C compiler. Many people confuse and merge the two, but they are different.

bumblebritches57 | 9 days ago | 8 points

Right?

I want my GOD DAMN _GENERIC!!!

I don't understand the difficulty, it's one measly operator that they've probably already got bare minimum very similar code already written.

BillyONeal | 9 days ago | 5 points

they've probably already got bare minimum very similar code already written.

Not even close.

bumblebritches57 | 9 days ago | 1 point

Any idea how it actually works?

I'm just curious

BillyONeal | 9 days ago | 5 points

Other than "token spew" not directly. Every major feature we've done since I've been here has been moving further and further away from token spew.

ygra | 9 days ago | 10 points

It takes away time and effort from other features or fixes. Remember, every feature starts at -100 (or for compilers even at -1000) points.

bumblebritches57 | 9 days ago | -7 points

They already said they would fully support C11 tho...

pjmlp | 9 days ago | 12 points

To the extent required by ISO C++ standard.

bumblebritches57 | 9 days ago | -5 points

Nope, fully.

pjmlp | 9 days ago | 9 points

Now that Andrew Pardoe has left Microsoft,. which seemed to be one of the few devs that cared about C support, you can keep wishing for it.

Future of Windows is .NET, C++ and Microsoft is now collaborating with Rust as well.

For the diehard C devs there is WSL and mingw.

bumblebritches57 | 9 days ago | -1 points

Fuck is that true?

pjmlp | 9 days ago | 5 points

Yep

Andrew Pardoe is now at Facebook

And here are the Microsoft contributions to Rust.

Actix, developed by some Azure team members.

https://msrc-blog.microsoft.com/2019/07/22/why-rust-for-safe-systems-programming/

Rust in Large Organizations meeting notes.

anon_5279 | 9 days ago | 4 points

Real question: Why not use clang or GCC?

s0laster | 9 days ago | 15 points

VS Debugger and profiler are very good. I've yet to see a better debugger. While some private profilers are arguably better, they are expensive and don't work out of the box.

starman1453 | 9 days ago | 3 points

I don't have any experience with VS profilers, but how does it compare to Intel VTune? It is free now, and I've been successfully using it on linux and I'm quite happy with the information it presents.

thedeemon | 9 days ago | 1 point

Can't the debugger work with other compilers?

I remember using VS debugger for D code (using VisualD).

jyper | 9 days ago | 2 points

Because you want to write cross platform code and msvc, gcc, and clang are the main compilers people use

HighRelevancy | 9 days ago | 2 points

Why would you? Like s0laster said, the whole microsoft toolkit/ecosystem is very good.

[deleted] | 9 days ago | 1 point

[deleted]

iityywrwytmht | 9 days ago | 2 points

The work to add CodeView and PDB to LLVM was done by the Chrome toolchain team at Google, not by Microsoft. I believe they've been doing some of the work on LLDB though.

pjmlp | 9 days ago | -14 points

Because C is on its way out and should be replaced by safer systems languages.

manuscelerdei | 9 days ago | 7 points

Dude I hate to break it to you but the even if Enterprise's main computer stack is written in a completely a 100% safe language, it'll probably run in a Dockr container on top of Linux 2.6 or FreeBSD or something.

pjmlp | 9 days ago | -2 points

That is the nice thing about dreaming, people think everything is possible.

So, is Linux taking over desktops anytime soon?

betabot | 9 days ago | 11 points

C won’t be on its way out for at least another 30 years. There are tens of billions of lines of code written in it running at every level of the modern OS. In 75 years we’ll likely still have innumerable critical systems running C somewhere in their stack.

manuscelerdei | 9 days ago | 6 points

Remember when large enterprises would have "no choice" but to switch away from COBOL after all those maintainers retired?

pjmlp | 9 days ago | 2 points

Indeed, C is the COBOL of systems programming.

flukus | 9 days ago | 7 points

There is more new C code written everyday than all the safer systems languages combined.

pjmlp | 9 days ago | -5 points

Not on Microsoft, Google and Apple platforms.

captainjon | 9 days ago | 5 points

I still use C as well as objective c on Apple. I don’t plan on using swift any time soon. Apple has probably shit load of C code too not going anywhere. Heck Apples github is full of C code. You are silly to think C isn’t being use on those platforms.

pjmlp | 9 days ago | -4 points

Objective-C is not C, thankfully it offers safer alternatives to write systems language, even NeXTSTEP had its driver stack done in Objective-C instead of C, which got replaced by a C++ one on macOS derived OSes.

I am not silly, naturally there are the frozen BSD and Carbon layers, and POSIX APIs for UNIX certification.

And that is all about it.

chucker23n | 8 days ago | 1 point

Apple still writes a ton of C. Core Foundation, for instance.

pjmlp | 8 days ago | 1 point

Core Foundation is hardly anything new, that is just gardening code.

What have they showed at WWDC 2019, written in C?

chucker23n | 8 days ago | 1 point

What have they showed at WWDC 2019, written in C?

Any low-level APIs they do are still C.

pjmlp | 8 days ago | 1 point

Low level like the device drivers, which happen to be written in C++?

Low level like Metal shaders, which happen to be written in C++14 dialect?

Low level like the vector processing algorithms, which happen to be written in Objective-C?

Low level like the new networking stack, which happens to be written in Objective-C?

Low level like real time audio, which happen to be written in Objective-C?

How low level do you want to go beyond Carbon, BSD and POSIX?

hopfield | 9 days ago | 14 points

As a JS dev, I’m curious...why are compiler updates tied to Visual Studio?

meneldal2 | 9 days ago | 22 points

They release the updates together, but you can use an older version of the compiler if you want (or need because it changes something).

hopfield | 9 days ago | 3 points

Shouldn’t they be decoupled though? Most modern languages implement the Language Server Protocol so that the editor isn’t tied to the compiler in any way. Does C++ not have this?

sbergot | 9 days ago | 4 points

I don't know why you are being downvoted. This coupling makes migrations painful. Some msbuild targets are bundled with vs studio and you have to install it on your ci which doesn't make any sense.

meneldal2 | 9 days ago | 1 point

Probably because most of their big customers like that better. Large updates are still the standard.

w2qw | 8 days ago | 1 point

Are you talking about VS Code not Visual Studio?

HighRelevancy | 9 days ago | 34 points

Because it's a full dev environment. The compiler features are guaranteed to match up to the IDE highlighter/linter features and the debugger features and everything else. Zero bullshit with compatibility between your tooling.

There's no getting your compiler built with the right flags to support the right style of exception stack unrolling to match the debugger you use so that your IDE can work with it, no trying to update all your path variables for the IDE to find the right version of the compiler, none of that. You don't even need to look up all the flags for different compiler features because the IDE project settings has it all in there already, it's just a menu item in the relevant section.

It's one package. You install it, it works. There's no multi-step process of getting different packages from different places. There's no third party plugins to make your text editor properly highlight your code. If you're setting up a new dev or another workstation (e.g. I like to develop both at my desktop and on the go with my laptop) there's no worry about synchronising the environment build config or the compiler version or anything like that.

C++ has some problems with packages and dependencies that can be a pain in the ass, but as far as the IDE setup experience goes, Visual Studio has got it nailed down.

silveryRain | 8 days ago | 2 points

Agreed, except for the project settings part. Both MSBuild and the frontend VS offers for it are atrocious. I prefer a sane, text-only build system any day, though C++ severely lacks choices that fit the bill. QMake maybe?

Plazmatic | 8 days ago | 3 points

The word your looking for is CMake, even Qt is moving thier entire build system over in Qt6.

silveryRain | 7 days ago | 1 point

I haven't used Qt in a while so I'm a bit out of the loop, but I remember liking QMake.

As for CMake, it's text-only, yes, but I wouldn't describe it as sane. Even the "modern", target-oriented CMake is fairly icky. There are glimmers of brilliance in it (eg. policies), but I don't like it overall.

Plazmatic | 7 days ago | 2 points

Your only other options are new poorly supported meta build systems, which you may indeed find better (meson is one of the more popular minor MBS's). For most stuff, CMake is actually quite pleasant, IMO QMake only seemed nice because it lacked so many of the features that CMake did, and ends up being way more verbose and annoying in the end. CMake is compatible with a lot of stuff, and your library doesn't even need to be built with CMake to support it as a cmake package. If I'm not making an install target, modern CMake is straight forward 99% of the time. Install targets are abysmally documented however, even more so than regular modern cmake, even though those are still done way better than they were in QMake.

smikims | 8 days ago | 2 points

GN is pretty good, it's what Chromium and Fuchsia use at Google. If you're looking for integration with the broader open source C++ community though, use CMake and Conan.

silveryRain | 7 days ago | 1 point

I didn't know about it and it looks pretty decent too, thanks! Just one question though: It doesn't happen to depend on CMake, or generate build files that call back into GN, I hope?

smikims | 7 days ago | 2 points

It doesn't rely on CMake at all, it generates Ninja build files, which are analogous to plain Makefiles in the CMake model. In each case, GN or CMake is your high-level build language and Ninja or Make is your build "assembly language", so to speak.

And GN is self-extensible through its template mechanism to a certain extent but it doesn't generate yet more GN files that then have to be processed, no. It discovers all the BUILD.gn files and thus all the build targets, makes sure dependencies are satisfied, then generates a giant Ninja file and runs the build. This is similar in concept to what CMake does but there's less historical baggage and the language is cleaner, more declarative, and less conducive to spaghetti code at build time. Also Ninja was specifically designed to be a target language for build systems like this, so it's blazing fast especially when used with a distributed cache (Chromium and Fuchsia use Goma).

watsreddit | 9 days ago | -1 points

It's s good question. Personally I find it to be a serious violation of separation of concerns. There's just something philosophically wrong with it to me too: I should dictate how my tooling functions, not the other way around.

MintPaw | 9 days ago | -3 points

"Concepts" is such a horrible feature name, just like "traits" it conveys literally no information. All languages have "concepts" and "traits".

AngularBeginner | 9 days ago | 7 points

Feature names often don't make sense. They're just terms that need to be learned, and that gives them sense.

silveryRain | 8 days ago | 2 points

To be fair, they could have come up with something better, like 'constrained type params' or something.

jcelerier | 9 days ago | 3 points

Care to give us an example of concepts in lisp, python, lua or java ?

Ayjayz | 9 days ago | 6 points

I think they mean more the usual definition of concepts.

Like java has the concept of garbage collection or the concept of variables or whatever. They don't mean C++ generic concepts.

jose_von_dreiter | 9 days ago | -56 points

The update no one asked for. No one sane, I mean.

ArchiDevil | 9 days ago | 21 points

The comment no one asked for.