News for hackers. Stuff that matters.
Re:Why did we choose Rust to develop TiKV? by luckydude on Wednesday September 27, 2017 @10:35AM (#15348162)
Yes, precisely. C, for the most part (function pointers are an exception) has a pleasant syntax. Go didn't like semicolons and other stuff that it found unneeded, but mostly took a lot of syntax from C so it's easy to read Go code even without understanding the language.

Rust kind of went in a different direction. Why? Understanding C syntax is pretty basic, there are a lot of C like languages. Why not be another one?

Personally, if every language was just a C variant I'd be happier. It would feel like "OK, I've got the basics down, let's go explore this dialect that added garbage collection and strings as real types" rather than "I want strings as real types, darn it, I need to go learn this Tcl language". That might be an extreme way to make my point, but I think it's clear, right?

Re:Why did we choose Rust to develop TiKV? by ufo on Wednesday September 27, 2017 @02:23PM (#15350726)
Other than its ubiquity, there are lots of bad thigns about C's syntax:

* Assignment as an expression is bug-prone

* The precedence for the binary operators is wonky

* Optional braces in if statements make the grammar ambiguous and is also bug prone (the infamous Apple goto bug)

* The type-declaration syntax is convoluted and people need tools like cdecl to understand the more tricky ones.

* The cast syntax is ambiguous and resolving this ambiguity relies on adding dirty hacks to the lexer to tell the parser about type names.

Re:Why did we choose Rust to develop TiKV? by p0nce on Thursday September 28, 2017 @05:25AM (#15355831)
> Assignment as an expression is bug-prone

Can be fixed without syntax change other than returning void.

> The precedence for the binary operators is wonky

But that's the precedence everyone is accustomed with. D enhance this by forbidding some non-parenthesized dangerous expressions.

> Optional braces in if statements make the grammar ambiguous and is also bug prone (the infamous Apple goto bug)

I've definately seen such bugs.

> The type-declaration syntax is convoluted and people need tools like cdecl to understand the more tricky ones.

This is fixed in languages that still feel C-like in syntax.

> The cast syntax is ambiguous and resolving this ambiguity relies on adding dirty hacks to the lexer to tell the parser about type names.

Yup.

Re:Why did we choose Rust to develop TiKV? by jjuel on Wednesday September 27, 2017 @10:41AM (#15348225)
What about the people that don't like the C style syntax? I think there is room for many different types of syntax. Just stick to the style of languages you like and ignore the ones you don't. Pretty simple.