<instructions>Your goal is to analyze the following comment and estimate how highly it will be upvoted by the Hacker News community.</instructions><comment><author>steveklabnik</author><text>Rust decided to spend very little budget on syntax. The issue though, is that where it took said syntax from is very wide.&lt;p&gt;&amp;amp; is used for references in a lot of languages.&lt;p&gt;() is a tuple, same syntax as Python&lt;p&gt;&amp;#x27;a isn&amp;#x27;t even novel: it was taken from OCaml, which uses it for generic types. Lifetimes are generic types in Rust, so even though it&amp;#x27;s not for an &lt;i&gt;identical&lt;/i&gt; thing, it&amp;#x27;s related enough to be similar.&lt;p&gt;_ to ignore a name for something has a long tradition in programming, sometimes purely as a style thing (like _identifier or __identifier), but sometimes supported by the language.&lt;p&gt;fn name(args) -&amp;gt; {} as function syntax is not SUPER unusual. The overall shape is normal, though the choice between &amp;quot;fn,&amp;quot; &amp;quot;fun,&amp;quot; &amp;quot;func,&amp;quot; or &amp;quot;function&amp;quot; varies between languages. The -&amp;gt; comes from languages like Haskell.&lt;p&gt;&amp;lt;&amp;gt; for generics is hotly debated, but certainly common among a variety of langauges.&lt;p&gt;the &amp;quot;static name: type = value;&amp;quot; (with let instead of static too) syntax is becoming increasingly normalized, thanks to how it plays with type inference, but has a long history before Rust.&lt;p&gt;So this leads to a very interesting thing, where like, it&amp;#x27;s not so much that Rust&amp;#x27;s syntax is entirely alien in the context of programming language syntax, but can feel that way unless you&amp;#x27;ve used a lot of things in various places. And that also doesn&amp;#x27;t necessarily mean that just because it&amp;#x27;s influenced from many places that this means it is coherent. I think it does pretty good, but also, I&amp;#x27;d refine some things if I were making a new language.</text><parent_chain><item><author>dgfitz</author><text>Thank you very much for spending time explaining this. It makes more sense with that kind of description. I&amp;#x27;m still not sure how long it would take someone like myself to be comfortable and proficient with the syntax.&lt;p&gt;I guess stated another way, I don&amp;#x27;t generally have issues reading code from a wide swath of languages. If someone plopped me in front of a rust codebase I&amp;#x27;d be at the mercy of the manual for quite a long time.&lt;p&gt;Thank you again, sincerely.</text></item><item><author>oneshtein</author><text>`&amp;amp;` is a reference.&lt;p&gt;`&amp;#x27;a` is a label for a memory area, like goto labels in C but for data. You can read it as (memory) pool A. Roughly, when function entered, memory pool is created, then destroyed at exit.&lt;p&gt;`&amp;#x27;static` is special label for static data (embedded constants).&lt;p&gt;`()` is nothing, like void in C.&lt;p&gt;`&amp;amp;()` is an reference to nothing (an address) like `void const *` in C.&lt;p&gt;`&amp;amp;&amp;amp;()` is an reference to reference to nothing, like `void const * const *` in C.&lt;p&gt;`&amp;amp; &amp;#x27;static &amp;amp; &amp;#x27;static ()` is like void `const * const *` to a built-in data in C.&lt;p&gt;`&amp;amp; &amp;#x27;a &amp;amp; &amp;#x27;b ()` tells compiler that second reference is stored in pool &amp;#x27;a, while data is stored in pool &amp;#x27;b. (First reference is in scope of current function.)&lt;p&gt;`_` is a special prefix for variables to instruct compiler to ignore warning about unused variable. Just `_` is a valid variable name too.&lt;p&gt;&lt;pre&gt;&lt;code&gt;  static UNIT: &amp;amp;&amp;#x27;static &amp;amp;&amp;#x27;static () = &amp;amp;&amp;amp;();

  fn foo&amp;lt;&amp;#x27;a, &amp;#x27;b, T&amp;gt;(_: &amp;amp;&amp;#x27;a &amp;amp;&amp;#x27;b (), v: &amp;amp;&amp;#x27;b T) -&amp;gt; &amp;amp;&amp;#x27;a T { v }
