@ekuber@hachyderm.io
@ekuber@hachyderm.io avatar

ekuber

@ekuber@hachyderm.io

"We spent decades trying to invent a sufficiently smart compiler when we should have been inventing a sufficiently empathetic one."

Rust Compiler team member. If you have to search for answers when the compiler is talking to you, that's a bug.

There are no bad programmers, only insufficiently advanced compilers.

Cache-locality awareness evangelist.

💼@aws, opinions my own

he/him

Trans rights are human rights

This profile is from a federated server and may be incomplete. Browse more on the original instance.

ekuber, to rust
@ekuber@hachyderm.io avatar

If there were an opt-in lint you could run on #Rust code to assert a function you've written will never panic, how would you want (the default) to be when handling method calls on trait objects where some impls might panic? Error given that it could panic or downgrade to warning given that we don't know for sure?

ekuber, to rust
@ekuber@hachyderm.io avatar

2023
@nellshamrell's "Rustacean Community Interfaces" talk in full swing, talking about the many hats rustaceans wear.

image/jpeg
image/jpeg
image/jpeg

ekuber, to rust
@ekuber@hachyderm.io avatar

Request for feedback: how would you change this compiler error? Can you tell what's going on? What the problem is? Do you get a sense of how you might be able to solve it?

ekuber, (edited ) to rust
@ekuber@hachyderm.io avatar

Meet Red Pen, a rudimentary linter: https://github.com/estebank/redpen
I cleaned things up to the point where you can actually use this, but it is v0.1 and I mean it. It most likely won't work when you first try it (linux only for now), but I'm really happy with the first useful lint it has: assert that a function cannot call panic.

PRs very welcome.

ekuber, to rust
@ekuber@hachyderm.io avatar

What would you take out of this diagnostic? Is this too much information? Would you prefer to have a shorter message at the cost of needing multiple cycles of the compiler telling you you're missing a change?

ekuber, to random
@ekuber@hachyderm.io avatar

Every time there's a CVE affecting some fundamental part of modern computing that Rust provides a dot-release for, it seems multiple publications find out first from the Rust blog and publish titles implying that Rust is the only affected thing. It's not only mildly annoying hearing the echos of "har, har, I thought it was 'safe'", it does a complete disservice to anyone that doesn't use Rust because they won't find out they have to update or mitigate the issue too!

ekuber, to rust
@ekuber@hachyderm.io avatar

I have some thoughts on the subject of Telemetry and Metrics in the context of the tooling. I want to hear your feedback on the matter.

"No telemetry in the Rust compiler: metrics without betraying user privacy":
https://estebank.github.io/rustc-metrics.html

ekuber, to rust
@ekuber@hachyderm.io avatar

Hot take: is not the end-all be-all of languages. Other languages will come forth with improvements in multiple axes. I also think that it has made a lot of good choices on trade offs, but some of those make it harder than it could be. I think there's space for an EasyRust, that could be developed independently, but it could be part of the same existing codebase and leverage it as a testing ground for changes to Rust itself. You could even say that nightly is that language already.

ekuber, to random
@ekuber@hachyderm.io avatar

I finally started reading Dune. A quarter of the way in and can see why it is such a beloved classic.

ekuber, to random
@ekuber@hachyderm.io avatar

I said "I want fn foo() -> impl enum Display { if rand_bool() { 42 } else { "hi!" } that creates an anonymous enum that impls the trait" over a few beers after RustConf, and the range of expressions from 😨 to 😈 of the people there was hilarious 😅

ekuber, to rust
@ekuber@hachyderm.io avatar

I'm super proud whenever a newcomer asks a question in a forum, and the response is "if we run the code you want, the compiler tells you this, which explains why it can't doesn't work", and then goes on to expand. I'm terribly against RTFM attitudes, but Read The Friendly Compiler Output should be a valid learning strategy.

ekuber, to rust
@ekuber@hachyderm.io avatar

