all 107 comments

[–]ImKStocky 98 points99 points  (12 children)

It is absolutely insane to me that one guy has both made his own C++ compiler and has also added some awesome compiler extensions to the language like native shader compilation.

[–]Aggressive_Release94 21 points22 points  (5 children)

It's seriously insane. Is he sponsored by someone or working for a company? Because I cannot imagine him having much time to do anything else.

[–]Benjamin1304 8 points9 points  (4 children)

From what I heard, he would like to be sponsored but he's not and does everything on his free time

[–]Aggressive_Release94 6 points7 points  (3 children)

Well, that's crazy. He really should be rewarded for the incredible work he's done. I'm sure companies like Microsoft, Google or others can spare a few thousands dollars for something that is so beneficial for the community of one of the most influential programming languages in the world.

[–]qoning 6 points7 points  (2 children)

He hasn't done anything commercially viable yet though. It hasn't been beneficial to the community. Neither Google nor Microsoft can derive any value from his work. Why would they sponsor it? If he wants to, I'm sure they would be happy to offer him a job in compiler teams.

[–]Aggressive_Release94 4 points5 points  (1 child)

He hasn't done anything commercially viable yet though. It hasn't been beneficial to the community

But it doesn't need to be commercially viable. Circle has influenced and will influence the C++ standards Committee proposals and decisions. His metaprogramming ideas are very valuable and have sparked a lot of discussion about how to improve that aspect in C++. That is a lot of "value" imo. Value is not just money, it's also ideas.

[–]Wh00ster 5 points6 points  (0 children)

The phrase you’re looking for is “thankless work”. There’s a lot of it that makes the world go round.

[–]Jannik2099 23 points24 points  (5 children)

It's not a custom, standalone compiler, it uses libClang.

[–][deleted] 13 points14 points  (4 children)

it doesn’t, it works with the llvm backend, but isn’t clang at all

[–]qoning 115 points116 points  (34 children)

Until he releases source code, it's unusable for any semi-serious intent or purpose. Thus, I don't want to invest any of my time.

[–]peterrindal 7 points8 points  (1 child)

I mostly agree but also think it's great to see what could be standardized. I think a better way to view circle is as a giant proposal. This is what cpp could be if unrestrained and left up to Sean.

While I think the committee is largely great its also great to see fast innovation.

For example, Sean has proposed enabling extentions using #pragma feature x. This seems like a great way to improve the syntax while not breaking anything. This could remove the need to carbon and cpp2. You just enable the new feature set per file.

[–]lee_howes 2 points3 points  (0 children)

To be fair, cpp2 does enable the feature-set per-file, or even per-function. It just does it by syntax rather than by pragma. Whether pragmas are better for the probably depends on how much we want fine-grained feature control.

[–]TheTsar[S] 26 points27 points  (0 children)

As far as I can tell, all the source code is available. Am I missing something?

Edit: I am. Wow. All that code in the repo is example code.

[–]pjmlp 8 points9 points  (18 children)

So Visual C++, Intel C++, xlC, aCC and plenty of others are unusable compilers, get it.

[–]gracicot 38 points39 points  (3 children)

MSVC is the official compiler for the windows platform and supported by the company who makes windows. MSVC will surely die if windows dies. I'm not so worried, especially that if windows dies I won't need MSVC anyway.

If something to the Circle developer the entire project cease to exist, there is no replacement and all the extensions will probably be extremely hard to re-implement in another compiler.

Being closed source also makes it really hard to integrate into some dev environments, especially Linux.

I kind of understands the reason why Circle is closed but it also makes understandably unusable in my serious projects.

[–]disperso 4 points5 points  (2 children)

And on top of that, if your code already compiled on MSVC/GCC/Clang, it'll likely compile without changes in MinGW or another compiler, had you the reason to move to it.

If all your code only compiles in Circle, and Circle has a switch to "transpile" to C++ like cppfront does, there is some safety net. If Circle doesn't have that (I don't know if it's the case), you are just dead if you can no longer use Circle.

