Someone on reddit said that the cpp2 repo was a bit old, and that is true, although he may have started this as an experiment influenced by typescript and left it on the side at some times. Anyway I have no idea if cpp2 would get support from microsoft or other devs, but cpp2 seems like the most humble and "least risky" solution for the future of C++, and I really want it to be. What I remember the most that Herb Sut…
> Anyway I have no idea if cpp2 would get support from microsoft or other devs… Doesn’t he work for Microsoft?
Overview: What are Cpp2 and cppfront? How do I get and build cppfront?
101–110 of 174 posts
Re: Overview: What are Cpp2 and cppfront? How do I get and build cppfront?
#102Is there any discussion or in-depth explanation of the syntax choices? I understand that a goal was context free unambiguous parsing. But there are some things that surprise me. For example, string interpolation: "Hello, (msg)$!\n" Why “(msg)$” and not “$(msg)”? Surely the latter is easier to parse?
https://github.com/hsutter/cppfront/wiki/Design-note:-Captur...
The priorities of a programming language syntax are to be readable first, consistent second.
When it comes to syntax that is used more frequently then the importance of readability increases, and the importance of consistency drops, because people will become familiar with the syntax through frequency of use, so there is no need for them to be guided by consistency. Yet they will be reading the code more often.
When it comes to syntax that is used infrequently then consistency is of more importance because you want users to be able to intuit the syntax. Since it will be infrequently used, the readability is of lesser impact.
Re: Overview: What are Cpp2 and cppfront? How do I get and build cppfront?
#103Re: Overview: What are Cpp2 and cppfront? How do I get and build cppfront?
#104I spent the other day writing an archetype entity component system which made heavy use of template metaprogramming. I try to avoid this if possible, but it was an exercise in seeing how performant I could make it, and so I wanted to offload as much work as I could manage to compile time and avoid things like virtual dispatch. API similar to the basic parts of entt. My take away from the exercise is that this is not…
Re: Overview: What are Cpp2 and cppfront? How do I get and build cppfront?
#105I spent the other day writing an archetype entity component system which made heavy use of template metaprogramming. I try to avoid this if possible, but it was an exercise in seeing how performant I could make it, and so I wanted to offload as much work as I could manage to compile time and avoid things like virtual dispatch. API similar to the basic parts of entt. My take away from the exercise is that this is not…
Are you sure the problem is the language itself, and not the inherent complexity of that kind of metaprogramming? As far as I'm aware, Lisp is the language with the cleanest support for such metaprogramming, yet metaprogramming-heavy Lisp code is still quite hard to read. I'm not aware of a programming language in which a compile-time ECS would be easy to write/read.
Re: Overview: What are Cpp2 and cppfront? How do I get and build cppfront?
#106Re: Overview: What are Cpp2 and cppfront? How do I get and build cppfront?
#107Someone on reddit said that the cpp2 repo was a bit old, and that is true, although he may have started this as an experiment influenced by typescript and left it on the side at some times. Anyway I have no idea if cpp2 would get support from microsoft or other devs, but cpp2 seems like the most humble and "least risky" solution for the future of C++, and I really want it to be. What I remember the most that Herb Sut…
> Anyway I have no idea if cpp2 would get support from microsoft or other devs, but cpp2 seems like the most humble and "least risky" solution for the future of C++, and I really want it to be. That ship has sailed. They already have C#.
Re: Overview: What are Cpp2 and cppfront? How do I get and build cppfront?
#108Unless I can step through original source code in debugger, watch variables etc. etc. I could not accept any source to source translator in my practice.
It is a good thing that cppfront lets you do that, then! Cppfront generates #line pragmas which tell the generated .cpp file which source lines to "blame" for each piece of generated code. This isn't something new and fancy for cppfront, it's a bog-standard pragma that your debugger already understands. So it will work the exact same as your current debugging workflow even if you mix cpp and cpp2 source files.
Re: Overview: What are Cpp2 and cppfront? How do I get and build cppfront?
#109Re: Overview: What are Cpp2 and cppfront? How do I get and build cppfront?
#110I know some of the arguments around C++/cpp2 are flawed, but I do love C++ and a project to move it forward with a step-change is exciting to me. A few of my friends and I did Advent of Code in cpp2 this year and it was a (very buggy) blast.
You mean buggy ironically because you were discovering cpp2, or because cpp2 itself was buggy?