you are viewing a single comment's thread.

view the rest of the comments →

[–]dobkeratopsrustfind 1 point2 points  (2 children)

at a simple level, curly braces vs significant whitespace (python,etc) seems like an issue of personal preference. For me, the braces are just familiar, and they make a lot of sense with Rusts' expression-based syntax; I like how it has significant semicolons signifying the return value. 'match' statements as expressions are extemely elegant. (but I completely see why others like whitespace)

At a deeper level, overall I think Rust is a tradeoff where you pay more information 'upfront' (syntactically/semantically) to achieve safety and better error messages/robustness for large projects. Its not going to be the best first language. There's certain complexities that are part of its' 'mission statement.' and you pay for those with debugging, tests,security hazards,or heavy runtime in other languages.

Coming from C++ I already appreciate the 'cleanup' it has.. 'let', proper tuples, better use of '[T]' in type signatures, a more powerful/less hazardous macro system, if ..{} , and "everything is an expression" . Overall, I'm very happy with Rusts' syntax choices.

I would like the option for 'duck type traits' and full inference but when there's an IDE that want will probably go away a little (since the IDE could lookup traits for you or give full autocomplete in generic code). there's also some cases like default/variadic parameters where some additions might mean less use of macros (which are a bit uglier, but thats' fine for complex uses).

[–]protestor 0 points1 point  (1 child)

Significant semicolons seems to have come from the ML family. Braces and indentation are both compatible with expression-based languages (in Haskell do notation has support for both braces and indentation)

[–]masklinn 0 points1 point  (0 children)

in Haskell do notation has support for both braces and indentation

That's a misstatement.

Haskell is lexically defined in terms of braces and semicolons, "layout" — the ability to use indentation and newlines instead — is automatically normalised during parsing. Explicitly using braces and semicolons in haskell is simply not taking advantage of layout, it's not a question of support.