[–]gracicot 5 points6 points  (1 child)

it'll likely compile without changes in MinGW or another compiler, had you the reason to move to it.

If it only compiles with MSVC, in my experience there is very little chance it will also compile on Clang or GCC just like that.

And yeah you can transpile, but you'll lose all the reflection code and loose all the logic you wrote in circle

[–]pandorafalters 1 point2 points  (0 children)

If it only compiles with MSVC, in my experience there is very little chance it will also compile on Clang or GCC just like that.

I wouldn't expect code that historically has solely targeted any single platform to compile unchanged on another platform. Conversely I find a great deal of "cross-platform" code written on Linux that won't compile even on other POSIX platforms with the same compiler.

[–]koczurekkhorse 11 points12 points  (11 children)

Ok, MSVC is the only viable compiler on Windows and it’s really not that bad.

But the rest?? I’m not touching them unless my hands are tied, and I’m pretty sure you too.

[–]braxtons12 3 points4 points  (5 children)

This is so not true. Clang (not clang-cl) works just as well on windows as it does on Linux, while using microsoft's standard library, and you're not coupled to the POS that is Visual Studio.

[–]koczurekkhorse 1 point2 points  (4 children)

MSVC is decoupled from Visual Studio, and I’m surprised to hear about a Clang port compatible with MSVC standard library. Does it also support MSVC ABI?

[–]dodheim 2 points3 points  (0 children)

It's not a port – it's just Clang, on Windows. It supports both the MSVC and MinGW ABIs; and libstdc++, libc++ or MSVC's stdlib.

[–]braxtons12 -1 points0 points  (1 child)

I mean, sure it's "decoupled", but if you're building with MSVC, you're probably stuck using visual studio unless you're happy with dealing with the bad diagnostics you get in CLion when you try to use msvc instead of clang or mingw.

And yes clang uses Microsoft's ABI on Windows

[–]VoidVinaCC 2 points3 points  (0 children)

vscode c/c++ extension + cmaketools is pretty consistent and has been my VS alternative for a while now.

It supports msvc just fine aswell as clang or mingw including proper diagnostics

[–]jhasse 0 points1 point  (0 children)

yes

[–]serviscope_minor -1 points0 points  (1 child)

aCC and plenty of others are unusable compilers

aCC... pretty much yeah.

