News for hackers. Stuff that matters.
Re:Curl is C by naasking on Monday March 27, 2017 @12:03PM (#13968845)
> Rust has a quite unusual syntax compare to any other systems programming language.

In what way? It's very C-like in its basic syntactic structure, just more regular.

Re:Curl is C by mundanevoice on Tuesday March 28, 2017 @12:49AM (#13974164)
Well, I was not talking about basic syntactic structure. For eg: take a look at this https://github.com/servo/servo/blob/master/components/conste...

I am not against Rust. Rust has some great ideas and intent. I just feel they should have created simpler syntax. A more complex and unusual syntax doesn't have any real benefits IMO.

Re:Curl is C by naasking on Tuesday March 28, 2017 @12:00PM (#13977725)
You still haven't pointed out what syntax is problematic exactly. I've never programmed in Rust, but I don't have any trouble reading it coming from a C and C# background.

What exactly is the problem with the example you linked to?

Re:Curl is C by pcwalton on Tuesday March 28, 2017 @12:04PM (#13977760)
What's the issue with that example?
Re:Curl is C by naasking on Tuesday March 28, 2017 @12:50PM (#13978247)
Not having programmed in Rust, the fact that Rust requires all type parameters to be used, thus ruling out proper phantom types, was semantically surprising to me. But I don't understand what syntactic issue the other poster had with that example.
Re:Curl is C by steveklabnik on Tuesday March 28, 2017 @01:11PM (#13978429)
Re:Curl is C by naasking on Tuesday March 28, 2017 @01:46PM (#13978792)
Yes I get it, it just seems unnecessary to require every type parameter to be used. Do you have a link to the discussion motivating this choice?
Re:Curl is C by steveklabnik on Tuesday March 28, 2017 @02:17PM (#13979148)
In my understanding, it has to do with variance. This happened a very long time ago, before 1.0, and so I don't know where the discussion happened, off the top of my head.
Re:Curl is C by naasking on Tuesday March 28, 2017 @03:17PM (#13979724)
Found it: https://github.com/rust-lang/rfcs/blob/master/text/0738-vari...

It still seems bizarre to me that a purely type-level expression is forced by an effectively non-existent term. That RFC specifically states that the main problem is that the results of variance inference are largely erased by assuming invariance. That seems like a sensible default for unused type parameters too.

It seems from the conclusion of that post that PhantomData only survived because this was the smallest change they had to make to get this all to work better, and because some of this PhantomData could be used for other analyses in the compiler (although it's not clear if better type information could have replaced these uses anyway).