@yosh@toot.yosh.is
@yosh@toot.yosh.is avatar

yosh

@yosh@toot.yosh.is

Better things are not only possible; they're within reach.

Concurrent Computing ←
Programming Language Design ←
Rust and WebAssembly at Microsoft ←

u(๑╹ᆺ╹)

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

yosh, to random
@yosh@toot.yosh.is avatar

A fast Fourier transform is the same as a regular Fourier transform but you drink a lot of coffee beforehand

yosh, to random
@yosh@toot.yosh.is avatar

Oh wait, is the reason that compiling C code in a sandbox is hard, also the reason that cross-compiling is hard, and also the reason using compilers in browsers is hard?

yosh,
@yosh@toot.yosh.is avatar

Like in essence, a C compiler should just be able to take a bunch of valid strings in. And then outputs a different string containing the binary output.

But like, that’s not quite how they work in practice. And a bunch of things are also tied to the system you’re compiling on. Which seems like it might be the main reason all these things are hard?

yosh, to random
@yosh@toot.yosh.is avatar

Gah, I still can’t get over the fact that a modern 737 can carry around 200 people with the super cramped economy seating.

While just a 8-carriage double decker sleeper train could carry the same number. But instead of economy seating everyone could have their own private cabin with a bathroom, bed, and sitting area.

yosh,
@yosh@toot.yosh.is avatar

I’m so far out of my depth with this one, but I’m also absolutely convinced it is possible. I’ve stayed in business hotels in Japan (APA), and like, that it seems totally doable to create affordable cabins like that on a train imo. These hotels have standard 11m2 rooms for two people, which include a bed, desk, bathroom, and mini-fridge.

https://www.booking.com/hotel/jp/apahoteru-qian-xie-yi-qian.html

yosh,
@yosh@toot.yosh.is avatar

Yep, floor plan math likely checks out. This page covers the last gen trains by the NS. They are 26.8m x 2.8m == 75m2 of surface area.

https://nl.wikipedia.org/wiki/M7_(spoorwegrijtuig)

Let’s say that the entrances and stairs take around 15m2, that would leave 60m2 per floor. For two floors that’s 120m2, which should be able to hold around 12 APA-sized rooms, or 24 passengers per train carriage. And 8 carriages gets you to just shy of 200 passengers.

yosh,
@yosh@toot.yosh.is avatar

Also, acquisition cost is a really interesting one. This will be ballpark ranges, but apparently the cost of buying 917 train carriages was 3.3 billion euros.

That means the price per carriage is around 3.6 million euros. Which for 8 carriages would put it at around 29 million euros. Let’s add another 6 million euros for locomotives, which would put us at 35 million per train.

The cost of a 737 starts at 90 million USD and goes all the way up to 135 million USD. lmao.

https://www.statista.com/statistics/273941/prices-of-boeing-aircraft-by-type/

yosh,
@yosh@toot.yosh.is avatar

lmfao. Like yeah what I’m putting down are obviously ballpark ranges. But the numbers are so far apart this just like, doesn’t make any sense. Guaranteed that the operating costs of trains are also going to be lower than that of planes.

Can you imagine a 35 million euro train, with another 55 million worth of furnishing? How sick would that be? A return from Copenhagen <-> Barcelona is a few hundred euros. If I’m right then in theory this super luxe sleeper should probably cost around the same

yosh, to random
@yosh@toot.yosh.is avatar

I’m so sus of anyone who claims to be “completely self-sufficient”.

Like, sufficiency is a spectrum. And the way I interpret claims like these is as a claim of living in a closed ecology. If everything else goes awry, they’d be able to carry on as-is. And like, absolutely no way lmao.

yosh, to random
@yosh@toot.yosh.is avatar

Today we're playing Calendar Jenga. It's a game whereyou move calendar items around one-by-one, being careful to ensure the structural integrity of your calendar remains intact throughout.

thejpster, to random
@thejpster@hachyderm.io avatar
yosh,
@yosh@toot.yosh.is avatar

@twilliability @thejpster

I tried writing a little bit about WASI specifically a while back: https://blog.yoshuawuyts.com/what-is-wasi/

I feel like Dan did maybe a better job getting the point of WASI across in his talk here:

https://youtu.be/97jw9v2dRaw

yosh,
@yosh@toot.yosh.is avatar