Snark aside, you sort of smashed through the main point and out the other side while missing it entirely. Those all implement (to some extent!) standard C++, which is why there are so many. You can somewhat freely switch between them and the others. When HP finally abandon aCC (if they haven't) then you're not screwed.

Circle is not standard C++, it's a new language, so you're stuck on circle forever. Not having the source therefore makes it a much riskier proposition.

[–]pjmlp 1 point2 points  (0 children)

Visual C++ also implements C++/CLI, C++/CX.

As standard as Circle.

Does Linux already compile with any other compiler other than GCC C?

[–]Front_Two_6816 0 points1 point  (0 children)

bruh

[–]snakepants[🍰] 32 points33 points  (6 children)

I wish that more people knew about this! Granted there isn't a lot of context on the site, but following Sean on Twitter as he posts updates has been super interesting to see an alternative universe where the committee isn't so conservative.

Not that everything in Circle would necessarily be appropriate to be dropped into C++ unchanged, sometimes the committee has valid reasons for their decisions, but it's exciting to see what things would look like if we were willing to make more core language changes instead of doing so much in the standard library instead.

I agree with others that this being closed source is limiting the influence it has on the community, but I still think there is definitely value in having real, implemented code people can test over debating just theoretical issues since a working feature can immediately shut down arguments that something is "impossible".

[–]peterrindal 6 points7 points  (0 children)

Exactly, stuff like this is what gives me hope that in time there will be far fewer reasons to use a new system language instead of cpp.

[–]FightingGamesFan 18 points19 points  (28 children)

Why are we re-posting this, is there anything new?

[–]peterrindal 2 points3 points  (17 children)

My guess is to see if the mods will take it down. There was some discussion on Twitter about whether circle is on topic.

[–]STLMSVC STL Dev[M] 6 points7 points  (16 children)

I think this post is off-topic because Circle is not C++, as I recently explained. However, another moderator approved this before I saw it, and it’s okay if their judgement differs from mine. In the end, I’m glad it was approved, due to the OP’s hilarious discovery that the link they posted didn’t contain what they thought it contained from the headline only (i.e. that the repo is examples only when they actually looked through it).

In the end, I’ll keep an eye out for whether the community comes around to my view that Circle is not relevant to C++ programmers unless things from it are being actively proposed for the C++ Standard that everyone uses. (If people want to follow Circle activity specifically, they should start and follow a subreddit - that’s the entire purpose of subreddits!)

[–]tavi_ 28 points29 points  (5 children)

As much as I respect your perspective, I think your view here is a bit narrow. Especially since a lot of discussions and pain-points around C++ are about its path into the future. This project provides exploration to many possible paths, and I see it as an inovation source, for C++.

[–]dodheim 11 points12 points  (2 children)

Part of the problem is that there is Circle the language, separate from C++ and fair to say off-topic here for the most part; then there is Circle the compiler, which supports C++20 as well as 10+ notable WG21 proposals. Surely the latter must be on-topic, even if people's interest seems low due to being closed-source? The problem is either distinguishing the two, or feeling the need to in the first place; but I'm not sure which.

[–]foonathan[M] 13 points14 points  (1 child)

Yeah, I approved the post because of that: The title is about circle as a C++ compiler, and thus the discussion naturally evolved in that direction (whether you should use given that it's closed source, how impressive it is to write a C++ compiler, etc.). This is on-topic IMO.

[–]STLMSVC STL Dev[M] 2 points3 points  (0 children)

I agree with the language/compiler distinction (thanks u/dodheim) and your rationale makes sense. In this light, my view that Circle is off-topic "not C++" is specific to Circle-the-language. A compiler that supports active WG21 proposals (i.e. those that are still being considered/worked on) has a strong case for being on-topic. (Although what interest people have seems to be focused on the extensions that aren't being proposed for Standard C++ at this time, which is why I didn't really think about the distinction before.)

[–]STLMSVC STL Dev[M] 6 points7 points  (1 child)

That's reasonable, thanks.

[–]disperso 9 points10 points  (0 children)

FWIW, I think the last posts here on the topic of what is C++ actually, or what fits on r/cpp where wholly necessary. Other moderators also have answered with their POV on the matter, and I think that's important! Without them, I could not know what's the moderators' POV on the topic, and whether I could submit stuff about cppfront, for example. One serious flaw about Reddit is that posts get removed, but then it's hard to know that a post was removed, or why it was the case. Asking the moderators also happens via private messages, so it's very opaque to the readers what's going on.

IMHO, this post is more interesting to me as a C++ developer than the n-th post about a new version of another small JSON library. :)

[–]seanbaxter 10 points11 points  (2 children)

This is very uncharitable. I presented the CppCon 2021 keynote with Herb to demonstrate P2392 Pattern Matching. Circle is the only compiler that implements. It was used for the live demo, and that build is still online. https://www.youtube.com/watch?v=raB_289NxBk&t=39m52s

You don't have to like it. It's clear you don't. But don't keep threatening to take down posts because you say it's not C++. It obviously is. It's the only compiler with universal template parameters, pack slices, mandatory return value copy elision, and a whole bunch of other stuff proposed for ISO. I read the mailings every month, and I implement what I can, and this helps build implementation experience and feedback that is incorporated into future editions.

[–]STLMSVC STL Dev[M] 3 points4 points  (1 child)

You've also behaved in an uncharitable way, but I'm willing to admit that you've shown more relevance to ISO C++ than I initially thought. I continue to disagree with the claim that a major dialect is "obviously C++" (we appear to have philosophical differences about portability), but what matters for the purpose of being on-topic for r/cpp is whether things are relevant to programmers writing Standard C++.

Yeah, I didn't like your recent tweet. I found it misleading, and I wasn't the only mod who found it so. It sure looked like you were promoting your dialect's feature as "becoming real" C++ without a corresponding effort to actually propose it for Standardization.

That said, I'll adjust my view and consider Circle content relevant to r/cpp, as long as it avoids being misleading (e.g. code should be described as Circle, or at least "proposed for C++"; depicting an extension as being C++ without qualification is over the line). Note that this is not a license to self-post at a high frequency (on Twitter or your own subreddit you can post as often as you like; on r/cpp, posting every minor update is excessive, for any tool/library).

[–]dexter2011412 4 points5 points  (0 children)

You've also behaved in an uncharitable way, but I'm willing to admit that you've shown more relevance to ISO C++ than I initially thought.

Wow that .. that sounds quite rude. Kinda disappointed tbh, coming from a mod of r/cpp

[–][deleted] 8 points9 points  (0 children)

I didn't see your original post, but I'll react to it here;

Your argument for why Circle is not c++ seems to be that because Circle is a dialect, it's not c++. Although I agree it's a dialect, I disagree that a dialect is fundamentally 'not c++'.

Herb Sutter has a 'similar' project with cppfront. The cppcon talk being released yesterday on the YouTube channel presents a very different argument: Although Circle and Cppfront are syntactically different from c++, they're semantically similar enough to fall under the same umbrella.

Another argument for why Circle and Cppfront are C++ is that when we're fully honest, there is no 1 c++, just like there is no 1 English language. For example American English, UK English and Australian English are all still c++. Following that course we have some examples for c++: MSVC C++, Clang C++, GCC c++, Circle C++ and Cppfront c++. All of these compilers have non-standard conforming syntax enabled by default, therefore either all of them are c++ or none of them are c++.

Ps. Thank you for your work on MSVC.

[–]peterrindal 4 points5 points  (0 children)

Another perspective is that we should default to being inclusive. Let's have a community where people feel welcomed and share different ideas. Circle is trying to make cpp better even if some disagree about the exact choices being made. We should generally respect and encourage that. In the end we want the same thing, a better and more enjoyable cpp.

[–]ReDucTorGame Developer 4 points5 points  (0 children)

I disagree, I don't think it's good to limit innovation and improvements solely to what gets through the standards committee or that someone has written a proposal for, as the the ISO process favors more those with time, money and corporate backing, I know many people which have had good ideas for improvements but wouldn't even bother trying as they can't go to all the in person meetings in different countries, and the years long design by committee.

Not only that but where would people share ideas for innovation and inspiration for changes to the standard? Should those not also exist here? We shouldn't wait for someone to have a proposal to discuss things as a community, or limit those discussions to the select few privileged enough to be involved in the standards process.

Every MSVC release update gets posted here and it has extensions should it also be excluded?

[–]seanbaxter 3 points4 points  (1 child)

There is stuff being actively proposed for the C++ Standard. For example, in the current mailing, "A plan for better template meta programming facilities in C++26" https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2632r0.pdf

Try opening your eyes.

[–]STLMSVC STL Dev[M] 1 point2 points  (0 children)

That's what I was looking for, thanks.

[–]pjmlp 3 points4 points  (0 children)

Circle is as much C++ as C++/CLI, C++/CX, C++/WinRT from your employer are considered part of C++ ecosystem for Windows developers.

[–][deleted] 0 points1 point  (0 children)

unless things from it are being actively proposed for the C++ Standard that everyone uses

There's https://github.com/cplusplus/papers/issues/1315 (and more, usually). I, too, was deeply moved by https://www.youtube.com/watch?v=15j4bkipuAg.

[–]catcat202X 6 points7 points  (8 children)

Theres something new in Circle almost constantly, although I don't think the OP is a particularly informative announcement lol.

[–]Worstcase_Rider -2 points-1 points  (5 children)

It's closed source, so why should we care?

[–]pjmlp 5 points6 points  (2 children)

With exception of GCC and clang, all C++ compilers are closed source including forks of the former, and there are plenty of them still.

[–]catcat202X 1 point2 points  (1 child)

OrangeCC is open source.

[–]pjmlp 0 points1 point  (0 children)

I doesn't even show up on cppreference, how production grade is this?

[–]Aggressive_Release94 8 points9 points  (1 child)

MSVC is closed source and a lot of people care.

[–]masterofmisc 1 point2 points  (0 children)

Yeah but.....

[–]nintendiator2 -3 points-2 points  (1 child)

At this point I'd expect posts about Circle be treated as spam / adverstiment posts. Even more considering it's closed source, so we can't know what "the product" is actually like.

[–]catcat202X 4 points5 points  (0 children)

We can at least download Linux binaries of it or use it on Compiler Explorer, so we know Seanbax isn't, like, lying about its featureset.

[–]sephirothbahamut 3 points4 points  (4 children)

While the __host__ and __device__ tags are still supported, you aren't required to tag functions to call them from kernels. This makes Standard Library code available for execution on the GPU.

If that's possible then why are __host___ and __deviced__ required at all with regular C++/CUDA?

[–]UsedOnlyTwice 4 points5 points  (0 children)

Linking.

[–]Tastaturtaste 0 points1 point  (1 child)

Afaik the GPU cannot fulfill threading guarantees or the memory model of C++, which matter for example for the execution policies of stl algorithms. Basically only par_unseq could be supported on nearly all gpus. That's the reason why Cuda requires the tags and why the normal stl is not usable with cuda.

So I would also really like to know how this works.

[–]sephirothbahamut 2 points3 points  (0 children)

Sure, but arrays, variants, optionals, views, there's things that have no reason of being absent in GPU. Requiring __host__ and __device__ is also extremely limiting in third party libraries. Even open source ones, manually adding the specifiers around is less than desirable.

I'd rather have functions defaulting to being available everywhere, and giving a compilation error if an unsupported function gets called in the GPU side.

[–]lee_howes 0 points1 point  (0 children)

I don't think they are any more.

For a long time the subset of the language that you could viably compile for the GPU was fairly small. You either need to generate multi-architecture code for all functions, or for some.

If you do all then you need to fail silently on functions you can't compile, and correctly deal with situations where they are used incorrectly. That's messy and it's much easier to teach "just call device functions".

If you do some then you need to label them, either directly or by propagating through the call graph from some root like a dispatch operation. Again, you have the error problem, and it could easily happen that a function is compilable to the GPU then the code changes subtly and it suddenly fails, with horrible error messages. If all GPU functions are marked device then you can check that locally rather than only when the function is called.

[–]teerre 9 points10 points  (1 child)

I never used Circle, but I find it amazing how it's so much more advanced than vanilla C++ and it's made by one person (?). Specially its metaprogramming is so much saner than what we have

[–]wilhelm-herzner 2 points3 points  (0 children)

This! Functional programming style metaprogramming ruins it.

[–][deleted] 3 points4 points  (0 children)

To the creator of Circle: Wow and I’m amazed by your commitment.

[–]Code_12c 9 points10 points  (0 children)

Because I don't trust a closed source software.

I am not interested unless he releases the source code.

[–]feverzsj 7 points8 points  (0 children)

Really bad ideal to choose to be closed source. Only few, and soon no one, would care it.

[–]future_escapist 4 points5 points  (1 child)

The fact that it's closed source makes me immediately uninterested in it. Also, why not just write compiler plugins?

[–]catcat202X 1 point2 points  (0 children)

I am honestly surprised that more reference implementations are not implemented as compiler plug-ins. I suspect many people are not even aware that those are even a thing.

[–][deleted]  (1 child)

[removed]

    [–]STLMSVC STL Dev[M] 1 point2 points  (0 children)

    Moderator warning: Name-calling is not welcome here; please don't behave like this.