&lt;/code&gt;&lt;/pre&gt;
Let&amp;#x27;s say that `&amp;amp;&amp;#x27;a` is from a function `a()`, while `&amp;amp;&amp;#x27;b` is from a function `b()`, which called from the function `a()`.&lt;p&gt;The trick here is that we relabel reference from pool `&amp;#x27;b`, from an inner function, to pool `&amp;#x27;a` from outer function, so when program will exit from function `b()`, compiler will destroy memory pool `&amp;#x27;b`, but will keep reference to data inside until end of the function `a()`.&lt;p&gt;This should not be allowed.</text></item><item><author>dgfitz</author><text>Looking at the syntax in that bug report makes me think I could never learn rust.</text></item><item><author>dralley</author><text>Seems to rely on at least one known compiler bug (admittedly one open since 2015) &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;rust-lang&amp;#x2F;rust&amp;#x2F;issues&amp;#x2F;25860&quot;&gt;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;rust-lang&amp;#x2F;rust&amp;#x2F;issues&amp;#x2F;25860&lt;/a&gt;</text></item></parent_chain></comment><story><title>Cve-rs: Fast memory vulnerabilities, written in safe Rust</title><url>https://github.com/Speykious/cve-rs</url></story>
<instructions>Your goal is to analyze the following comment and estimate how highly it will be upvoted by the Hacker News community.</instructions><comment><author>jcranmer</author><text>To be fair, even for someone who is comfortable in Rust, the example is definitely on the rather confusing side of the language. (Not entirely surprising--it&amp;#x27;s a bug about a soundness hole in the language, which invariably tends to rely on overuse of less commonly used features in the language).&lt;p&gt;In particular, explicit use of lifetimes tends to be seen as somewhat more of a last resort, although the language requires it more frequently than I like. Furthermore, the soupiest of the syntax requires the use of multiple layers of indirection for references, which itself tends to be a bit of a code smell (just like how in C&amp;#x2F;C++, T * tends to be somewhat rare).</text><parent_chain><item><author>dgfitz</author><text>Thank you very much for spending time explaining this. It makes more sense with that kind of description. I&amp;#x27;m still not sure how long it would take someone like myself to be comfortable and proficient with the syntax.&lt;p&gt;I guess stated another way, I don&amp;#x27;t generally have issues reading code from a wide swath of languages. If someone plopped me in front of a rust codebase I&amp;#x27;d be at the mercy of the manual for quite a long time.&lt;p&gt;Thank you again, sincerely.</text></item><item><author>oneshtein</author><text>`&amp;amp;` is a reference.&lt;p&gt;`&amp;#x27;a` is a label for a memory area, like goto labels in C but for data. You can read it as (memory) pool A. Roughly, when function entered, memory pool is created, then destroyed at exit.&lt;p&gt;`&amp;#x27;static` is special label for static data (embedded constants).&lt;p&gt;`()` is nothing, like void in C.&lt;p&gt;`&amp;amp;()` is an reference to nothing (an address) like `void const *` in C.&lt;p&gt;`&amp;amp;&amp;amp;()` is an reference to reference to nothing, like `void const * const *` in C.&lt;p&gt;`&amp;amp; &amp;#x27;static &amp;amp; &amp;#x27;static ()` is like void `const * const *` to a built-in data in C.&lt;p&gt;`&amp;amp; &amp;#x27;a &amp;amp; &amp;#x27;b ()` tells compiler that second reference is stored in pool &amp;#x27;a, while data is stored in pool &amp;#x27;b. (First reference is in scope of current function.)&lt;p&gt;`_` is a special prefix for variables to instruct compiler to ignore warning about unused variable. Just `_` is a valid variable name too.&lt;p&gt;&lt;pre&gt;&lt;code&gt;  static UNIT: &amp;amp;&amp;#x27;static &amp;amp;&amp;#x27;static () = &amp;amp;&amp;amp;();

  fn foo&amp;lt;&amp;#x27;a, &amp;#x27;b, T&amp;gt;(_: &amp;amp;&amp;#x27;a &amp;amp;&amp;#x27;b (), v: &amp;amp;&amp;#x27;b T) -&amp;gt; &amp;amp;&amp;#x27;a T { v }
&lt;/code&gt;&lt;/pre&gt;
Let&amp;#x27;s say that `&amp;amp;&amp;#x27;a` is from a function `a()`, while `&amp;amp;&amp;#x27;b` is from a function `b()`, which called from the function `a()`.&lt;p&gt;The trick here is that we relabel reference from pool `&amp;#x27;b`, from an inner function, to pool `&amp;#x27;a` from outer function, so when program will exit from function `b()`, compiler will destroy memory pool `&amp;#x27;b`, but will keep reference to data inside until end of the function `a()`.&lt;p&gt;This should not be allowed.</text></item><item><author>dgfitz</author><text>Looking at the syntax in that bug report makes me think I could never learn rust.</text></item><item><author>dralley</author><text>Seems to rely on at least one known compiler bug (admittedly one open since 2015) &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;rust-lang&amp;#x2F;rust&amp;#x2F;issues&amp;#x2F;25860&quot;&gt;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;rust-lang&amp;#x2F;rust&amp;#x2F;issues&amp;#x2F;25860&lt;/a&gt;</text></item></parent_chain></comment><story><title>Cve-rs: Fast memory vulnerabilities, written in safe Rust</title><url>https://github.com/Speykious/cve-rs</url></story>