What does HackerNews think of cppfront?
A personal experimental C++ Syntax 2 -> Syntax 1 compiler
I've not looked at Circle in depth. Do you or anyone else have a perspective on how they compare?
> Cfront was the original compiler for C++ (then known as "C with Classes") from around 1983, which converted C++ to C; developed by Bjarne Stroustrup at AT&T Bell Labs. The preprocessor did not understand all of the language and much of the code was written via translations.
cppfront [2] aims to do the same for translating C++ to C++:
> Cppfront is an experimental compiler from a potential C++ 'syntax 2' (Cpp2) to today's 'syntax 1' (Cpp1), to learn some things, prove out some concepts, and share some ideas.
I think that may be the motivation for Sutter's work on cpp2.
I think its cppfront that is taking the approach of `:=` being a declaration with the type being inferred (ie shorthand for `: Type =`). Reading up on that has made me the most ok with applying this to functions (which I see coming up more these days) but I think i still prefer functions having a more distinct look as I process them differently when reading. Now, cppfront's approach to types I think is bonkers, making critical details hard to find except maybe through convention.
https://github.com/hsutter/cppfront
> <> for inequality is something SQL got right
Maybe I'm not recognizing the biases of my own learning background but this never reads right to me vs "not equal" / `!=`.
> - concise keywords like `fn`
In other discussions, it sounded like Graydon had an upper limit of 4 characters for keywords
https://www.reddit.com/r/rust/comments/13oemrg/question_abou...
For me, I had a "whoosh" moment for `fn` and always thought it a weird abbreviation, completely overlooking "fn" keys on laptops.
Herb Sutter's https://github.com/hsutter/cppfront could be a good strategy to clean it up.
If you want/need something today, Dlang is pretty good.
There are also a lot of other languages such Rust/Zig etc... which "somewhat" fit in the same niche as C++ but tend to have very different programming philosophy.
Edit : Can't believe i left out Dlang, the OG better/simpler c++
You're looking for Herb Sutter's CppFront: https://github.com/hsutter/cppfront
As Cfront was to C, Cppfront is to C++.
That problematic value is produced by multiplication (*), not addition (+). It happens because uint16_t is unsigned short, and all arithmetic must be promoted to at least rank int.
The easiest universal fix for proper signed/unsigned arithmetic promotion is: (0U + uint16_t(50000)) * uint16_t(50000). See https://stackoverflow.com/questions/39964651/is-masking-befo...
> And suddenly it turns out that all the “C++ killers”, even these which I wholeheartedly love and respect like Rust, Julia, and D, do not address the problem of the XXI century. They are still stuck in the XX.
You forgot to mention Carbon ( https://en.wikipedia.org/wiki/Carbon_(programming_language) ) and cppfront ( https://github.com/hsutter/cppfront ).
When asking why some people like Rust over C++, I think not enough weight is given here: Rust got to not worry about decades of legacy C stuff seeping in. If Rust isn't your jam -- and I get why it wouldn't be -- there are some initiatives starting now from within the C++ community to shed the C legacy with a new language that feels a lot more like modern C++. Herb Sutter's cppfront[0] and Carbon[1] are examples.
But I don't think it makes sense to dismiss this criticism just because the author happens to like Rust. These C idioms continue to be valid and reasonably widely used in C++.
[0]: https://github.com/hsutter/cppfront [1]: https://github.com/carbon-language/carbon-lang
I think cppfront[0] is the way to go if you want to write a safer language on top of C++, you can watch the talk about it here[1].
[0] https://github.com/hsutter/cppfront [1] https://www.youtube.com/watch?v=ELeZAKCN4tY
Doesn't matter, because it was made public Herb Sutter's presented his own language as solution to fix C++ at this year's CppCon,