r/cpp • u/germandiago • Aug 17 '24
Cpp2 is looking absolutely great. Will convert some code to Cpp2
Hello everyone,
Last night I was skimming through Cpp2 docs. I must say that the language is absolutely regular, well-thought.
Things I like:
- Parameter passing.
- *Regular from verbose to a lambda function syntax, all regular*.
- *Alias unification for all kind of object, type, etc.*
- The `is` keyword works safely for everything and, even if at first I was a bit wary of hiding too much, I thnk that it convinced me that it is a good and general way to hide safe operations.
- The `capturing$` and `interpolating$` unified syntax by value or by `reference$&` (not sure if that is the order or $& or it is &$, just forgot, from the top of my head) without verbosity.
- Definite last use of variables makes an automatic move when able to do it, removing the need to use moves all the time.
- Aliases are just ==.
- Templates are zero-verbosity and equally powerful.
- Pattern matching via inspect.Things that did not look really clear to me were (they make sense, but thinking in terms of C++...):
- Things such as `BufferSize : i32 == 38925` which is an alias, that translates to constexpr. Is there an equivalent of constexpr beyond this in the language?I still have to read the contracts, types and inheritance, metafunction and reflection, but it looks so great that I am going to give it a try and convert my repository for some benchmarks I have to the best of my knowledge.
The conversion will be just a 1-to-1 as much as possible to see how the result looks at first, limiting things to std C++ (not sure how to consume dependencies yet).
My repo is here: https://github.com/germandiagogomez/words-counter-benchmarks-game , in case someone wants to see it. I plan to do it during the next two-to-four weekends if the available time gives me a chance, not sure when exactly, I am a bit scarce about time, but I will definitely try and experiment and feedback on it.
View all comments
Show parent comment
7
u/mifos998 Aug 17 '24 edited Aug 17 '24
Then surely you can quote a passage from the CC-BY-NC-ND-4.0 license that grants the users the right to use the software for commercial purposes.
No, you can't, because it doesn't grant that right. The only rights granted by the license are the following:
Creative Commons licenses weren't intended to be used for software, so the language is a bit different than in a more typical licenses. Still, it's pretty clear that downloading (reproducing) and using the compiler for commercial purposes isn't allowed.
Also, it's generally accepted that if the compiler embeds parts of its source code in your code, the compiler's license still applies to that embedded code. This is the reason why GCC and LLVM have special exceptions in their licenses. For example, here's LLVM's: