
Announcing Rust 1.24.1 - steveklabnik
https://blog.rust-lang.org/2018/03/01/Rust-1.24.1.html
======
mkj
In case anyone else was wondering how longjmp() over the Rust code isn't a
problem regardless:

"There are only Copy types on the rust stack frame being jumped over."

[https://github.com/rust-lang/rust/issues/48251](https://github.com/rust-
lang/rust/issues/48251)

~~~
stmw
neat!

------
Freak_NL
> Cargo couldn’t fetch the index from crates.io if you were using an older
> Windows without having applied security fixes.

Why are developers (since this is an issue that shows up with cargo) running
Windows 7 without security patches installed? Especially since the issue only
shows up on Windows 7 installs that haven't received security patches since
June 2016.

> libgit2 created a fix, using the WinHTTP API to request TLS 1.2. On master,
> we’ve updated to fix this, but for 1.24.1 stable, we’re issuing a warning,
> suggesting that they upgrade their Windows version.

That's really a neat and responsible way of handling this.

~~~
mtgx
Although developers should know and do better, I think a big part of why they
aren't doing it is because Microsoft has made it so hard to update Windows 7
since a year or two ago, all in the name of forcing people to switch to
Windows 10.

You now have to visit and _manually_ download the updates from Microsoft's
Update Catalog website. Oh, and that website only works on Internet Explorer.

~~~
Arnavion
No idea what you mean. Windows 7 receives updates from Microsoft through
Windows Update just fine.

------
HumanDrivenDev
Rust gives me a headache. I want to like it, but it just seems so...
overengineered

[https://doc.rust-
lang.org/std/str/struct.SplitWhitespace.htm...](https://doc.rust-
lang.org/std/str/struct.SplitWhitespace.html)

Why would you create a special data type to represent a string split by
Whitespace? Lunacy

~~~
devit
Because unlike most other programming languages, Rust is well-engineered and
seeks to both provide the most general abstractions possible and to make the
code generated by them as efficient as possible.

In particular, for this task, this requires to:

1\. Return references to subranges of the original string, rather than copying
them, so that no copy happens if you only need to examine the component
instead of storing it

2\. Not use reference counting to do so, but rather statically checked
references with lifetimes, to avoid unnecessary instructions to update the
reference count and lack of a static finalization point

3\. Provide a way to get components one by one, so that if you only need e.g.
the first two, time is not wasted to split the whole string

4\. Provide that through a generic Iterator trait, so that it may be passed to
generic methods (like one that collects the result into a vector)

5\. Dispatch that generic trait statically rather than using an indirect call
as that would destroy performance

6\. Make the state manipulated by such an interface into a first-class object,
and allow to put them in a data structure (like an array) while still doing
static dispatch, so that you can, for instance, split multiple strings into
components and interleave them without ever making an indirect call.

The combination of these essential requirements results in the creation of the
SplitWhitespace<'a> data type, which represents the state of a parser
splitting a string into 'a-lifetime references to whitespace-separated its
components one by one, implementing the Iterator trait, and usable in a data
structure.

~~~
varjag
The better half of those points are directly and indirectly caused by
insistence on manual memory management. Yes, it was a major design point of
Rust, but it doesn't make it better engineered than "most other languages".
It's just the corner it painted itself to.

~~~
maxaf
Firstly, manual memory management is what happens when a C programmer must
manually place malloc/free calls within her program. Rust doesn't require any
of that; the compiler determines the right times to allocate and free memory,
while requiring the programmer to follow certain design rules in exchange for
the convenience.

Second, you're making it sound as if the position Rust (and those who program
in it) is somehow undesirable. This state of things is the consequence of an
explicit design goal, which was to accomplish automatic memory management
without runtime cost.

~~~
varjag
Interesting; I certainly wouldn't consider C++ constructor/destructor like
semantics and manual tracking of object ownership in the code as automatic
memory management. But regardless, the point stands.

And yes it's a consequence of a design goal, I said as much. The outcome
however isn't beautiful enough to feel smug about the rest of programming
languages.

~~~
mathw
Rust doesn't have C++ constructor/destructor semantics. It doesn't require
manual tracking of object ownership. You just have to say when you're passing
ownership and when you aren't, and the compiler takes care of the rest.

It's automatic memory management without runtime accounting or a garbage
collector, which means Rust doesn't need a runtime at all.

~~~
varjag
> It doesn't require manual tracking of object ownership. You just have to say
> when you're passing ownership and when you aren't […]

Call it whatever you want, but there are languages where you don't have to
"pass ownership" manually for every frigging thing.

~~~
iknowstuff
And you won't see them being used for systems programming because of their
overhead. So without Rust, we'll be stuck with stupid, avoidable security
vulnerabilities at the base of all our software, forever. On top of that,
Rust's ownership system also prevents data races and none of those other
languages are capable of that.

~~~
creatornator
I'd say Java, a GC'ed language, is used for systems programming quite often.

------
GolDDranks
This is an interesting demonstration how fiddly and UB-happy FFI boundaries
can be... Fortunately the UB → abort change will land in the future, it will
be for the better.

------
_binder
One command to update the language...wow...ok Iong for the day I can do that
in C++.

------
ilurkedhere
Very good

