Jump to content

Talk:Rust (programming language): Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
m Archiving 2 discussion(s) to Talk:Rust (programming language)/Archive 2) (bot
→‎Null pointers: new section
Line 113: Line 113:


: I added an example to showcase the if let statement, but a link to the cookbook could be added for further examples. (I haven't made a wiki account, sorry) <!-- Template:Unsigned IP --><small class="autosigned">—&nbsp;Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/92.21.33.45|92.21.33.45]] ([[User talk:92.21.33.45#top|talk]]) 12:53, 13 February 2022 (UTC)</small> <!--Autosigned by SineBot-->
: I added an example to showcase the if let statement, but a link to the cookbook could be added for further examples. (I haven't made a wiki account, sorry) <!-- Template:Unsigned IP --><small class="autosigned">—&nbsp;Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/92.21.33.45|92.21.33.45]] ([[User talk:92.21.33.45#top|talk]]) 12:53, 13 February 2022 (UTC)</small> <!--Autosigned by SineBot-->

== Null pointers ==

In the section Syntax, the article says *Rust has no null pointers[51] unless dereferencing a null pointer*. That doesn't make sense. How can you dereference a null pointer is there are no null pointers? [[Special:Contributions/62.216.5.216|62.216.5.216]] ([[User talk:62.216.5.216|talk]]) 12:50, 24 March 2022 (UTC)

Revision as of 12:50, 24 March 2022

Add WebAssembly as a target?

Should we add WASM as a listed target? I'm leaning towards no since it's only a "guaranteed to build" target and not a "guaranteed to work" target. 199.58.98.69 (talk) 03:47, 31 July 2019 (UTC)[reply]

I'm surprised that WebAssembly isn't included in the list of platforms in this article. Is WebAssembly not a "platform?" Jarble (talk) 16:11, 15 January 2021 (UTC)[reply]
The fact that, in your words, it is a "guaranteed to build" target makes me all for inclusion Scaledish! Talkish? Statish. 15:16, 25 May 2021 (UTC)[reply]
The "guaranteed to build" part just means that it does not have as much test coverage as `amd64` targets, there are other targets that are "guaranteed to build" that are already on that list. 0xDeadbeef (talk) 17:53, 26 December 2021 (UTC)[reply]

Please add a section about side effects in Rust

Please add a section about side effects in Rust. --VictorPorton (talk) 04:16, 7 August 2020 (UTC)[reply]

Such as? War (talk) 07:07, 7 August 2020 (UTC)[reply]
I believe he confused this article with the article on rust (on metal) Scaledish! Talkish? Statish. 01:43, 16 May 2021 (UTC)[reply]
Do you mean how Rust handles side effect, given that it is a functional programming languge? TimClicks (talk) 00:22, 5 January 2022 (UTC)[reply]

Variables assigned multiple times must be marked with the keyword mut

Isn't a mutable variable a tautology?

What is wrong with const x: int = 1; and let x: int = 1;? OttTheTormentor (talk) 21:21, 8 February 2021 (UTC)[reply]

No, mutable variable is not a tautology, it is an established word combination in computer science. Another established word combination which looks like a tautology is constant variable.
In Rust, every variable is constant by default (can be made mutable with mut). This is just how the language was defined. Anton.bersh (talk) 11:26, 18 April 2021 (UTC)[reply]

Inclusion of rust components as a part of the rust feature set

The following discussion is an archived record of a request for comment. Please do not modify it. No further edits should be made to this discussion.
A summary of the debate may be found at the bottom of the discussion.

A strong part of rust are the components. we have cargo, clippy, rustfmt, rust-docs and more. I would like to raise the question of if these components should be included in the rust wikipedia page

For

  • Many of these components are included in the rust source tree (not all)
  • A valid thing rust has going for it *is* this ecosystem, It is silly to ignore
  • I would argue cargo especially is a part of the core of rust - even if not needed.

Against

  • Components are managed by rustup. rustup is developed by rust, but is not "core" (ie a secondary project)
  • Technically, the rust lang is just the rustc component - nothing more is needed (ie the lang breaks without it) (although all the components help a lot!)
  • Not all components are developed in the core rust source tree

Solutions

  • Separate article for rust components
  • Inclusion under the features section
  • New category.

Discussion

What are your thoughts on this? Scaledish! Talkish? Statish. 01:40, 16 May 2021 (UTC)[reply]

Aren't module dependencies handled by cargo? If so, that seems like a compelling reason for including it. I weakly support including the entire ecosystem. Shmuel (Seymour J.) Metz Username:Chatul (talk) 03:48, 16 May 2021 (UTC)[reply]
This was what raised the question in the first place for me. I was alarmed to not discover any reference to cargo, and while researching with the intent to include it, I remembered all the other tools. Perhaps the best course of action would first be a study on how other dependency managers are handled in other articles. Upon a brief glance, here is what I discovered
Next, I looked at Java (programming language) and PHP but I could not find any official connection
I was thinking it was looking bad for the inclusion in this article, and that a new article was needed. Then I thought... Go (programming language), Go and rust are both modern langs, and alas we find Go (programming language)#Tools, very similar to rust components. In my mind, this is a triumph, however I am interested to see other's inputs Scaledish! Talkish? Statish. 15:47, 16 May 2021 (UTC)[reply]
Suggest including (invited by the bot) I don't have expertise here but if they are components of crust it's hard to imaging a reason to not include them. Can be brief if that is appropriate. North8000 (talk) 17:30, 16 May 2021 (UTC)[reply]
Conclusion: I think it is clear based on Go (programming language) what to do, however if someone has any objections to the inclusion I will hear them out and we can discus moving the new section. Until then, This RFC is closed. Thanks everyone for the input! Scaledish! Talkish? Statish. 18:58, 17 May 2021 (UTC)[reply]
The discussion above is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
@Scaledish: Please keep the section to a reasonable length. The entire components set or the Cargo file structure is too much. —Dexxor (talk) 04:56, 18 May 2021 (UTC)[reply]
I tried to remove the irrelevant components and will continue doing so as I write. Why do you consider the Cargo section too much, especially considering it is under a minimized by default drop-down? Thanks, Scaledish! Talkish? Statish. 13:09, 18 May 2021 (UTC)[reply]
Additionally, I would like to invite @Dexxor: and anyone else to suggest components to include/exclude from the article (Please see the todo list first!). (Unsure if the reply feature mentions, if not see above comment, thanks) Scaledish! Talkish? Statish. 13:33, 18 May 2021 (UTC)[reply]
 Done Scaledish! Talkish? Statish. 12:54, 9 June 2021 (UTC)[reply]

Rust is high-level

If the user who says Rust is not high-level wants to create an account and discuss here (or if anyone else wants to voice an opinion), please do. Caleb Stanford (talk) 01:58, 12 November 2021 (UTC)[reply]

@Caleb Stanford: I've removed the reference to Rust's "level" from the lede sentence entirely [1]. There's a lot of nuance to what's "high-level" and "low-level" colloquially, and I think adding such a label would just be confusing or controversial. Your edit here adds a better description anyway [2]. If we do add a line about whether Rust is low or high-level, I feel like there should be adequate secondary sources to support that outright. Elephanthunter (talk) 17:06, 23 November 2021 (UTC)[reply]
I think that's probably a good idea. Thanks for posting here about it. Caleb Stanford (talk) 19:33, 23 November 2021 (UTC)[reply]

Add a Controversy sub-section to Governance?

The rust moderation team seems to have publicly resigned en-masse. This is being further discussed on Reddit here, and is purportedly due to a lack of 'Core Team' oversight. This seems to be a sufficiently big deal to merit a mention, but of course hasn't been resolved yet. — Preceding unsigned comment added by TiredDoc (talkcontribs) 12:28, 23 November 2021 (UTC)[reply]

It's possible this should be included, but I'd wait for it to be covered by reliable independent sources (See: WP:RS). Elephanthunter (talk) 16:24, 23 November 2021 (UTC)[reply]
I think it should be covered in the article, but not sure how to cover it yet. One thing that these sort of statements ("en masse") overstate though is how many people it was, in this case, 3. Caleb Stanford (talk) 19:46, 23 November 2021 (UTC)[reply]
The current governance section is not informative enough for someone to "just" add a section about the recent controversies, since there is currently no information on the Rust teams structure and their relationship with the Rust Foundation at all.0xDeadbeef (talk) 18:08, 26 December 2021 (UTC)[reply]

Proposal: Rename "Syntax" section to "Examples"

It demonstrates more than just syntax, including the trait system and polymorphism. Is it okay to rename the section? If so, should I add an invisible anchor to avoid breaking existing section links? Llama Linguist (talk) 20:23, 3 January 2022 (UTC)[reply]

I think the bigger question is how to achieve a reasonable separation between this section (Syntax/Examples) and the Features section. Currently, the traits and polymorphism aspect overlaps considerably, and the features section also includes example code (under the macros section) so there isn't a meaningful distinction. It seems too much to provide a thorough overview of syntax features in both sections. What do you see as the difference between these two?
I briefly looked at what other language pages do. C++ makes the reasonable choices to include all of this in one big section called "Language" which includes both a list of features and accompanying code examples. Caleb Stanford (talk) 21:14, 3 January 2022 (UTC)[reply]
It's true that there's a decent amount of overlap that would be good to reduce. However, I like being able to see quick overviews of what languages look like before diving into the details of all their features. To me, C++'s big "Language" section feels a bit overwhelming as a reader. Llama Linguist (talk) 21:34, 3 January 2022 (UTC)[reply]
I added an example to showcase the if let statement, but a link to the cookbook could be added for further examples. (I haven't made a wiki account, sorry) — Preceding unsigned comment added by 92.21.33.45 (talk) 12:53, 13 February 2022 (UTC)[reply]

Null pointers

In the section Syntax, the article says *Rust has no null pointers[51] unless dereferencing a null pointer*. That doesn't make sense. How can you dereference a null pointer is there are no null pointers? 62.216.5.216 (talk) 12:50, 24 March 2022 (UTC)[reply]