Has anyone tried to do a pure-#Rust protocol buffers serialisation/deserialization implementation? As much as being able to wrap over libraries with a C ABI easily is a great Rust feature, dealing with non-Rust dependencies can sometimes be annoying.

ekuber, to random
@ekuber@hachyderm.io avatar

Perhaps unsurprising observation that caught me by surprise at first: people don't read error messages.
It might read "say 'friend' to enter" and users will stand around in a circle next to a monster infested pond as if you had given them a riddle.

ekuber, to rust
@ekuber@hachyderm.io avatar
ekuber, to Albuquerque
@ekuber@hachyderm.io avatar
ekuber, to random
@ekuber@hachyderm.io avatar

"You can say 'all are welcome,' but if wolves and sheep are both welcome then you're only going to get wolves. The the smart sheep will go somewhere else and the naive sheep will be eaten and processed. [...] Refusing to choose is a choice. It's a choice in favor of the people who prey on others and who refuse to acknowledge the humanity of those they hate."

ekuber, to rust
@ekuber@hachyderm.io avatar

The project on Mastodon: https://social.rust-lang.org/@rust

ekuber, to rust
@ekuber@hachyderm.io avatar

Sometimes I wish that rustc had a database of small breaking changes that affect only a handful of crates, so that we could on the fly patch them going forward. Things like "we now correctly check for lifetimes in assoc types" can technically be a breaking change that affects a handful of crates, but I want to ensure that building a project from today in 15 years doesn't require a compiler tool chain from today.

I guess this is the windows backwards compatibility approach.

ekuber, to random
@ekuber@hachyderm.io avatar

I am now a citizen of the United States of America.

ekuber, to rust
@ekuber@hachyderm.io avatar

Regular reminder that if a compiler error isn't clear, we consider that a bug. File a ticket! Worst case scenario it gets closed as a duplicate. Second worst it takes us a long time to get to them. But I assure you I've read every single open A-diagnostics ticket at least twice.

ekuber, to rust
@ekuber@hachyderm.io avatar

Somewhat cursed idea: "attributes at a distance"

#![attr(target = crate::foo::Bar)]

mod foo {  
 struct Bar;  
}  

What would you use this for?

ekuber, to rust
@ekuber@hachyderm.io avatar

" development is going too fast (because they are stabilizing features I don't care about) and going too slow (because they are not stabilizing features I care about!"

There are only so many contributors, hours in a day, days in a year to get to everything now, and some features are reliant on other, less flashy work that needs to happen before they can be even attempted.

But people are putting in a lot of work, the codebase changes so quickly that it is hard to keep up.

ekuber, to random
@ekuber@hachyderm.io avatar

"When people tell you what doesn't work, they're usually right. When they tell you how to fix it, they're usually wrong."
– Bill Hader

I couldn't have come up with such a succinct way to frame it. You need to listen to people complaining about problems, but don't over index on the solutions they propose.

ekuber, to rust
@ekuber@hachyderm.io avatar

impl dyn Foo + 'static where Self: 'static {
fn hello(&'static self) where Self: 'static {}
}

For when you want to really be sure that your #Rust trait object method is invoked on an owned type.

ekuber, to rust
@ekuber@hachyderm.io avatar

Rust's unexpected super-power is just how flexible it is. It allows you to write very high level looking code on a low level language. That caused people to use it beyond its intended niche. But it is fundamentally a low level programming language. It will continue becoming easier to use (that's my personal goal!) but there are "obvious" changes that would make things easier at the cost of speed or correctness that cannot take.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • khanakhh
  • kavyap
  • thenastyranch
  • everett
  • tacticalgear
  • rosin
  • Durango
  • DreamBathrooms
  • mdbf
  • magazineikmin
  • InstantRegret
  • Youngstown
  • slotface
  • anitta
  • ethstaker
  • ngwrru68w68
  • cisconetworking
  • modclub
  • normalnudes
  • osvaldo12
  • cubers
  • GTA5RPClips
  • Leos
  • tester
  • megavids
  • provamag3
  • lostlight
  • All magazines