@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

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.

mort, to Kotlin
@mort@fosstodon.org avatar

I can't deal with languages with optional semicolons! I like languages without semicolons, but when they're optional, especially if they feel "C-like", I always end up adding semicolons to some lines even when I try to write in a semicolon-less style. I'm writing some now and I decided to just use semicolons consistently because the alternative is seemingly to use them inconsistently.

Strangely, this isn't an issue I have in . I do have it in however.

ekuber,
@ekuber@hachyderm.io avatar

@mort Rust doesn't have optional semicolons. Leaving a semicolon out is only valid as the last element in a block to denote it as the resulting expression for that block, but that's not the same thing as optional semicolons.

ekuber,
@ekuber@hachyderm.io avatar

@mort but it is mandatory in many of those cases: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=32225df0708630a138de26cfba3f4ffb

Thank you for making me double check, because made me realize there's a bug in our logic: https://github.com/rust-lang/rust/issues/124819

faassen, to rust
@faassen@fosstodon.org avatar

In the last year and a half I have written a lot of Rust code, only some of which is open source at the moment: Xot, the capable XML tree library.

I have also most of a XPath 3.1 implementation and part of an XSLT 3.0 implementation. And a structural human readable diffing library for XML documents.

I happen to have a (revived) background in established tech like XML and I can write Rust, which makes for an interesting combination.

ekuber,
@ekuber@hachyderm.io avatar

@faassen XML was over-engineered and had plenty of dubious features, but it is much better than most other seriously under-engineered document formats. Count me in as an XML apologist.

ekuber, to random
@ekuber@hachyderm.io avatar

"Incrementalism isn't enough, so we should do nothing until the revolution" only ensures that nothing changes, ever. It's a fundamentally conservative position because the result is the same as "we should do nothing because the status quo is good".

sundogplanets, to random
@sundogplanets@mastodon.social avatar

Yesterday after riding in the car, listening to CBC News, my 7yo asked "Why is there a grocery store called Blah Blahs?"

And that is what I will forever call Loblaw's.

ekuber,
@ekuber@hachyderm.io avatar

@sundogplanets "Bob Loblaw's Law Blog" has to be one of the best jokes from Arrested Development.

rust, to random
@rust@social.rust-lang.org avatar

Rust 1.78.0 is now available! 🦀🌈

This release brings you #[diagnostic::on_unimplemented], more safety assertions in the standard library (in debug mode), LLVM version 18, and more!

Check out the announcement and release notes: https://blog.rust-lang.org/2024/05/02/Rust-1.78.0.html

ekuber,
@ekuber@hachyderm.io avatar

@rust want to send a shout out to @weiznich, who got on_unimplemented over the line for people to be able to use in stable after years of attempts to drive that forward.

ekuber,
@ekuber@hachyderm.io avatar

@hds @rust @weiznich We already have on_type_error planned, but if you have others in mind I'd love to hear about them!

ekuber,
@ekuber@hachyderm.io avatar

@llogiq @rust @weiznich I like that!

ekuber, to random
@ekuber@hachyderm.io avatar
whitequark, to random
@whitequark@mastodon.social avatar

many of you have seen me speak out against Thiel companies participating in Rust and NixOS development, but I don't think I ever clearly said why

as anyone who has opened and read my bio will know, I'm fine with the existence and use of weapons. no, what I have the problem with is imperialism; and Palantir and Andruil, and their acceptance, is currently the means by which it's capturing our communities

ekuber,
@ekuber@hachyderm.io avatar

@spots1000 @whitequark
> I'm aware of Rust's history of being queer developed, but it seems these days that those roots are just history and not representative of who develops Rust these days.

This is erasure of the very real queer people maintaining Rust now, not historically.

And of all the industr(ies) forces on Rust, development for the defense industry is probably the most esoteric.

ekuber, to rust
@ekuber@hachyderm.io avatar