@twilliability I’m glad you enjoyed it. And sure! Feedback is always welcome

yosh, to random
@yosh@toot.yosh.is avatar

@Fishrock o/ found another use case where _::Variant enums would come in handy: all uses of patterns and pattern types!

https://github.com/rust-lang/keyword-generics-initiative/blob/backwards-compatible-pattern-types/evaluation/pattern-types.md#resolving-the-backwards-compatibility-issues

I’d love to be able to put your draft RFC up for this at some point. To me it's almost a no-brainer that we should be doing this for enum variants.

yosh,
@yosh@toot.yosh.is avatar

@wffl @Fishrock yeahhh, I hear you. I don't love the syntax either, but I dislike not having the feature even less lol.

yosh, to random
@yosh@toot.yosh.is avatar

This is what the future of long-distance travel looks like imo:

https://youtu.be/MhaZfaW6aI4

yosh, to random
@yosh@toot.yosh.is avatar

Is there anything resembling a universal hardware interface for like, industrial devices?

I’m thinking: I like the idea of the convenience networked appliances can provide far more than any actual implementation I’ve ever seen. And that’s usually because of the tight coupling between the appliance and its network components. Which means your internet-connected washer or whatever is destined to eventually become e-waste. I really dislike that!

yosh, to random
@yosh@toot.yosh.is avatar

It’s weird to me whenever people talk about “memory safety” as a feature of a programming language, rather than a property of it.

Like, perhaps it’s possible to define things like memory-safe subsets of languages. But that still requires reasoning about the entirety of the language, and the working out how to make its various parts memory-safe.

yosh,
@yosh@toot.yosh.is avatar

It’s like, if you design your language in the right way then “memory safety” is an emergent property of the entire system.

There are usually ways to add a modal system to an existing language to carve out a subset for which these properties hold. But like, for all intents and purposes you should be able to reason about that subset as a language in its own right.

yosh, to random
@yosh@toot.yosh.is avatar

I wish I had a PhD in type systems just so I could preface all of my talks with:

“Disclaimer: while I am a type doctor, I am not your type doctor. For any type system related questions you have about your projects please consult a qualified professional.”

yosh, to random
@yosh@toot.yosh.is avatar

I sometimes wonder: “what if Rust bools were just another enum” and while not actually practical or anything imo, it’s a pretty fun thought exercise?

If/else statements are a really fun one here. We don’t want to have to write:

if let true = x {}

but instead we want to be able to write:

if x {}

Which I think we could do via a trait. But if we allowed that and made the trait stable, other enums could be “truthy” or “falsy”, which I’m not sure we’d want.

yosh,
@yosh@toot.yosh.is avatar

(I’m nearly certain this has been thought through before, and so this really is just a fun thought experiment)

Another option would probably be to “bless” the bool enum using some kind of built in attribute, making it the only type which can work this way. Attributes fall outside of the type system, so it feels like doing this would not actually do anything.

yosh,
@yosh@toot.yosh.is avatar

Another option I see is having an unstable trait for the conditionals, but expose the enum as stable. That’s a way of saying: “yes, bool is an enum. No, you can’t use the trait as a shorthand in your own impls.”

Maybe a better way of doing this would be if we had a first-class way of creating sealed traits, rather than the export hack everyone uses today:

“Heya, here’s the trait which provides this behavior. You can use it in bounds OK. Though the stdlib says you can’t implement it.”

yosh,
@yosh@toot.yosh.is avatar

Even if it doesn’t buy us much, it does seem appealing from a design perspective if all language concepts in Rust are further represented by traits and types.

Bool is this weird almost-but-not-really enum which just sits there goofing around. We can explain equality via traits. Same with closures. The idea of shorthand conditional notation being a trait too feels… nice?

yosh,
@yosh@toot.yosh.is avatar

Probably more useful in this category of things would be if access to patterns would be implementable via traits tho.

C# recently introduced this for their matching system, and it’s really useful! That would actually be really cool in Rust, because it would give us a way to e.g. use slice patterns 1 to directly index into vectors. Or be able to index into data types which can’t be interpreted as a slice such as VecDeque.

yosh, to random
@yosh@toot.yosh.is avatar

The importance of clear, concise communication:

❌ Please consider washing your hands for your safety and other’s
✅ Wash your hands

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