
Shipping Const Generics in 2020 - steveklabnik
https://without.boats/blog/shipping-const-generics/
======
mproud
For a second, I thought this said “Shipping cost” and was talking about
generic drugs.

------
zokier
> Based on the pattern passed to the map function, the compiler figures out
> that the first call to array_chunks should chunk the data into an iterator
> of arrays with length 2, and in the second call it should be an iterator of
> arrays with length 3. It’s so cool!

Cool, but bit too implicit to my taste. But regardless, const generics are
definitely one of the biggest features I've been looking forwards to (more so
than e.g. async stuff that got all the hype), so glad to see stuff landing
even with the restrictions.

~~~
pcwalton
To be clear, that pattern more or less falls out naturally from stuff that the
typechecker already has to do to make const generics work in the type system.
It's not so much a special feature as it is just the interaction of plain old
type inference with const generics.

------
topher200
@dang Can we add [Rust] to the title?

~~~
tptacek
That's not a thing we do here.

~~~
saurik
(I am someone who clicked on this mostly to find out what language it was for
and was disappointed it was Rust.) My solution to this problem--which I
consider to be pretty serious: the best title for your blog is one that elides
any context assumed by all of your posts, but then it is difficult to get
Hacker News to appreciate a post about it due to the _insane_ "exactly match
the title" rule (which I one time caused serious problems for as I posted an
article on Google+, which didn't have titles, and submitted the article myself
here with a title, and no one even knew what to do)--is the next time I
publish an article I am going to special case people coming from Hacker News
and just give them a different website with a different title. (But the fact
that I have to do that is ridiculous, and only works because Hacker News is so
popular that it can one-offed.)

~~~
tptacek
"Exactly match the title" is not in fact the rule on HN.

~~~
saurik
And yet adding "[Rust]" is "not a thing we do here", so you are (as usual)
being needlessly pedantic (and curt) with the goal of being correct, but
unhelpful.

~~~
tptacek
I don't see the connection between the two statements. We very deliberately
don't tag posts with categories; "non-siloed" is part of the ethos of the
site. Meanwhile: dogged adherence to original titles is not the rule, nor is
it the spirit of the rule; the spirit of the rule is "the submitter of an
article has no privilege to editorialize; submissions are community property".
So the rule is "please use original titles, unless they're misleading or
linkbait". And, indeed, you'll see stories here that don't use the <title> all
the time.

~~~
tomjakubowski
You could have done a much better job in your original comment saying that
explicit categorization is what "we don't do here," not the changing of
titles.

~~~
tptacek
Eh, I think we all did fine.

------
navaati
Oh yessss.

Will this allow for the much wanted "move iterator on arrays" ?

~~~
Rusky
Yes: [https://github.com/rust-lang/rust/pull/65819](https://github.com/rust-
lang/rust/pull/65819)

------
cryptonector
This is very nice!

