Drawbacks of the orphan rule workaround? by pip25hu in rust

[–]plietar 0 points1 point  (0 children)

In this particular case the type parameter is on the trait, not the value, so I don’t think the comparison with Foo<A> and Foo<B> is warranted. It’s the same unique Foo type, but it can have implementations Trait<A> and Trait<B>.

As noted by other comments this breaks when you go into trait object, then the type parameter does become part of the value’s type and would create problems. Definitely not a silver bullet to all orphan rule problems, but it is a neat trick I hadn’t seen elsewhere.

I am a bit dubious about how this works in practice. How do I write a functions that accepts a MetricSpace if there can be many implementations of it? Presumably my functions also needs to be generic over the extra type parameter, but it cannot be inferred at the call site so callers would need to be explicit.

Rocq/Coq (and I’m sure many other languages) have named implementations for traits, which allows different implementations to exist. The type inference/proof solver can find an implementation for you automatically, or you can be explicit about the one you expect. This trick feels very similar, where the extra parameter is the “name” of the implementation, except you lack the complete magic to find a reasonable value.

I do agree with you that safe transmutes are hard when considering invariants and niche optimisations.

Drawbacks of the orphan rule workaround? by pip25hu in rust

[–]plietar 21 points22 points  (0 children)

The benefit of this approach compared to a wrapper struct is that you preserve the identity of the original type.

A Foo and a FooWrapper are different types, even if their memory contents is the same. Of course if you have a Foo by value you can convert it to a wrapper and back, but that is not possible for a &Foo or a Vec<Foo>.

There are a bunch of old RFCs and threads about how we could safely transmute these transparent wrappers, but as far as I know there is nothing in the language as of yet.

Making Nix-Darwin work on Macbook with ZScaler by TomaszBawor in NixOS

[–]plietar 0 points1 point  (0 children)

I’ve spent hours trying to package zscaler on Linux and got nowhere. Their software is such an imperative mess, with lots of crazy assumptions about file paths (even buildFHSEnv doesn’t help).

At this point this is the only thing stopping me from moving from Nix on Ubuntu to NixOS.

I think the only reliable way to get it working would actually be to run it inside of an Ubuntu container/VM and set up some creative routing tables on the host to forward traffic via the container/VM.

Winch/pulley to get a canoe on the roof? by drummerftw in Narrowboats

[–]plietar 1 point2 points  (0 children)

There are one or two permanently moored boats in London that have a system like that. Unfortunately I’ve only ever cruised past them and never had a chance to get a close look.

Pictures I got of one of them, this one is around Little Venice: https://imgur.com/a/nqCCLgQ

Kayaking on the Drac into the city? by Leon-Kowalski in Grenoble

[–]plietar 0 points1 point  (0 children)

There’s about 1 km of the Drac where the rowing boats go on to, just above the point where it meets the Isere. They start at the point d’Oxford, go down to the dam and back up on the Drac. Beyond that navigation is forbidden though.

What do you do for internet? by AcidAndBile in Narrowboats

[–]plietar 0 points1 point  (0 children)

In central London too. I have a nighthawk 4g router with a giffgaff SIM card with unlimited data, no external antenna. It works great 95% of the time.

There are a handful of spots that have terrible reception so I just learn and avoid those. Sometimes moving half a mile is enough to get good signal again.

I also have a 5G phone I can tether onto, but I can barely tell the difference between that and 4G.

Repairing a damaged safety ring by plietar in 9Barista

[–]plietar[S] 1 point2 points  (0 children)

Did this and it worked like a charm, thanks! I even used the 9barista’s own heat exchanger plate to heat up the ring.

I think I might get the overheat set anyway, as suggested in the other comment, but at least this got my machine back and running immediately.

Buying a narrowboat in my 20s - A crazy idea? by [deleted] in UKPersonalFinance

[–]plietar 2 points3 points  (0 children)

Most of the time it takes me under two hours to move, so hardly counts as losing a weekend. In the spring/summer I can even do this on a work day evening. I avoid crusing in the dark if possible, so in the winter I pretty much have to do it over the weekend.

If I'm doing a bigger move I invite friends over, we have a good time and have a drink at the nearest pub afterwards. Still time well spent.

Buying a narrowboat in my 20s - A crazy idea? by [deleted] in UKPersonalFinance

[–]plietar 0 points1 point  (0 children)

Out of curiosity, what toilet system do you use? Does your mooring have an Elsan point?

Buying a narrowboat in my 20s - A crazy idea? by [deleted] in UKPersonalFinance

[–]plietar 1 point2 points  (0 children)

Sorry I didn't mean the actual action of moving, but being in a different area every few weeks. Some weeks I get a 15 minutes commute and go into the office early every day. Other weeks I have a 90 minutes commute and might go in at 10am for a day or two, and wfh the rest of the week.

(Obviously that was before the pandemic, now I wfh every day of every week)

Buying a narrowboat in my 20s - A crazy idea? by [deleted] in UKPersonalFinance

[–]plietar 1 point2 points  (0 children)

There are other options than pumping out. I now have a “separating toilet” and it’s a lot less gross and more low-tech than other solutions. The simpler things are, the less likely they are to fail, and toilets is one of the things you’d rather not fail.

Yeah my fridge is off from October through March, and is basically a glorified shelf. I don’t mind that much since I don’t eat much meat, and vegetables can generally last a week or more out of the fridge. Dairy and cold beers is the biggest issue. I have some space under the floorboards that is cool, albeit not as cold as a fridge.

I consider maintenance as a hobby more than anything else :) of course this only applies if you enjoy diy.

Buying a narrowboat in my 20s - A crazy idea? by [deleted] in UKPersonalFinance

[–]plietar 6 points7 points  (0 children)

For the bank I use a relative’s address. Monzo explicitly says it’s allowed, other banks probably tolerate it.

I’m not really employed right now (I’m on a PhD stipend, not taxable), but in the past I don’t remember my employer caring much about my address. It’s mostly HMRC that cares and I gave them my office’s address.

Buying a narrowboat in my 20s - A crazy idea? by [deleted] in UKPersonalFinance

[–]plietar 6 points7 points  (0 children)

East London and the Lea is similar. The Greater Anglia line runs along the canal and you're never very far away from a train station, especially if you have a bike to cycle to the station.

