Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up'var' as alias for 'let mut' #2304
Comments
Centril
added
the
T-lang
label
Jan 18, 2018
This comment has been minimized.
This comment has been minimized.
|
Personally, I think that since we use
Adding I could however see and support a bare |
This comment has been minimized.
This comment has been minimized.
|
Note that function arguments, |
This comment has been minimized.
This comment has been minimized.
|
Also "variable" doesn't mean "mutable", it means "the value may vary with each execution". |
This comment has been minimized.
This comment has been minimized.
aepsil0n
commented
Jan 19, 2018
|
This is a bit of a false analogy, as |
This comment has been minimized.
This comment has been minimized.
whataloadofwhat
commented
Jan 20, 2018
|
This may be unrelated but it would be nice if I haven't really thought about the implications of such a thing, just throwing it out there. |
This comment has been minimized.
This comment has been minimized.
burdges
commented
Jan 20, 2018
|
It works, so does |
This comment has been minimized.
This comment has been minimized.
|
@whataloadofwhat you don’t want to mix external with internal mutability. |
This comment has been minimized.
This comment has been minimized.
|
With the |
This comment has been minimized.
This comment has been minimized.
|
I'm of the opinion of others here that |
This comment has been minimized.
This comment has been minimized.
|
Also, Don't think this is a good idea based on what others have already said. |
This comment has been minimized.
This comment has been minimized.
|
I agree with @mgattozzi in that I don't think the additional keyword would pull its own weight, and it would do more harm than good. Rust is already essentially totally different than JavaScript, so introducing an extra keyword would hardly help. |
This comment has been minimized.
This comment has been minimized.
|
This is a very weird argument: IMHO, you should not use |
This comment has been minimized.
This comment has been minimized.
|
Previous discussion: rust-lang/rust#2643 |
This comment has been minimized.
This comment has been minimized.
|
@killercup Indeed, It will still be supported indefinitely (for backwards compatibility), but the JavaScript community consensus is that As for this topic... I completely agree that we should try to help out JavaScript programmers, I think Rust has great potential for being a first-class citizen on the web. I want Rust to succeed not just on the desktop and server, but also in web apps, Chrome / Firefox extensions, iOS, Android, etc. I applaud @pannous for their good intentions. However, adding in
Therefore, because of all those reasons, I think adding in I say all of that despite the fact that JavaScript is the first language I learned, and I've been programming in JavaScript for over 11 years. I am a JavaScript to Rust convert, and I think Rust having If we want to convert JavaScript programmers to Rust (and I think we do want that), then I think the best way is to create some well-made tutorials explaining the differences between JavaScript and Rust, helping JavaScript programmers understand tricky Rust concepts (such as memory and borrowing), and also explaining why Rust does things the way that it does. In other words, a tutorial carefully designed for JavaScript programmers, explaining things from the perspective of JavaScript programmers. |
This comment has been minimized.
This comment has been minimized.
|
based on eloquent consensus this chapter is hereby closed |
pannous commentedJan 18, 2018
•
edited
Now that rust compiles to wasm it would be nice to play to the Web community.
Thus a shortcut
for
would not only safe four keystrokes in each instance but also be nicer on the eyes and easier to grasp for newcomers. var for 'variable' already entails the concept of 'mutability', so it is a fit name.