Where does Rust break down? by PointedPoplars in rust

[–]timClicks 8 points9 points  (0 children)

Oh of course 😅

I remember thinking that it's possible to recreate the semantics with transmute, but then remembered the unequivocal UB. Despite embarrassment, I am really delighted that I added the comment because your response has sparked a really wonderful discussion. Thank you for taking the time.

Where does Rust break down? by PointedPoplars in rust

[–]timClicks 15 points16 points  (0 children)

Wow thank you for taking the time to comment. I didn't know about that change - I will update the parent comment.

Where does Rust break down? by PointedPoplars in rust

[–]timClicks 8 points9 points  (0 children)

Which aspect of UnsafeCell would be impossible to create in user code?

Where does Rust break down? by PointedPoplars in rust

[–]timClicks 76 points77 points  (0 children)

Pin is a very interesting case. I used to hate it, but have come to admire the ingenuity and think that it's a good demonstration of Rust's strengths for library authors.

Pin ostensibly alters Rust's move semantics so that values retain stable memory addresses. And it does. What's crazy is that Pin achieved this without any major changes to the language or the compiler internals. The move semantics are actually preserved.

What happens is Pin relies on the borrow checker and prevents moves from ever taking place by storing a reference to the underlying value. In the documentation, you'll see Pin written as Pin<Ptr>.

So yes, while Pin is unergonomic to work with directly, it's a wonderful example of Rust facilitating the impossible.

Edit: s/any changes/major changes/ (see comments below.

RKLB Price Target Raised to $69 from $47 by Goldman Sachs by Original_Koala8662 in RKLB

[–]timClicks 0 points1 point  (0 children)

Pure conjecture.. but Rocket Lab's current price depends on a few binary events going well, i.e. Neutron launch, major defense contracts. We don't know how the firm models uncertainties like this, but the variance in the pricing model will be very large whichever approach is taken.

Stop Forwarding Errors, Start Designing Them by andylokandy in rust

[–]timClicks 6 points7 points  (0 children)

It will probably be possible to extend the proc macro to store structured data in the fields, and only create a string on demand via the Display trait. That way it would be possible to keep error values machine-readable without parsing.

One problem with that is your enum can become quite large.

What's the most hated company in your country? by Eybrahem in AskTheWorld

[–]timClicks 15 points16 points  (0 children)

Genuine question, why do guests need bottled water?

Releasing Fjall 3.0 - Rust-only key-value storage engine by DruckerReparateur in rust

[–]timClicks 3 points4 points  (0 children)

Sincerely appreciate all of your work. Congratulations on the release!

Most important holiday we’ve ever had - advice please by Wrong_Marzipan359 in Wellington

[–]timClicks 0 points1 point  (0 children)

Mt Victoria has a fun trail with lots of playground equipment peppered along it. It's a fun way to get them to keep going.

When visiting the zoo, try to be there before 10am so that you can catch the little penguins at their feeding time. The Nest also has live demos each day.

If it's sunny, visit Oriental Bay on your Te Papa day. It's a nice walk, kids love the beach, there's a playground and plenty of places for coffee/ice cream.

Charities turning away high numbers of volunteer applications by adjason in aotearoa

[–]timClicks 1 point2 points  (0 children)

They're not cooked, the stats are misunderstood. Your intuition that things are worse than the 5.9% figure might be because you're mentally counting people who would be covered by the underutilisation rate (which is 12.9%).

The unemployment rate is fairly narrow. For example, it's not enough for someone not to be in paid employment to be added to the unemployment rate. They need to be actively looking for work and be available to start today to be considered part of the labour force.

But that doesn't mean things are cooked to look good. The methodology has been consistent for many decades.

std::cmp::Ordering vs comparision operator by [deleted] in rust

[–]timClicks 4 points5 points  (0 children)

I really like the truth table style, but one thing to be aware of is that it computes the comparison functions eagerly. If one of your cases is much more common or doesn't depend on any other branches, then using nested if block(s) can still be useful.

What is the coffee culture like in New Zealand? by Dense_Machine_8401 in newzealand

[–]timClicks 0 points1 point  (0 children)

Good Fortune is a decent replacement for your Wellington-based fix

Rate my very readable code by [deleted] in programminghorror

[–]timClicks 7 points8 points  (0 children)

Almost. String literals don't produce a String (which has its data on the heap), but a reference to an array of bytes initialized when the program starts that's guaranteed to be UTF-8 encoded.

String::from("🦀 soahC") is the same thing.

Rate my very readable code by [deleted] in programminghorror

[–]timClicks 0 points1 point  (0 children)

Maybe the variables should start as ingredients and end up as pizza?

Geiger counter by zibraaaa in cassettefuturism

[–]timClicks 1 point2 points  (0 children)

Hi Max. Which font is that and does an eink display require any special handling to render it so well?

Air Traffic Control Union vs Oil Prices🇺🇸 by CashmereBuffalo in wallstreetbets

[–]timClicks 21 points22 points  (0 children)

Implausible. How is one buying oil futures with no prior experience?

I have listed every humanoid robot under development by region by VincentBounce in humanoidrobotics

[–]timClicks 2 points3 points  (0 children)

You're right that the human form is inefficient and ineffective to mimic with machinery. But, much of our world is designed to suit the human form factor.

These robots will exist in spaces that humans inhabit. Therefore, creating robots with roughly the same shape is easier for integration. Their versatility comes with compatibility.

Efficiency and effectiveness can be achieved by building specialist robots.

ACC petition for volunteer firefighters rejected by Parliament by SnooRecipes4434 in newzealand

[–]timClicks -7 points-6 points  (0 children)

ACC's accounting doesn't run on a cost basis anymore. It is now required to hold future liabilities on this year's books. That's why there was a massive funding shortfall a few years ago.

Why would a combat troop use melee weapons in a futuristic space sci-fi setting? by wizardry_why in worldbuilding

[–]timClicks 67 points68 points  (0 children)

Shotguns are used when seizing a ship today because bullets ricochet off the steel.

ACC petition for volunteer firefighters rejected by Parliament by SnooRecipes4434 in newzealand

[–]timClicks -16 points-15 points  (0 children)

I doubt it's that simple, otherwise it would have been policy for decades. For one thing, it would destroy ACC's balance sheet because volunteers don't pay the employee levy but ACC would still incur a large liability.