Rust syntax: Difference between revisions

Content deleted Content added
No edit summary
Line 6:
 
== Basics ==
Although Rust syntax is heavily influenced by the syntaxes of C and C++, the syntax of Rust is far more distinct from [[C++ syntax]] than that of [[Java (programming language)|Java]] or [[C Sharp (programming language)|C#]], as those languages have more C-style declarations, primitive names, and keywords.
 
Below is a [["Hello, World!" program]] in Rust. The {{Rust|fn}} keyword denotes a [[Function (computer programming)|function]], and the {{Rust|println!}} [[Macro (computer science)|macro]] (see {{Section link|2=Macros|nopage=y}}) prints the message to [[standard output]].{{sfn|Klabnik|Nichols|2019|pp=5–6}} [[Statement (computer science)|Statements]] in Rust are separated by [[Semicolon#Programming|semicolons]].