@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.

swiftcoder, to rust
@swiftcoder@mastodon.social avatar

I guess a stealth MacOS update decided I don't get to use anymore... How's your Monday?

ekuber,
@ekuber@hachyderm.io avatar

@swiftcoder @mo8it see? All positives! :o)

ekuber, to rust
@ekuber@hachyderm.io avatar

The online discourse:

"It's like C++ and OCaml had a baby! (Positive)"
"It's like C++ and OCaml had a baby! (Pejorative)"

ekuber,
@ekuber@hachyderm.io avatar

"It restricts what I can do! (Pejorative)"
"It restricts what I can do! (Positive)"

godmaire, to rust
@godmaire@mstdn.social avatar

Is it not possible to use grave accents in rust proc-macros? When I do, I get an "unknown start of token" error, even though it /is/ the whole token. When taking a peek at the TokenStream given to the proc-macro function, the grave doesn't appear at all

#rust #programming

ekuber,
@ekuber@hachyderm.io avatar

@godmaire is that as a grave accent on its own, or something like Γ¨? The later should work. https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=1dbb34c0d237cc070f240c8c70e8a9b1

Also check that you're not using an out of date rust version.

ekuber,
@ekuber@hachyderm.io avatar

@godmaire yeah, grave accent on its own is not a valid identifier according to Unicode, and rust follows their guidance. This is at the Lexer step, so proc macros are restricted in the same way.

ekuber,
@ekuber@hachyderm.io avatar

@godmaire same result. The grave accent is only valid after a letter, the backtic is not valid as an identifier

faassen, to random
@faassen@fosstodon.org avatar

Does anyone else have the impulse to want to be the best version of yourself online, sometimes? Even if anonymous? More generous, accepting, warm, less argumentative, more constructive?

Not for reputation afaik, at least not consciously, but just to make everything a bit better? I don't always get this impulse (no saint here) but I have felt that.

Since so much discourse is about how the internet brings out one's dark side, I thought I would mention the opposite.

ekuber,
@ekuber@hachyderm.io avatar

@janriemer @faassen I do my best to lead by example. Life's too short to be an asshole. Too many people confuse being a dick with a personality.

ekuber, to random
@ekuber@hachyderm.io avatar

I have little patience for people that seem to be following the CIA sabotage handbook to the letter.

ekuber, to photography
@ekuber@hachyderm.io avatar

Was just getting super pissed that the autofocus on my 28-105 D and D750 wasn't working and was scared it was the the screw motor on the body, but my 35 f2 D and 80-200 f2.8 both work, so maybe the 28-105 needs more torque than what the D750 can provide? It used to work, but I guess for now I'll have to stay with a prime walking around lens on.

kf, to random
@kf@666.glitchwit.ch avatar

"no cell phones, no fax machines, not another living soul for miles. we'll be unavailable. inaccessible."

"incommunicado."

"minnesota, sir."

πŸ˜‚πŸ« 

ekuber,
@ekuber@hachyderm.io avatar

@kf same energy as Bond and M going to Scotland to hide

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,
@ekuber@hachyderm.io avatar
ekuber,
@ekuber@hachyderm.io avatar

@elomatreb Point taken. I do not have access to the crate version, unless I were to start parsing Cargo.toml files in rustc, which is unlikely to be welcomed by the rest of the team.

ekuber,
@ekuber@hachyderm.io avatar

