TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Rust 1.45

491 pointsby pietroalbinialmost 5 years ago

16 comments

sitkackalmost 5 years ago
&gt; Rust 1.45.0 adds the ability to invoke procedural macros in three new places!<p>Rust 1.45 will be the Rocket Release. It unblocks Rocket running on stable as tracked here <a href="https:&#x2F;&#x2F;github.com&#x2F;SergioBenitez&#x2F;Rocket&#x2F;issues&#x2F;19" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;SergioBenitez&#x2F;Rocket&#x2F;issues&#x2F;19</a><p>This is so excellent, and I love seeing long term, multiyear goals get completed. It isn&#x27;t just this release, but all the releases in between. The Rust team and community is amazing.
评论 #23866900 未加载
评论 #23865739 未加载
angrygoatalmost 5 years ago
This rather niche fixing of unsafe behaviour is excellent: <a href="https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2020&#x2F;07&#x2F;16&#x2F;Rust-1.45.0.html#fixing-unsoundness-in-casts" rel="nofollow">https:&#x2F;&#x2F;blog.rust-lang.org&#x2F;2020&#x2F;07&#x2F;16&#x2F;Rust-1.45.0.html#fixin...</a><p>I spent a few years as a scientific programmer and this is exactly the sort of thing that just bites you on the behind in C&#x2F;C++&#x2F;Fortran: the undefined behaviour can actually manifest as noise in your output, or just really hard to track down, intermittent problems. A big win to get rid of it.
评论 #23863269 未加载
评论 #23860278 未加载
评论 #23859557 未加载
评论 #23859749 未加载
评论 #23860467 未加载
评论 #23859504 未加载
评论 #23860062 未加载
评论 #23873472 未加载
fullstopalmost 5 years ago
I keep seeing more and more news about Rust, and figure that perhaps it is time that I learn something new.<p>99% of my development work these days is C with the target being Linux&#x2F;ARM with a small-ish memory model. Think 64 or 128MB of DDR. Does this fit within Rust&#x27;s world?<p>I&#x27;ve noticed that stripped binary sizes for a simple &quot;Hello, World!&quot; example are significantly larger with Rust. Is this just the way things are and the &quot;cost of protection&quot;? For reference, using rustc version 1.41.0, the stripped binary was 199KiB and the same thing in C (gcc 9.3) was 15KiB.
评论 #23860033 未加载
评论 #23860171 未加载
评论 #23859977 未加载
评论 #23860372 未加载
评论 #23860735 未加载
评论 #23860567 未加载
评论 #23860509 未加载
评论 #23867844 未加载
评论 #23861611 未加载
评论 #23879966 未加载
评论 #23860621 未加载
baseballdorkalmost 5 years ago
&gt; array[i] will check to make sure that array has at least i elements.<p>At least i+1 elements, right? Or am I getting caught up by one of the three hardest problems again?
评论 #23859483 未加载
评论 #23860881 未加载
评论 #23859657 未加载
traitalmost 5 years ago
<a href="https:&#x2F;&#x2F;github.com&#x2F;SergioBenitez&#x2F;Rocket" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;SergioBenitez&#x2F;Rocket</a> on stable rust finally!
评论 #23859379 未加载
评论 #23859930 未加载
评论 #23859361 未加载
评论 #23859340 未加载
评论 #23859328 未加载
评论 #23859856 未加载
p4bl0almost 5 years ago
By any chance if anyone is in the Paris area and is interested to teach Rust at university next year during the first semester. Please get in touch :).
评论 #23859919 未加载
评论 #23859616 未加载
评论 #23860219 未加载
snaltyalmost 5 years ago
I&#x27;m building an embedded project that currently runs a python script for automatic brightness. It takes a brightness value from a sensor over I2C, applies a function to get an appropriate LCD brightness value and then sends that to the display driver over a serial port. Would this be an appropriate project to write in Rust to learn the basics of this language?
评论 #23860124 未加载
评论 #23862361 未加载
评论 #23867243 未加载
评论 #23860177 未加载
cuddlybaconalmost 5 years ago
As someone who hasn&#x27;t used Rust, I am curious about why Rust has macros.<p>I use C++ at work, which admittedly isn&#x27;t the language I use most, and macros are used quite a bit in the code base. I find they just make the code harder to read, reason about, debug, and sometimes even write. I don&#x27;t see them really living up to their claimed value.<p>Is there something different about Rust&#x27;s macros that make them better?
评论 #23863589 未加载
评论 #23865608 未加载
评论 #23863610 未加载
评论 #23864235 未加载
评论 #23867094 未加载
adamnemecekalmost 5 years ago
If you have been on the fence about learning Rust, I encourage you to dive in. It is very productive.
评论 #23860609 未加载
rockmeamedeealmost 5 years ago
The post says<p><pre><code> The new API to cast in an unsafe manner is: let x: f32 = 1.0; let y: u8 = unsafe { x.to_int_unchecked() }; But as always, you should only use this method as a last resort. Just like with array access, the compiler can often optimize the checks away, making the safe and unsafe versions equivalent when the compiler can prove it. </code></pre> I believe for array access you can elide the bounds checking with an assert like<p><pre><code> assert!(len(arr) &lt;= 255) let mut sum = 0; for i in 0..255 { sum += arr[i];&#x2F;&#x2F;this access doesn&#x27;t emit bounds checks in the compiled code } </code></pre> I&#x27;m guessing it would work like this with casts?<p><pre><code> assert!(x &lt;= 255. &amp;&amp; x &gt;= 0); let y: u8 = x as u8; &#x2F;&#x2F; no check</code></pre>
评论 #23860757 未加载
评论 #23861140 未加载
pavehawk2007almost 5 years ago
Rust has come a LOOOOOONG way. I&#x27;m really impressed with what they&#x27;ve accomplished in just a short time.
devitalmost 5 years ago
Can we please deprecate the &quot;as&quot; operator?<p>Something so lossy and ill-conceived should not be a two-letter operator.
评论 #23863324 未加载
评论 #23867481 未加载
评论 #23868694 未加载
person_of_coloralmost 5 years ago
Any algo-trading backtest frameworks in Rust?
评论 #23862321 未加载
评论 #23860099 未加载
cjhanksalmost 5 years ago
Doesn&#x27;t this mean that a conditional branch is added to all existing code which performs casting?
评论 #23860616 未加载
kgravesalmost 5 years ago
this is extremely exciting, a truly wonderful release.<p>well done rust team
FartyMcFarteralmost 5 years ago
&gt; Just like with array access, the compiler can often optimize the checks away, making the safe and unsafe versions equivalent when the compiler can prove it.<p>Can it &quot;often&quot; solve the halting problem as well?<p>The hope that this kind of optimization will happen sounds a bit fanciful for any non-trivial part of a program.
评论 #23861355 未加载