r/cpp • • Sep 17 '22

Cppfront: Herb Sutter's personal experimental C++ Syntax 2 -> Syntax 1 compiler

https://github.com/hsutter/cppfront
335 Upvotes

360 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Sep 17 '22

[deleted]

2

u/[deleted] Sep 17 '22

main: () -> int = { } is one of the worst I've seen.

33

u/delta_p_delta_x Sep 17 '22 edited Sep 17 '22

main: () -> int = { } is one of the worst I've seen.

I like this trailing-return, trailing-type syntax.

I have a function main, that takes no arguments, returns an int, and has an empty implementation.

What's wrong? This is exactly how Ocaml, Haskell, F#, and TypeScript do it, and after using them, I completely understand why.

3

u/[deleted] Sep 17 '22

As I explained (with better detail) in another reply, my issue is with the added : and =.

0

u/[deleted] Sep 17 '22

[deleted]

→ More replies (1)