Out of curiosity, I did a quick check to see how many impl Trait return types are object safe in the rustc codebase, meaning they could always be turned into a type-erased Box<dyn Trait>, and the ratio of object-safe/not object-safe is ~10:1.
I don't know what that tells us, but found it interesting.
I wonder what the performance impact in compile times and the produced binaries of turning these into trait objects automatically and transparently.

ekuber,
@ekuber@hachyderm.io avatar

This seems to be in the same "neighborhood" as "polymorphization" (turning functions with type parameters into functions that take trait objects without developer action when it would not affect runtime performance, improving compile times by avoiding monomorphization and reducing generated code).

ekuber,
@ekuber@hachyderm.io avatar

@SeanOMik impl Trait is a "materialized" type, it's an alias for "some type that implements Trait", which means that all of the monomorphization logic has to be applied to it. Box<dyn Trait> is a "type erased trait object", meaning that at runtime all its methods go through a "V-Table", which means during compilation you no longer need to care about what the actual type is for type checking.

ekuber,
@ekuber@hachyderm.io avatar

@SeanOMik All of this is relevant when you have method call chains or recursive method calls where you return "something that implements Trait". Like for Iterator. Each call to .map() on an iterator will create a new type Map<T> where T is all of the previous types. if .map() returned a trait object, evaluation of the type would be done in one go, instead of having to evaluate the heavily nested type.

ekuber, to random
@ekuber@hachyderm.io avatar

"I will not engage in the Discourse. Discourse is the little-death that brings total obliteration. I will read the Discourse. I will permit it to pass over me and through me. And when it has gone past I will turn the inner eye to see its path. Where the Discourse has gone there will be nothing. Only I will remain."

danielsreichenbach, to rust
@danielsreichenbach@mastodon.world avatar

I generally like but I think every project developer should be forced to use it on a Raspberry Pi with 4GB RAM... had to build Vaultwarden (https://github.com/dani-garcia/vaultwarden) on one, and man,,, after 15 minutes compilation is no longer running because the device went OOM and now is so hot the fan is louder that a datacenter server...

Just to be clear, I think this is a Rust problem, not a project problem.

ekuber,
@ekuber@hachyderm.io avatar

@danielsreichenbach @mo8it @FSMaxB It might be worth it to file a user experience ticket so that cargo/rustc can detect when you're running a configuration that will clash with the available resources and guide you on to how to change them.

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.

ekuber,
@ekuber@hachyderm.io avatar

I think there is a Rust-like language that accepts inference at the cost of perf and speed, that has less stringent backwards compatibility assurances, that interacts with Rust natively. But that can't be "Rust".

ekuber,
@ekuber@hachyderm.io avatar

I personally want that "Rust#" to exist if nothing else to use it as a test bed for Rust features with real world usage. I think there are tons of small things we can do that will make Rust easier to use, but some of the issues with "spaghetti of global state" designs will never be not painful in the language. Some of them can be mitigated with better libraries (allowing granular Singleton field access without keeping locks on the global object), but likely not all of them will.

ekuber,
@ekuber@hachyderm.io avatar

An example I can give: Rust doesn't support return type inference. You can use impl Trait for that. You can also write -&gt; _ and the compiler will tell you what type it would have inferred for you to write down there. Global return type inference won't ever be allowed in Rust. But maybe we could allow it inside of a single module? A single crate? I would expect the DX to be crap, but we could technically do it without losing too much on correctness.

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

Starting a thread about my life with Cookie, while she’s in intensive care right now in San Francisco. She’s still conscious, but it’s not looking great. Even if she gets to come home I think it’s time to prepare to say goodbye to her.

  1. This was the very first time I saw her.

I was 24 years old. I’d just moved to Petaling Jaya, Malaysia. With the first serious girlfriend I had. We thought it’d be a great idea to get a dog.

I took a pic of the moment I saw Cookie in Damansara Uptown

ekuber,
@ekuber@hachyderm.io avatar

@skinnylatte it's clear cookie is loved and she knows it

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

@jhpratt 😄
None of the reasons that come to mind are non-horrifying

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