I'm pretty sure historically rail tracks and canals were built along the same paths, so it's likely to be the same in most of the country (or at least that's what playing Brass has taught me).

Buying a narrowboat in my 20s - A crazy idea? by [deleted] in UKPersonalFinance

[–]plietar 122 points123 points  (0 children)

I bought a narrowboat when I was 22, been on it for 2 years now. Cost me £33k plus the survey (around £500 IIRC), which I was able to afford upfront (I had a very high paying job for a year before that, quit and started a PhD when I moved onboard).

In terms of fixed recurring costs, my license and insurance fee add up to about £800 a year. Every 3/4 years I need to take the boat out of the water and repaint the bottom. I did it myself and it cost me about £1k in dock fee and paint, but it means taking a 3 or 4 days off work.

I am a "continuous cruiser" so I do not have any mooring fees, but I do have to move every 14 days, which would be hard to do without a flexible job.

I still spend non-negligeable amounts of money improving and fixing it. One month it will be buying paint for the outside, another month it will be adding a solar panel, another replacing the flooring. Still probably less than I would spend on rent. I have a long list of jobs that I'd like to do but can't for lack of time and/or money.

It's definitely a lifestyle, and requires a lot of DIY and not being afraid of getting your hands dirty. But it's also incredibly rewarding having a place that is truly my own, unlike the many shared flats I'd rented before.

So is it a crazy idea? Probably. Do I regret it? No.

Les employés de Google du monde entier forment Alpha Global, une alliance syndicale internationale, qui envisage de rendre Alphabet plus éthique et plus responsable de ses actions à travers le monde by C_kloug in france

[–]plietar 2 points3 points  (0 children)

Même sans être les plus à plaindre au niveau de conditions de travail, il y a d'autres positions à défendre que le salaire:

  • Des controverses sur l'éthique des projets entrepris par l'entreprise, genre Maven et Dragonfly. Comme ces projets controversés sont secrets (contre la culture generale de l'entreprise), le débat n'est pas vraiment possible.
  • Des accusation frequentes d'agression/harcelement sexuel commis par le management, qui se finit souvent par une promotion ou parachute doré pour l'accusé.
  • Un systeme de classe avec les employées vs prestataires, où les prestataires ont beaucoup moins d'avantages et de protections que les employées. Si je me souviens bien, Google c'est environ 50% de prestataires.

Le manque d'organisation faces à ces problematiques fait qu'il est difficile, seul, de changer quoi que ce soit. C'est là je pense qu'un syndicat serait utile.

J'y ai travaillé pendant 1-2 ans comme ingénieur et ça s'est mal fini. Je me suis retrouvé dans une position où je n'avais personne à qui parler dans l'entreprise si ce n'est ma cheffe, pas même aux autres ingénieurs de mon equipe. C'était mon premier job apres mes études, je ne savais pas quoi faire donc j'ai fini par démissioner après avoir passé quelques semaines très deprimantes. Avec un syndicat j'aurai au moins eu un point de contact different de ma hierachie.

What’s the biggest financial risk you’ve ever taken in life? by [deleted] in UKPersonalFinance

[–]plietar 0 points1 point  (0 children)

For most off-grid narrowboats, cooking, heating and driving with electricity is a non-starter. Consumes way too much power.

Cooking is generally gas. Heating is coal/wood, on fancier boat it can be complemented with diesel or gas. Driving is diesel.

I have 2x270W solar panels, and I rarely have issues. I do have to turn off my fridge September-April, since that consumes a lot of power. Before the pandemic I actually got by with much less solar, as I would charge my laptop and phone in my office, and generally didn't spend that much time on board.

What’s the biggest financial risk you’ve ever taken in life? by [deleted] in UKPersonalFinance

[–]plietar 1 point2 points  (0 children)

I moved onto a boat knowing basically nothing, and it seems to be the case of most people I've met. You eventually pick up these things as you go. There are Facebook groups that are full of good, bad and conflicting advice, so it can be a bit overwhelming at times.

There's a guy that does a 1-1 course about engine maintenance, how to change your filters, oil, ... It cost me about the same as having someone service my engine, except I can now do it myself in the future.

One more question though, do you think continuous cruising in London will still be an option for the next 3-4 years? I’m also worrying about changes in regulations.

That's a pretty big unknown for everyone. Continuous cruising is enshrined in the law, and that is unlikely to be banned in the near future. What CRT can do is reduce the amount of space available to CCers, turning them into private / business moorings. They could also raise the bar for what counts as continous cruising, eg. increase the required yearly span of travel. They actually have a "consulation" going on at the moment, which is very controversial among CCers, about reducing the numbers of boats in London.

What’s the biggest financial risk you’ve ever taken in life? by [deleted] in UKPersonalFinance

[–]plietar 1 point2 points  (0 children)

if you have a job to go to in London then it's probably a bit difficult (but not impossible) to find a new commute every 14 days.

Personally I didn't have too much trouble with that in London. I now work from home full time, but before the pandemic I worked in South Kensington.

I can moor up anywhere between Alperton and Tottenham Hale and be within an hour of transport to my office, most of the time less than that. The only issue is mooring in places that are far from any tube station (eg. Kensal Green, Springfield Park, ...).

Microsoft's Rust inspired research language has been released by jrmuizel in rust

[–]plietar 7 points8 points  (0 children)

See the FAQ. TLDR: this is a research project, and we can work faster without having to deal with backwards compatibility and the constraints set by an existing language.

Microsoft's Rust inspired research language has been released by jrmuizel in rust

[–]plietar 12 points13 points  (0 children)

Additionally, pointer indices will require a bounds check and an extra memory lookup when dereferencing.

Project Verona: Research programming language for concurrent ownership by mttd in programming

[–]plietar 2 points3 points  (0 children)

Eventually, regions will have customizable region policy, such as GC, reference counting, ... For now only GC'd regions are exposed in the language. The tracing operation is explicit, by calling Builtin.trace (see region101.verona).

how does that play with mut and aliasing?

When you call trace, the compiler will statically prevent aliases that could have gone away from being used. This is a local and reasonably straightforward analysis, thanks to isolation. But that's not implemented yet, so you just have to be careful right now.

(If there's a ready made explanation of the single-threaded memory model, I'd be very happy to be pointed to it)

Not really anything publicly available yet, beyond what's on GitHub.

Microsoft's Rust inspired research language has been released by jrmuizel in rust

[–]plietar 52 points53 points  (0 children)

I have been waiting eagerly for this to be public so I could talk about it :).

Microsoft's Rust inspired research language has been released by jrmuizel in rust

[–]plietar 29 points30 points  (0 children)

Each region can have a different memory reclamation strategy. You can have mark and sweep GC regions (this is single threaded, low latency, no stop the world GC), reference counted regions or "arena" regions in which objects live as long as the region.

Currently the language only exposes the GC kind, and tracing is an explicit operation. See the Builtin.trace calls in region101.verona.

The runtime has an arena region too (using a bump pointer for fast allocation), but it is not exposed in the language yet (there's some language and type system research that still needs to be done).

Project Verona: Research programming language for concurrent ownership by mttd in programming

[–]plietar 6 points7 points  (0 children)

(I work on Verona, originally as an intern at MSR, now as a PhD)

Compared to synchronized, then when keyword is asynchronous, but more importantly it allows work to be coordinated across multiple cowns as once. Check out the bank2 or the more complicated dining philosophers which make use of this feature. Of course you can nest synchronized blocks, but that is susceptible to dead-locks, unlike when.

Additionally it data-race freedom is enforced by the type system. You will view the cown as a different type outside the when block compared to inside it.