Talk:Rust (programming language)/Archive 5
From Wikipedia, the free encyclopedia
| This is an archive of past discussions about Rust (programming language). Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
| Archive 1 | ← | Archive 3 | Archive 4 | Archive 5 | Archive 6 | Archive 7 |
Clarification Needed
"Statements in Rust are separated by semicolons." "Separated" or "ends with" because there is a difference. Glancing at the code, it implies the latter. — Preceding unsigned comment added by 67.241.240.42 (talk) 13:20, 9 September 2024 (UTC)
- I agree the latter is closer to correct, and I am not sure the best terminology to use, but .. "its complicated", e.g.
fn main() { std::process::exit(1) }is valid. That fn doesnt return anything, so it isnt an "expression" in an implicit "return statement".fn main() { println!("foo") }is also valid, butfn main() { let foo = 10 }is not; it requires the addition of a ";". John Vandenberg (chat) 03:58, 10 September 2024 (UTC)- Well, no. Technically,
println!("foo")works as a trailing expression because it is an expression that has return type the unit type(), and themainfunction also implicitly gets that return type, so they are compatible. Forlet, it is a statement so it must end in a semicolon. 0xDeadbeef→∞ (talk to me) 09:06, 10 September 2024 (UTC)
- Well, no. Technically,
- Right. An accurate description of when `;` is required on the last statement is going to need to explain the unit/zero-tuple type, and that it is often implicit, which oddly I dont see mentioned in the article yet. Did I miss it? John Vandenberg (chat) 04:30, 11 September 2024 (UTC)
- Yeah, the unit type does need some explanation. 0xDeadbeef→∞ (talk to me) 03:45, 14 September 2024 (UTC)
- Right. An accurate description of when `;` is required on the last statement is going to need to explain the unit/zero-tuple type, and that it is often implicit, which oddly I dont see mentioned in the article yet. Did I miss it? John Vandenberg (chat) 04:30, 11 September 2024 (UTC)
Developer of Rust?
I wonder who the developer is technically. The Rust Team or Rust Foundation?
I have updated the `developer` field from "Rust Project" to "The Rust Team", since it is said "Maintained by the Rust Team." at the bottom of the official homepage. Charles Dong (talk) 12:10, 26 September 2024 (UTC)
Discussion of lifetime parameters
The discussion of lifetime parameters here is a bit opaque. Would it be possible for someone to expand it? We are given an example, but the syntax isn't unpacked (which precisely is the lifetime parameters, for example?) and it's not at all clear how the lifetime parameter is used in the example function. Does it enable some compiler analysis of the function that is not otherwise computable? If so, what are the results of that analysis, and what would happen if the function did not have a lifetime parameter? There is some discussion of the function as returning lifetime information, too. Once again, the syntax isn't really explained (is that return value a lifetime? It doesn't obviously look like one to a reader new to rust) and without an example, it's not clear what use the caller would make of a returned lifetime parameter. Maybe introduce a code snippet that shows how that return value is used?
I hope this is helpful feedback; if I knew enough to answer these questions, I would try to do this myself, but I'm afraid I don't. Rpgoldman (talk) 14:57, 29 October 2024 (UTC)
- Thanks for bringing this up. I took an initial stab at editing it! Let me know if it's clearer or if we can make further edits. Caleb Stanford (talk) 17:53, 29 October 2024 (UTC)
Pre-1.0 History
Secondary.. sources.. that are reliable.. It shouldn't be that hard to find sources covering development before 1.0, right? right?
cc @Caleb Stanford: Thanks a lot for stepping up to add content in the history section. The talk at Applicative 2016 is a good WP:PRIMARY source we can use. For even better verifiability, we should probably consider adding timestamps for specific claims. As for written sources on Rust's early history (and some extra stuff), I dug some of these with some searches:
- Mozilla releases Rust 0.1, the language that will eventually usurp Firefox's C++, Extremetech, 2012-01-24
- Samsung joins Mozilla's quest for Rust, CNET, 2013-04-03
- Samsung teams up with Mozilla to build browser engine for multicore machines, Ars Technica, 2013-04-03
- Samsung and Mozilla join forces to develop next-generation Android web browser, Extremetech, 2013-04-03
- Mozilla Imagines a Brave New Multi-Core Firefox With 'Servo', WIRED, 2013-04-05
- Mozilla-backed Rust language stabilizes at version 1.0, Ars Technica, 2015-05-16
- Rust 1.0, the programming language behind Mozilla's new Web engine Servo, is released, Extremetech, 2015-05-20
- Facebook is writing a Mercurial server in Rust. This is not a drill, The Register, 2016-10-18
The coverage on Rust itself is still quite limited. But I think that is okay. The technical details of the language before 1.0 wasn't of interest to the news people, nor the academia people, so we shouldn't cover it either. This is an encyclopedic article that is supposed to provide general information on the language, so extensively using a primary source to cover some technical history feels icky. I feel like we should just cut down the technical details (see also WP:NOTCHANGELOG) and make more general statements about the development. (that either directly comes from the talk source itself or comes from a secondary source) 0xDeadbeef→∞ (talk to me) 06:29, 1 November 2024 (UTC)
- Will spend some more time going at it if I get some free time this weekend.. before then, excuse my backseat commentary ^^' 0xDeadbeef→∞ (talk to me) 06:30, 1 November 2024 (UTC)
- Thanks! 😅 I totally agree with the sentiment. Some specific points below:
- > As for written sources on Rust's early history (and some extra stuff), I dug some of these with some searches:
- This is amazing and super helpful, thank you! Honestly during the writing of this I was... severely in want of more sources.
- > The technical details of the language before 1.0 wasn't of interest to the news people...
- Agree! I guess I should clarify:
- what I think is of general interest: (1) the non-technical details including how Rust came to be, how it was funded; (2) who was involved (major contributors and individuals) (3) why and how it grew in popularity (4) important conceptual changes over the years (like the removal of the garbage collector and function purity) that are relevant to Rust today and to its historical development. Many of these details were completely missing from the earlier draft (and much of it still incomplete! For example the article prior to now doesn't even name the core team or initial developers of the language post-Graydon years).
- what I think should be skipped: (5) syntactic changes or examples of old syntax; (6) changelog content (like first para. of Evolution, I left it bc it was previously drafted, but I actually think it should be condensed to maybe at most a sentence or two).
- > The talk at Applicative 2016 is a good WP:PRIMARY source we can use
- Are you absolutely sure that it's primary? Klabnik was not involved prior to 0.1 (first 2 subsections). I understood his view to be secondary on that basis. Of course, we should interpret the video as WP:PRIMARY post-involvement after he was added to the core team (which I am not sure of the exact date but we can dig it up).
- Would that also make Klabnik & Nichols primary? which could be...a bit of a serious issue, if that's really what you are contending and I'm not misunderstanding or mistaken.
- LMK what you think, I suspect we are close to a consensus here if we can agree on the status of Klabnik's involvement pre-0.1.
- Caleb Stanford (talk) 19:08, 1 November 2024 (UTC)
- P.S. Btw, why are we allowing all these mail.mozilla.org links but not GitHub source history? Because it's not archived? I'm not clear on the distinction. Thanks! Caleb Stanford (talk) 23:22, 1 November 2024 (UTC)
- We should be removing those. I was only removing one because I got a bit lazy.. Sorry! 0xDeadbeef→∞ (talk to me) 03:13, 2 November 2024 (UTC)
- Thanks! That makes much more sense :-) Caleb Stanford (talk) 17:50, 3 November 2024 (UTC) Agreed on WP:IS and reasoning below. Thanks for clarifying. Caleb Stanford (talk) 17:50, 3 November 2024 (UTC)
- We should be removing those. I was only removing one because I got a bit lazy.. Sorry! 0xDeadbeef→∞ (talk to me) 03:13, 2 November 2024 (UTC)
- I'm not completely sure. I think calling them (the talk and the book) secondary is fine, though there's also consideration of WP:IS. And maybe perhaps Klabnik is not considered a third-party, we could still consider the source as independent? Wikipedia:Party and person#Doesn't "third party" mean "independent"?
- As for which parts are general interest, I think parts of (4) might be debatable. For example, I think we can cite the fact that Samsung contributed to Rust 0.6 which added in ARM support based on some of the sources I listed, but the things about typestates and pure functions? Might not be necessary. 0xDeadbeef→∞ (talk to me) 03:37, 2 November 2024 (UTC)
- I'll argue for the inclusion of typestates and pure functions. About typestates, well, I don't personally care much at all about them but (per the sources I've read) lots of people talk about them as a major part of the language's history, they seemed to impact the conceptual design of Rust from the beginning. So while I personally don't care I'm not comfortable overriding the sources. Removing pure functions OTOH was (WP:OR warning) possibly the biggest mistake in the language's history. (end of WP:OR) As to the relevance it has to do with the claims about the relation to functional programming and the influence of functional programming on the language (which is of general interest) and which we discuss in several places. Caleb Stanford (talk) 18:01, 3 November 2024 (UTC)
- Are there reliable sources that talk about typestates as a major part of the language's history?
- I do understand why you consider removing pure functions an important event, but so far your reasoning probably doesn't fit the main way we deal with editorial decisions. If there are reliable sources that talk about the removal of pure functions as a key milestone, then great, let's write that into the article. If there are not, let's not be sad that it doesn't make it. 0xDeadbeef→∞ (talk to me) 09:16, 4 November 2024 (UTC)
- I'll argue for the inclusion of typestates and pure functions. About typestates, well, I don't personally care much at all about them but (per the sources I've read) lots of people talk about them as a major part of the language's history, they seemed to impact the conceptual design of Rust from the beginning. So while I personally don't care I'm not comfortable overriding the sources. Removing pure functions OTOH was (WP:OR warning) possibly the biggest mistake in the language's history. (end of WP:OR) As to the relevance it has to do with the claims about the relation to functional programming and the influence of functional programming on the language (which is of general interest) and which we discuss in several places. Caleb Stanford (talk) 18:01, 3 November 2024 (UTC)
- P.S. Btw, why are we allowing all these mail.mozilla.org links but not GitHub source history? Because it's not archived? I'm not clear on the distinction. Thanks! Caleb Stanford (talk) 23:22, 1 November 2024 (UTC)
- P.P.S. I've restored the RustConf 2022 source, but LMK if you disagree. I am also not clear on why we can't use a limited number of primary sources "to make straightforward, descriptive statements of facts that can be verified by any educated person with access to the primary source but without further, specialized knowledge" (WP:PRIMARY) which is exactly what I'm doing -- there's no interpretation going on here. Just trying to get our own facts straight. Whether you consider it of general interest is a separate question. Thanks! Caleb Stanford (talk) 23:50, 1 November 2024 (UTC)
- The RustConf 2022 source appears to only support the statement within the footnote, but not the main content (when the compiler successfully bootstrapped itself) 0xDeadbeef→∞ (talk to me) 03:17, 2 November 2024 (UTC)
- Ah you are right about that. I thought about it a bit and I think we should just remove the claim. But WP:ABOUTSELF does not apply here right @Sohom Datta:? Confused about the message (not the revert itself). That's a secondary source. Thanks! Caleb Stanford (talk) 17:52, 3 November 2024 (UTC)
- The RustConf 2022 source appears to only support the statement within the footnote, but not the main content (when the compiler successfully bootstrapped itself) 0xDeadbeef→∞ (talk to me) 03:17, 2 November 2024 (UTC)
Misleading claim
"Rust also uses a feature known as trait objects to accomplish dynamic dispatch (also known as duck typing)" I think this is highly misleading. Duck typing and dynamic dispatch are two different things. Duck typing is the principle that *at runtime*, an object `o` can be typed as `T`, if `o` implements all relevant methods of `T` (e.g. as Python does it). Dynamic dispatch does not do that; If I have two traits `T1` and `T2` with the same method signatures, I *still* can not dynamically use an `o:dyn T1` as a `dyn T2` - they are two fundamentally different types. Duck typing would allow for that.
(Please someone correct me if I'm wrong) 92.215.116.17 (talk) 15:35, 5 December 2024 (UTC)
- I'll take a look at this once I have a bit of time. Other editors, feel free to confirm and correct. (Also, IP, if you want to use italics or inline code, WP:WIKITEXT provides a great reference for how to do all these things with MediaWiki markup.) /home/gracen/ (yell at me here) 15:42, 5 December 2024 (UTC)
- The source is a little bit more precise about this: "This concept—of being concerned only with the messages a value responds to rather than the value’s concrete type—is similar to the concept of duck typing." I will take a stab at fixing the wording. FWIW I agree with your example of why they are different, OTOH I think this difference is rather immaterial. It's quite easy to create a
trait T3which provides the shared method signatures andimpl<T: T1> T3 for T,impl<T: T2> T3 for T. It would be accurate to say that overall Rust allows for duck typing with a bit more syntax to accomplish it and make the requirements explicit. Caleb Stanford (talk) 16:15, 5 December 2024 (UTC)- It's true that one can externalize the shared methods into a common super trait, yes. I still think the distinction matters though, especially if we consider wikipedia an educational resource. Using duck typing, I can turn a cat into a dog, if both are just animals that make_a_noise(). Using dynamic dispatch, a cat is a cat and remains a cat. I can consider it an animal, but I can never turn it into a dog ;) 92.215.116.17 (talk) 16:30, 5 December 2024 (UTC)
- Agreed! :) LMK if you think the latest edit is clearer. Caleb Stanford (talk) 16:40, 5 December 2024 (UTC)
- much better, yes :) Thank you 92.215.116.17 (talk) 16:42, 5 December 2024 (UTC)
- I made some more changes and added an explanatory footnote. What do you two think? /home/gracen/ (yell at me here) 16:57, 5 December 2024 (UTC)
- Good, probably even better to mention interfaces first: "Rust also uses a feature known as trait objects to accomplish dynamic dispatch, which is similar to Java's interfaces and can allow for similar program logic to duck typed languages like Python." It is also likely possible to condense and/or omit the footnote. Caleb Stanford (talk) 17:44, 5 December 2024 (UTC)
- I'm pretty busy at the moment, so feel free to go ahead and make these changes yourself :)
- /home/gracen/ (yell at me here) 17:53, 5 December 2024 (UTC)
- Good, probably even better to mention interfaces first: "Rust also uses a feature known as trait objects to accomplish dynamic dispatch, which is similar to Java's interfaces and can allow for similar program logic to duck typed languages like Python." It is also likely possible to condense and/or omit the footnote. Caleb Stanford (talk) 17:44, 5 December 2024 (UTC)
- I made some more changes and added an explanatory footnote. What do you two think? /home/gracen/ (yell at me here) 16:57, 5 December 2024 (UTC)
- much better, yes :) Thank you 92.215.116.17 (talk) 16:42, 5 December 2024 (UTC)
- Agreed! :) LMK if you think the latest edit is clearer. Caleb Stanford (talk) 16:40, 5 December 2024 (UTC)
- It's true that one can externalize the shared methods into a common super trait, yes. I still think the distinction matters though, especially if we consider wikipedia an educational resource. Using duck typing, I can turn a cat into a dog, if both are just animals that make_a_noise(). Using dynamic dispatch, a cat is a cat and remains a cat. I can consider it an animal, but I can never turn it into a dog ;) 92.215.116.17 (talk) 16:30, 5 December 2024 (UTC)
- @Caleb Stanford: After taking a look at what you wrote () and the surrounding text, I've decided to make significant changes to avoid WP:SYNTH (i.e. my reference to Java). I like your decision to remove the footnote, that definitely makes it more accessible to less experienced readers. What are your thoughts? /home/gracen/ (yell at me here) 21:40, 5 December 2024 (UTC)
- It does look like an improvement to me. Thanks! Caleb Stanford (talk) 17:35, 6 December 2024 (UTC)
First appeared in 2015?
Why does it say that Rust first appeared May 15, 2015 in the info box? As far as I can tell that's the date version 1.0 released, but I don't think it makes sense to say that's the day it first appeared - lots of software was written in Rust before 2015. For comparison, Go released version 1.0 in 2012, but the info box says it first appeared in 2009. Sheddow (talk) 18:58, 5 January 2025 (UTC)
- I think that's a good point! 0.1 is the first public release (January 2012), so I'll change it to that for now. I'm not sure what the general convention is here. Caleb Stanford (talk) 17:47, 7 January 2025 (UTC)
for loop typo
Is for value in 4..=10 a typo at the = character? If not, can it be explained better in the article or a simpler example used? Stepho talk 06:00, 20 December 2024 (UTC)
- It's not a typo. Should be clearer now, thank you for the suggestion. Caleb Stanford (talk) 17:49, 7 January 2025 (UTC)
Tuples
Info about tuples was in the article but after the primitive types table was turned into paragraphs, it disappeared. I think tuples are a very important feature that should be mentioned, but I couldn't fit it myself. Can one of the contributors try to fit it in somehow? Betseg (talk) 21:46, 15 February 2025 (UTC)
Might bring this to WP:FAC
I'm reading through this article and considering nominating it as a featured article (this would be my first nomination, so I'd likely be going through it with a mentor). I'm taking notes at User:Gracen/Notes/Rust (programming language) and any additions and feedback are welcome. I'll probably use this topic as a place for discussion before bringing it to WP:PR and WP:FAC after. Again, input is welcome! /home/gracen/ (they/them) 19:43, 5 February 2025 (UTC)
- @Caleb Stanford, @0xDeadbeef: apologies for the ping, but as the main authors of this article I'm curious what your thoughts are. /home/gracen/ (they/them) 21:39, 7 February 2025 (UTC)
- Thanks for initiating the discussion. Overall, I think this is a great idea & happy to help push this to submission! I looked at the list of changes you compiled so far and I think these would be great improvements. I don't personally have experience with WP:FAC either, so I am not sure I can judge whether it is ready but welcome the opportunity to improve the article further, perhaps 0xDeadbeef can advise better. Thanks! Caleb Stanford (talk) 23:15, 7 February 2025 (UTC)
- Thanks for leaving this message. Coincidentally, I have some spare time in my hands, so I will need to take some time to implement the changes that I have envisioned for this article.
- My top priority for this right now is improving the syntax and features section. Re:
Check with other programming language articles, a lot of this reads like a tutorial. It likely needs a complete rework
- This is probably the best article we have on a modern programming language. AFAIK this is the only programming language article that still has GA status. So no, trying to follow other languages' styles won't work for us. - But here's my initial thoughts on that comment: We're writing an encyclopedic entry for a programming language, so it makes sense that we are providing an overview of the language. It makes sense to use examples to illustrate parts of the language, although we need to nail down exactly what we cover, as the current version lacks certain details (where are closures?) and may have too much details in other cases. I'd like to hear your thoughts on this, but I don't think this needs a complete rewrite. It just needs some more careful reorganization. 0xDeadbeef→∞ (talk to me) 04:15, 8 February 2025 (UTC)
- I'll get back to this in more detail once I get to a keyboard rather than a phone, but I appreciate the thoughts! To be honest, the main reason I felt it was too close to a tutorial was the interjection of stuff like "this example uses a comment, this is what a comment does", but on second thought that was more than likely my experience with Rust showing and I'll read through it again later with a (hopefully) more reader-oriented perspective. I still think stuff like that could be reworded and improved, but you're right that a complete rework is very likely too far.
- Also (somewhat in response to the fact that this might be the only programming language GA), just wanted to point out that part of my reason for wanting to see this as FA is because I was disappointed to see that C (programming language) was a former FA, and it would be kinda neat to see my favorite language set as the gold standard for these kind of articles (and hopefully that would encourage more redevelopment of articles like C). /home/gracen/ (they/them) 10:26, 8 February 2025 (UTC)
- yeah. it will be hard. C was demoted from FA 19 years ago, and to set a new editorial standard for articles would be nice. 0xDeadbeef→∞ (talk to me) 12:24, 8 February 2025 (UTC)
- I usually take a wikibreak over the weekends, so apologies for the two day delay in response!First of all, after reading through the syntax and features section again, I'd like to reiterate that I completely agree that it is of encyclopedic value; I was completely off base with my initial claim that it needed a complete rework. I'm currently reading through more thoroughly and making a couple minor edits, leaving major edits for later on my notes page. I'll also read through the Rust book again and take some notes to see what's missing from this article.Secondly, I'm curious about your thoughts on my plans to expand the ecosystem section. Do you think it's necessary? Would you rather reduce it instead? I haven't gone source hunting yet, so I'm not sure whether or not there is actually more to include, but I just wanted a more experienced editor's thoughts. /home/gracen/ (they/them) 20:52, 10 February 2025 (UTC)
- Thanks for taking your time to reread this. I'm not completely sure we need a lot of expansion for the ecosystem section. If we do have sources for it then we can go ahead and expand it. I'm curious about what you'd suggest adding. 0xDeadbeef→∞ (talk to me) 08:18, 14 February 2025 (UTC)
Firstly, I'd like to apologize for the major delay; I came down with strep and in combination with other off-wiki stuff that made it hard to focus on editing. However, I'm feeling better now and I'd like to jump back into this!
I'd agree with you that the ecosystem section doesn't need significant expansion, it just feels to me like some sections could have maybe a couple sentences to a paragraph more information on the relevant tool. For instance, the section on Clippy only has 2 sentences, and one of them is just explaining what a linter is! I want to add a sentence or two more on exactly what sorts of lints it provides and maybe some Rust-specific features. I was also thinking of adding a bit more detail to rustfmt, giving an overview of its style and highlighting its opinionated nature.
I'm probably going to give the article one more thorough read-through before bringing it to peer review, so please let me know about any concerns you have. Sorry again for the delay, and thanks again for the advice! Gracen (they/them) 18:24, 5 March 2025 (UTC)
According to the 2024 survey conducted by the Rust survey team and published on the official blog, about 8.3% of Rust developers identify as lesbian, gay, bisexual, queer, or non-heterosexual (54.1% of 15.5%) and 5.5% as transgender (35.8% of 15.5%)
are you out of your mind? What's that got to do with a programming language??? 87.122.21.128 (talk) 10:09, 9 May 2025 (UTC)
- Those numbers are statistically meaningless. Are they lower or higher than the equivalent figures of the general population? Is the general population to compare them against mostly western or includes China, Africa and Russia? Is the link due to the nature of the language or the nature of the community? Is the community friendly due to the nature of the language or due to the nature of those that begun the project. Does the community actively encourage these type of people specifically or is it just a case of general friendliness? Stepho talk 10:49, 9 May 2025 (UTC)
- Right now this statistic is slightly borderlining on WP:OR, not because the percentage was calculated by hand (that wouldn't violate WP:V), but because I'd say using a primary source for this might not be really suitable.
- As someone with involvement in the community, Rust being welcoming to queer people is not news to me. But I think a small mention would be fine (another question, if we were to use those survey results, why leave out the percent of people that are neurodivergent?), since the MIT Technology Review article mentions it:
The community embraced it, and that, longtime Rust community members say, drew queer and trans coders to get involved in Rust in higher proportions than you’d find with other languages
. - cc @Caleb Stanford who added this sentence. I'm kind of leaning towards removing the demographic statistic unless some secondary source decides to analyze it. This could take a while, of course. One analysis of demographics I encountered in the wild was done on Linux kernel contributors in the book The Success of Open Source by Steven Weber.
- By the way, will someone please publish a journal article about programming communities and their intersection to minority social groups (e.g. neurodivergent, queer)? This seems like a gold mine of interesting and researchable stuff (perhaps the academia's economic model has not incentivized this kind of research yet) 0xDeadbeef→∞ (talk to me) 13:17, 9 May 2025 (UTC)
- +1 to @0xDeadbeef and I have removed the demographic data on that basis. I also rephrased the usage of the Nature article to be more in line with the source. Caleb Stanford (talk) 15:36, 9 May 2025 (UTC)