Email or username:

Password:

Forgot your password?
277 posts total
Joshua Barretto

I want a Rust function with the following signature

fn specialise<T, U, R>(
in: T,
special: impl FnOnce(U) -> R,
fallback: impl FnOnce(T) -> R,
) -> R;

If T and U end up being the same type, it invokes `special` on `in`. Otherwise, it invokes `fallback` on `in`.

I believe this function would cover a good 80% of practical uses for specialisation, and be cleaner to use both for implementers and API users.

Joshua Barretto

I implemented this function in my own language, Tao (it calls out to an intrinsic internally which causes the compiler to choose one of the two functions during monomorphisation). It works great. I'm currently using it to specialise the pretty-printing implementation for `Str` (which is just a type alias of `[Char]`) so that it doesn't print like a list (i.e: with brackets and commas between elements): github.com/zesterer/tao/blob/b

(I currently call it 'dispatch', although I'm going to change this)

I implemented this function in my own language, Tao (it calls out to an intrinsic internally which causes the compiler to choose one of the two functions during monomorphisation). It works great. I'm currently using it to specialise the pretty-printing implementation for `Str` (which is just a type alias of `[Char]`) so that it doesn't print like a list (i.e: with brackets and commas between elements): github.com/zesterer/tao/blob/b

Joshua Barretto

My text editor is *so close* to being usable as a daily driver.

So much so that I've deciding to rewrite it in itself 🙃

Joshua Barretto

The GNOME desktop environment is surprisingly resource-light nowadays. I just installed it on an old laptop that never used to be able to run it without stuttering about 5 years ago, and it's buttery smooth now. I'm sure <alternative DE> beats GNOME in <specific way>, but for me personally, everything that previously pushed me away from it has now been addressed.

Joshua Barretto

I'm sure at least a little bit of that is that it's defaulting to Wayland now, but still: it takes two to tango.

J3RN :fedora: :elixir: :emacs:

@jsbarretto I'm running it on a 7 year old laptop and never really appreciated it until I tried using Windows 11 on the same machine.

happyborg

@jsbarretto I use it because I'm too lazy.

The things that still piss me off are the stupid way it tries to 'help' me do what I'm trying to do, for example arange a window or two, and gets in the way. Also silly width scroll bars, but massive outside window click area. 😱

Updates sometimes revert disabling of such UX stupidity.

Current gripe: a new feature was added to open the desktop selector rather than the last desktop on boot. 🤦‍♂️

That said I doubt it's worse than others.

Joshua Barretto

Remember in the early 2010s when "there's no difference between US presidential candidates" was the talking point? Yet, today, US voters have some of the widest and most fundamental gulfs between their candidates of any nominally democratic state on earth.

You'd be a moron to stay at home come polling day.

Joshua Barretto

Test firing a small pot made from self-refined clay. The thermocouple reported about 800 °C at peak (for about 20 minutes), so hopefully that's sufficient. Just need to wait for it to cool over the next few hours now.

This kiln cost £7.30 to make: £5.30 for the bricks and £2 for the wire mesh that sits under the charcoal.

Joshua Barretto

Admittedly that's not counting the cost of the thermocouple used to measure the temperature (about £20) and the charcoal itself (about £2.50, amortised), but still: not expensive!

I've checked all local laws, and legally speaking, this is just considered a barbeque.

Joshua Barretto

I came up with a neat idea for rendering shadows today, but after a bit of searching it turns out that I'd just reinvented shadow volumes 🙁

Joshua Barretto

Really quite shocked at the effectiveness of a single layer of bubble wrap insulation on the inside of the greenhouse. Last night the greenhouse was barely scratching 3-4 °C difference with outside temperatures, tonight it's managing closer to 9 °C difference.

That might not sound like much, but just a degree below zero can near enough kill everything in there in a single night.

Joshua Barretto

Having an intelligent dog that knows you and understands you is nice. Having an intelligent dog that knows how to open doors, flick latches, and climb cupboards to acquire socks? Not so much.

James Waples

@jsbarretto you have to train them for the intelligence you want

happyborg

@jsbarretto what you have there is an evil intelligent dog.

Lately, mine shows signs of dabbling with the dark side but so far hasn't crossed over. 🤞

Joshua Barretto

The implication here that Californians are uniquely at threat of cancer and reproductive problems is mildly humorous.

Joshua Barretto

If OpenAI is going to treat copyrighted works as public domain, maybe everything they produce, including their models, should also be treated similarly?

Ben Stokman

@jsbarretto it actually is like that already. There’s just no law requiring the model be publicly available.

Lars Marowsky-Brée 😷

@jsbarretto The output of these models cannot be copyrighted, is my understanding.

Which incidentally makes them quite difficult to use in software development, if one cares about licensing or IP.

Joshua Barretto

A reason that I personally appreciate alt text: I often check Mastodon when on the train with an extremely spotty mobile data connection (blame the tunnels). Alt text always loads long before the image itself, so I know what images are worth waiting for and which are simply a bit of extra context for a post.

Willow "Wolveric" Catkin

@jsbarretto Basically exactly what I said when someone asked about the benefits of alt-text... 😹

Joshua Barretto

Well, the clay-heavy soil is waterlogged and nothing will grow, so I might as well make some lemonade with my lemons. This is experiment #1 of turning the clay into pottery and firing it over a gas hob.

Success? Sort of. It's still in one piece, and it has the characteristic tinny ring of pottery when tapped, but I need to filter the clay more to remove large particles. Needs temper added to it to prevent cracking during drying. Also, time to build a pottery wheel.

Joshua Barretto

Also, most of the pot didn't get hot enough to properly fuse. I'll have to think about better ways of trapping heat than simply placing a saucepan lid over it.

Joshua Barretto

It's only a real storm if the BBC spends most of the morning broadcasting a video of a trampoline going for a ride down the street or some other activity that trampolines aren't supposed to do.

Joshua Barretto

I have been trying for several weeks to find an opportunity to fix the leak in the greenhouse roof, but I can't because it's been persistently raining for over a month now. Everything is waterlogged, everything is rotting.

Joshua Barretto

The mince pies will continue until morale improves

James Waples

@jsbarretto I hate mince pies so the resulting negative feedback loop would be a universe ending event for me

Joshua Barretto

The point of the federated model is that it's inherently more immune to the behaviour of bad actors pervasively affecting everybody, right?

Joshua Barretto

There's so much joy in something as simple as putting up a shelf. I try to make sure that I finish each weekend with at least some physically manifest evidence of me having achieved something, and this seems as good as any.

Joshua Barretto

I started a new job recently. The commute is about 80 kilometres. I was convinced that I'd end up needing to buy a car but it turns out that a folding bike + trains is at least as fast as a car, gives me almost an hour to read, and I hit my daily exercise quota without needing to really try. Do the maths! You might find that public transport and a bike suits you better than a car ever could.

Joshua Barretto

The withoutboats article is good. As much as it pains me to say it, Rust has promised too much in the domain of stability for a practical effect system to ever be workable on top of what is already here. The place to implement an effect system is (a) a new language or (b) Rust as it was a decade ago.

James Waples

@jsbarretto I think we should be breaking more of the universe in new editions. I’ve always thought that was kinda their purpose, instead we get a watered down minimal changeset which wastes a good opportunity imo.

Maybe I need to look at this through the systems programming lens where tooling is supposed to be rock solid and last for years but that begs the question: why do we have to perpetuate that?

Adam Chalmers

@jsbarretto I generally agree -- I really liked the talk about keyword generics at Rustconf this year, IMO the proposal would fix a lot of problems. But I don't think we should be delaying important async features to make them play better with a theoretical future. Even if the keyword generics design is great, implementing it could take a long long time, and impling async iterators should be decoupled from KW generics.

Go Up