News for hackers. Stuff that matters.
Re:Circle Evolves C++ [video] by gavinray on Wednesday August 16, 2023 @08:08AM (#37145795)
Circle is the "C++ Successor" language I am most excited about, after writing a fair amount of D, and trying the Carbon interpreter.

The issue with D is that while it's a great language, and it has C++ interop, it doesn't have _direct_ C++ interop. As in, "just import an existing header and it works." You have to write or try to auto-generate "extern C++" definitions.

The issue with Carbon is that it is slowly-progressing vaporware at this point with as-yet-untested C++ interop.

Circle is real, has a "Carbon" mode that makes it syntactically identical, and yet has "just import it" interop. It's not open-source yet but hey, you can't have everything at once I guess.

---

(I want to add that I think D is a great language in it's own right, just not as "C++ successor")

Re:Circle Evolves C++ [video] by pjmlp on Wednesday August 16, 2023 @08:27AM (#37146021)
For me, it is the only one that deserves "TypeScript for C++" nickname, given its evolution approach.
Re:Circle Evolves C++ [video] by geertj on Wednesday August 16, 2023 @11:12AM (#37148314)
I had the same vibes with Herb Sutter's cppfront. It offers full source compatibility by introducing a new syntax that can be mixed freely with the traditional syntax. Seems like it's actively being worked on here https://github.com/hsutter/cppfront.

I've not looked at Circle in depth. Do you or anyone else have a perspective on how they compare?

Re:Circle Evolves C++ [video] by mokash on Wednesday August 16, 2023 @11:30AM (#37148624)
i believe cppfront is more of a way to try out and demonstrate ideas in the hopes that they are adopted by the cpp standard
Re:Circle Evolves C++ [video] by geertj on Wednesday August 16, 2023 @12:35PM (#37149630)
Not really the way I understand it.

While Herb uses modest language when describing his project, my take is that this modesty is based on the realization it's a huge effort and that it might fail, but does not indicate lack of ambition. If anything, I think this is really ambitious. The work is the standards committee provides the necessary infrastructure to make this feasible in the first place. On his Github he lists the changes that went into C++ over the last years that enable this prototype.

It's pretty clever really, and dare I say, something that looks feasible. This essentially creates a new syntax bubble inside the language where there are different defaults, and then transpiles those bubbles to regular C++ (the rest is copied verbatim). See this https://godbolt.org/z/nPPMYM3Yj for example on how array accesses are transpiled to do bounds checking.