It improves immune system and geneal wellbeing. It is pain that you can get used to and I kind of enyoj it now in some weird way. It is hard, requires some dedication and brings some benefits, but does not requre extra time or planning. Great morale booster.
What are protental issues with compiler, by just disabling borrow checker? If I recall correctly some compiler optimisations for rust can not be done in C/C++ because of restrictions implied by borrow checker.
The crazy part about this is that (auto) vectorization in Rust looks something like this: iter.chunks(32).map(vectorized)
Where the vectorized function checks if the chunk has length 32, if yes run the algorithm, else run the algorithm.
The compiler knows that the chunk has a fixed size at compile time in the first block, which means it can now attempt to vectorize the algorithm with a SIMD size of 32. The else block handles the scalar case, where the chunk is smaller than 32.
The borrow checker does not deal with ownership, which is what rust’s memory management leverages. The borrow checker validates that borrows (references) are valid aka that they don’t outlive their sources and that exclusive borrows don’t overlap.
The borrow checker does not influence codegen at all.
It would be the same as in any language with manual memory management, you'd simply get a dangling pointer access. The 'move-by-default' semantics of Rust just makes this a lot trickier than in a 'copy-by-default' language though.
It's actually interesting to me that the Rust borrow checker can 'simply' be disabled (e.g. no language- or stdlib-features really depending on the borrow checker pass) - not that it's very useful in practice though.
"Math nerd explains how to spend 3 days proving 1+1=2" -> Original
"From Zero to QED: An informal introduction to formality with Lean 4"
https://news.ycombinator.com/item?id=46259343
Years ago I wrote c++ library for stream compostion. Something like C++20 ranges.
It turns out that as long as you compose everything with lambdas, compiled code is same as it would be with naive loops. Everything gets optimised.
For example, you can write sum of numbers less than n as:
Given that you die, when one vital organ dies it will eventaully hapen in this way or another. I read somwhere and that stuck in my brain, that maxmimal logevity for humans is estimated to be approximetly 125 years.
>> I read somwhere and that stuck in my brain, that maxmimal logevity for humans is estimated to be approximetly 125 years.
Oh, that's just derived from old theology.
Genesis 6:3, 'Then the LORD said, “My Spirit will not contend with humans forever, for they are mortal; their days will be a hundred and twenty years.”'
This kinda got spread throughout the zeitgeist long ago as a "maximal lifespan", but the reality is that only 3 in 10,000 even make it to 100. There's no hard cutoff, but functionally essentially no one gets to 110.
Scientifically, there's no hard reason we couldn't increase our lifespans indefinitely, but we've got a lot of work to do before we'll be able to get a reasonable number of people up to 125.
One thing that most languages are lacking is expressing lazy return values. -> await f1() + await f2() and to express this concurently requres manually handing of futures.
Buy it's kind of intractable, isn't it? Your language has to assume order dependency or independency and specify the other. Most seem to stick with lexical ordering implies execution order.
I think some use curly brace scoping to break up dependency. I want to say kotlin does something like this.
This is why they say async is a viral pattern but IMO that's because you're adding specificity and function coloring is necessary and good.
Why is having it be syntax necessary or beneficial?
One might say "Rust's existing feature set makes this possible already, why dedicate syntax where none is needed?"
(…and I think that's a reasonably pragmatic stance, too. Joins/selects are somewhat infrequent, the impediments that writing out a join puts on the program relatively light… what problem would be solved?
vs. `?`, which sugars a common thing that non-dedicated syntax can represent (a try! macro is sufficient to replace ?) but for which the burden on the coder is much higher, in terms of code readability & writability.)
I haven't linked a runtime but the specific feature, which alleviates manual handling of multiple futures when awaiting multiple futures concurrently, expressed in the language named Rust.
What I am most proud of is that I got the solution in the corse of apporx 1 week working on this!
reply