@pierstoval cargo will "merge" semver compatible crate versions in your dependency tree, but if you explicitly depend on foo@1.0.0 and one of your dependencies explicitly depend on foo@2.0.0, then the only two options are "you can't do that" (can't compile) or "we'll let you do that and treat them as separate crates" (can compile but can't mix types from different versions). Under the former model, upgrading dependencies can mean an unpleasant trip to yak shaving central.

ekuber,
@ekuber@hachyderm.io avatar

@natevw what I'd normally do is update my dependency if it is older, update the bar, if theres any version of it that uses the same version of dependency I have or, most likely, check that the type I'm passing in shouldn't have come from a re-export instead of used directly.

ekuber,
@ekuber@hachyderm.io avatar

@jplatte there's some effort needed to coordinate cargo and rustc to pass that info, in particular because it isn't needed by rustc otherwise do it is a bike shed tar pit, if you allow me to mix my metaphors.

"A bound on this function" might be wrong, because it can be a transitive bound coming from the trait that was bound, for example, but we can tweak the wording.

The ordering should be possible to fix, but given where each of these pieces is assembled it might prove to be tricky.

ekuber,
@ekuber@hachyderm.io avatar

@tommythorn if it gives you enough info to search the web or go ask good questions in a forum, I count that as a win.

ekuber,
@ekuber@hachyderm.io avatar

@matthiaskrgr I considered saying "introduced here", but that sounded more misleading

ekuber,
@ekuber@hachyderm.io avatar

@diegovsky they only contain their rlib, and those files also don't have the version data. I can detect they are different crates, as far as rustc is concerned, they just are two different crates.

ekuber,
@ekuber@hachyderm.io avatar

@thatgeoguy the problem is that the tool that has view of the dependency tree is cargo, and rustc doesn't have a model for it. I think we could integrate cargo: have rustc tell cargo to print extra info

ekuber,
@ekuber@hachyderm.io avatar

@kornel I disagree that allowing semver incompatible deps is a mistake of the tooling, the alternative would be even more annoying, more often. We need to make it easier to avoid it, though.

nahratzah, to rust
@nahratzah@mstdn.social avatar

Okay, the documentation on generic struct-structs is really difficult. And for some reason I cannot omit the where-clause.
I'm probably not understanding.

But... omg, traits are amazing. They're what I wanted c++' constraints to be. <3

This will make working with templates so much easier.
(Just have to figure out type arithmatic, then I suppose I'm pretty much where I want to be.)

(Despite my complaint about the documentation, the documentation is pretty good. Nice language too.)

ekuber,
@ekuber@hachyderm.io avatar

@nahratzah @laund feel free to file tickets on error messages that were misleading! We try our best to be understandable by newcomers, but there's always room to improve.

ekuber, to random
@ekuber@hachyderm.io avatar

Twitter was always a PvP arena full of griefers and grifters, but X seems to be only griefers and grifters.

ekuber, to rust
@ekuber@hachyderm.io avatar

Proc macros in are objectively bad in a number of ways (limited to only dealing with tokens/no type system access, hard for newcomers to grasp and write, force a lot of attributes to be written to annotate specific items, etc.) but they exemplify "worse is better" perfectly. They are incredibly powerful and allow people to build amazing abstractions that are in some cases best in class. We want to have something better, but there isn't a pressing need now to rush a replacement.

ekuber,
@ekuber@hachyderm.io avatar

I'm glad that is now at a stage where there aren't any major missing pieces, almost anything you want to do can be represented, just in round about ways and sharp corners that we can chip away in time. Better than the situation years ago where most people used nightly exclusively because there was missing functionality in stable. We still need a way to have "stable early access" for features close to completion, though.

ekuber,
@ekuber@hachyderm.io avatar

@heaths rustc has a mechanism (lang_items and diagnostic_item) to say "give me the DefId (unique identifier) of a known item (type, fn, trait, etc.)". With that, rustc can also say "paste the path for this DefId in this macro expansion". That would be one API that could be provided to proc macro authors without fundamental changes. From there, I'd want us to provide the functionality of syn, proc-macro2 and quote in the std, eventually.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • β€’
  • Leos
  • tsrsr
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • hgfsjryuu7
  • Youngstown
  • InstantRegret
  • slotface
  • khanakhh
  • rosin
  • ngwrru68w68
  • kavyap
  • PowerRangers
  • normalnudes
  • tacticalgear
  • cubers
  • everett
  • vwfavf
  • ethstaker
  • osvaldo12
  • Durango
  • mdbf
  • cisconetworking
  • modclub
  • GTA5RPClips
  • tester
  • anitta
  • All magazines