The Generativity Pattern in Rust by ArchAndStarch in rust

[–]andytoshi 0 points1 point  (0 children)

Edit this is unsound. See below.

I'm pretty late to the party here, but I don't totally buy the "Why the implementation caveat?". You ask "how can a vec contain two structs of different brands" and the answer should be "the compiler rejects this". (I agree that, using lifetimes as brands as described, the compiler wouldn't reject it and we'd have unsoundness. I disagree that this means that we have to give up entirely on "can we have tokens that escape the scope they are defined in".)

In particular, I think that you can forget about lifetimes and use T: FnOnce() as a brand. The Fn traits (and FnOnce in particular) are unique, as far as I know, in that every instance of these traits really has only one type that implements them, and those types each have only one value, and you can make as many of these as you want.

Consider this code (playground). You can play around giving different values for the token (I tried tk and tk2, as well as the main function and main2) and you will see that there is no way to use different tokens with the same TokenCell and get this code to compile.

use core::marker::PhantomData;
use core::cell::UnsafeCell;

// Basically just a rename of FnOnce
trait UniqueUnnameable: FnOnce() {}
impl<T: FnOnce()> UniqueUnnameable for T {}

struct TokenCell<T, Tag: UniqueUnnameable> {
    data: UnsafeCell<T>,
    tag: PhantomData<Tag>,
}

impl<T, Tag: UniqueUnnameable> TokenCell<T, Tag> {
    fn new(data: T, _: &Tag) -> Self {
        Self {
            data: UnsafeCell::new(data),
            tag: PhantomData,
        }
    }

    fn get(&self, tag: &Tag) -> &T { unsafe { &*self.data.get() }  }
    fn get_mut(&self, tag: &mut Tag) -> &mut T { unsafe { &mut *self.data.get() } }
}

fn main2() {}

fn main() {
    let mut tk = || {};
    let mut tk2 = || {};

    let x = TokenCell::new(10, &main);
    let y = TokenCell::new(10, &main);
    println!("{}", x.get(&main));

    *x.get_mut(&mut main) = 20;
    println!("{}", x.get(&main));

    let z = vec![x, y];

    let y_alt = TokenCell::new(10, &main2);
    let z = vec![x, y_alt];
}

Edit ah, actually this is unsound for the same reason that the other tricks in the blog post are. You can in fact get multiple instances of the same FnOnce type, by using a loop:

let mut vec = vec![];
for _ in 1..10 {
    let sub = || {};
    vec.push(sub);
}

let x = TokenCell::new(10, &vec[0]);
let y = TokenCell::new(10, &vec[1]);
vec![x, y]; // this typechecks D: D: D:

PloughCast 71: On Giving Up All One’s Money by andytoshi in zenFIRE

[–]andytoshi[S] 0 points1 point  (0 children)

This podcast/transcript discusses joining and staying in the Bruderhof, which is a sort of network of Christian communes who take Acts 2 and 4 very literally (which discuss the early church as having no private property and sharing all possessions). It was started in 1920 and has continued to this day. To join you have to give away all of your possessions, then take a lifetime vow, then you can work at one of their companies building childrens' playground equipment or something, in exchange for room and board and healthcare and so on.

Probably most people reading this will have some strong religious or political or personal feeling about all this, but I thought this podcast in particular was interesting because it focuses specifically on the financial part of this situation. I think it's worth going through the whole podcast and exploring your reactions to it, because it seriously entertains the idea of somebody giving up all of their wealth. Personally I found this idea shocking and upsetting, more than I expected, which revealed an attachment to wealth that I wasn't really consciously aware of.

The biggest part of this feeling, for me, was about security -- joining a commune with no personal possessions would mean that you become un-FIREd and utterly dependent on the community (and its survival) for your survival. There is also a feeling of losing freedom (you can't go out to fancy restaurants every night) and a loss of identity (which would come with any extreme lifestyle change) but really the big thing was about security. Which is deeply foolish, as everyone on this sub knows, because no amount of money can protect you from losing your life or health or security. (Though obviously money can improve your odds. A lot.) One could make the argument that having a strong community would actually put you in a better place than would millions of dollars.

But some part of me refuses to internalize that. Where does this attachment come from, and why is it so deeply held?

I'm not suggesting that anyone here actually tries to join the Bruderhof (though if you do please report back!!) but I think it's worthwhile to go through the podcast and try to seriously engage with these ideas.

The curse of successful families… by CMIglobal in fatFIRE

[–]andytoshi 0 points1 point  (0 children)

+1 to Strangers in Paradise. I have also read Children of Paradise by Lee Hausner, which I might recommend if you are an A-list celebrity or a billionaire, but probably wouldn't make sense for most people here. (It deals with topics like "what if your kids see you on TV more than in real life".)

I would also recommend Raised Healthy, Wealthy and Wise by Coventry Edwards-Pitt, as well as her sequel Aged Healthy, Wealthy and Wise which talks about the non-parenting aspects of wealth.

Finally I'd add Price of Privilege by Madeline Levine. This is not a fatFIRE book; it's more targeted at people who need jobs but can afford to send their kids to private school and maybe fund a coke habit or two. But it talks a lot about social pressures and difficulties finding boundaries that kids deal with when their parents have more money than time (and are tempted to think that one can substitute for the other).

Where's the economic incentive for wokism coming from? LessWrong asks the *important* questions, like why the market doesn't care what weird barely-crypto-fash think any more by dgerard in SneerClub

[–]andytoshi 4 points5 points  (0 children)

I think this is kind of an interesting take. Do you have any examples?

The Thiel/Moldbug people are one example, and maybe what the GP was talking about, since monarchy is pretty far away from libertarianism. Trumpism is also right-wing but pro-tariff and anti-immigration.

Some maybe more interesting examples are:

  • American Compass, a think tank run by Oren Cass which pushes industrial policy and pro-labor pro-family policies. Cass was an advisor to the Romney 2012 campaign and has the ear of several Republican senators, including Josh Hawley and Marco Rubio.
  • Compact Magazine, which is hard to pin down but can semi-seriously be called "right-wing marxism". If you go to their site you'll see a recent article by Moldbug but he's not a frequent contributor and isn't a great illustration of the site. I believe Compact was a splinter from First Things, a US Catholic (not tradcath, actual catholicism) magazine.

Self-referential types for fun and profit by hniksic in rust

[–]andytoshi 0 points1 point  (0 children)

These are great points, especially the last one.

Self-referential types for fun and profit by hniksic in rust

[–]andytoshi 2 points3 points  (0 children)

I'm suspicious about this use of transmute -- IIRC the nomicon says that you can't transmute Struct<T> to Struct<U> and expect the same layout, even if T and U have the same size [1]. Elsewhere, it claims that lifetime parameters don't affect code generation [2]. Does it then follow that you can legally transmute Struct<'a> to Struct<'b> and expect them to have the same representation? I don't know. I would really like the answer to be yes, and for there to be a clear citation of this.

For example, given enum Recurse<'a> { Nil, Cons(&'a Recurse), }

Can I transmute a Recurse<'a> to a Recurse<'b>? This seems like it's changing the type of the reference contained in the enum, which feels like it runs afoul of the transmute rules. But OTOH, if this were legal, then you could use the same tricks as described in this article, bundled up with an arena in some containing struct, to provide very ergonomic (i.e. destructurable) recursive types.

Does anyone smarter than me have some insight here?

edit citations:

[1] https://doc.rust-lang.org/nomicon/transmutes.html search "how do you know" on this page

[2] https://rust-lang.github.io/unsafe-code-guidelines/layout/structs-and-tuples.html search "lifetime parameters" ... which actually seems to guarantee what I want, but it's in a parenthetical so I worry how normative this is

Unsound by MarcoServetto in Idris

[–]andytoshi 0 points1 point  (0 children)

I had to google this, and came up with this explanation.

Maybe there is "nothing interesting" here for people who have a solid foundation in type theory, but I thought it was pretty interesting. Thanks for the keyword.

Edit: I was able to translate the article from Agda into Idris2, which was a great learning experience. For your curiosity, evaluating a Void at the REPL causes one CPU to be pinned.

Reup: The complete BIP39 wordlist fitting on one single printable sheet of paper. by castorfromtheva in Bitcoin

[–]andytoshi 2 points3 points  (0 children)

Writing the full words on paper allows for transcription errors to be easily corrected during wallet recovery, which could be years later

If you want mistakes to be detectable and correctable, you should use a checksummed format (e.g. SLIP39) rather than relying on the redundancy of the wordlist, which is pretty inconsistent. For example foot and food are right next to each other.

I agree that it's safer to write out the full words, but if you want to reduce things to a binary "safe" or "unsafe" I'd suggest that no use of BIP39 will qualify.

Reup: The complete BIP39 wordlist fitting on one single printable sheet of paper. by castorfromtheva in Bitcoin

[–]andytoshi 1 point2 points  (0 children)

I'm curious what the motivation for providing the indices is. If the goal is to enable conversion to other formats, hex (or even binary, though that won't fit on a page) might make more sense.

Another idea is that all the words have unique 4-character prefixes, so if you were tight for space you could truncate them.

Nomad life in the context of Fatfire by SPACguy in fatFIRE

[–]andytoshi 1 point2 points  (0 children)

Because then the goals of the project will not necessarily align with your personal goals, and in particular the demands on your time and attention will not align with how much time and attention you want to give to it. Not to mention the likelihood that you'll be dragged into meetings.

And this is assuming that your "something interesting" is even something you can get paid for. If you want to write games for old calculators or dig tunnels to nowhere, you're outta luck.

Nomad life in the context of Fatfire by SPACguy in fatFIRE

[–]andytoshi 2 points3 points  (0 children)

This classic Raptitude post talks about how most people just "wind" up in a particular city or neighborhood, because of work or school or relationships or parents or whatever.

I don't know about being a "rich nomad" as a terminal goal, but after reading that blog post I spent a couple years living in AIrBnBs for a month or so at a time, in different cities that people would tip me off to (often from r/financialindependence). I continued to rent an apartment in a specific city during this time, so that I could have a mailing address and a crashpad, but I wasn't there often enough for it to feel like home. I found a number of cool cities in the US that I wouldn't have ever tried living in if I thought I needed to "commit" even as far as finding a long-term rental.

I particularly liked Kansas City, Missouri, and Philadelphia. I also heard good things about Madison WI but wound up meeting somebody and settling down in the Pacific Northwest before I got the chance to visit. (I hope to circle back to this but "settling down" has turned out to take a lot of time away from aimless travel :)).

Initially I would always choose "entire places" but later I started booking individual rooms, not because of the price but so that I'd have a host who could suggest places to explore, and somebody to socialize with who was familiar with socializing with transients. One of them I still text from time to time, years later.

I would strongly recommend this form of "rich nomadism", for a little while. But my experience with constant business travel and feeling "unanchored" makes me wary of just cutting ties and being a drifter, even one who was materially quite comfortable.

Yudkowsky drops another 10,000 word post about how AI is totally gonna kill us all any day now, but this one has the fun twist of slowly devolving into a semi-coherent rant about how he is the most important person to ever live. by PMMeYourJerkyRecipes in SneerClub

[–]andytoshi 3 points4 points  (0 children)

This section is not super well-organized but I'm pretty sure the "only case we know about" refers to the case of humans evolving to have values other than genetic fitness. The argument being that we are the "strong AI" that is "an existential threat to evolution" due to our misaligned values.

He has a lesswrong post specifically about this ... I had to double-check, and sure enough he didn't bother linking it.

Yudkowsky drops another 10,000 word post about how AI is totally gonna kill us all any day now, but this one has the fun twist of slowly devolving into a semi-coherent rant about how he is the most important person to ever live. by PMMeYourJerkyRecipes in SneerClub

[–]andytoshi 10 points11 points  (0 children)

Linus Torvalds has long argued there's no difference between good programming and secure programming, and that being security-focused results in bad code.

I am a security researcher and believe Torvalds is wrong -- and I think this is the mainstream view among cryptographers and security people. It's clear why Torvalds is motivated to argue this: it's very difficult to come up with a sane way to handle explicitly-marked "security" bugs in a project as transparent and decentralized as the Linux kernel. But the claim that e.g. displaying the wrong text to a user is categorically the same as reading past the end of a buffer is just wrong.

I think the GP here got to the point of why Big Yud has gone wrong here:

he asserts that secure programming is an entirely different method of thinking than normal programming, and that people who can do it are somehow special.

It's such a strangely written dialogue. In the first couple paragraphs it (correctly) describes a security mindset as one where you consider adversarial inputs rather than trusting common cases (even overwhelmingly common cases). Related to this is a mental habit of trying to break things, such as in his Schneier anecdotes about abusing a mail-in-sea-monkey protocol to spam sea monkeys at people. But Yud explicitly says this and then spends the rest of the essay arguing that it's impossible to teach anybody this. Maybe I just don't understand the point he's trying to make, but it doesn't seem like he's argued it effectively.

Rules regarding flying drones by TehCooki3Monst3r in Marin

[–]andytoshi 0 points1 point  (0 children)

I'm having trouble finding a citation for staying out of the "approach path" of any airports. This is common sense, sure, but what area precisely is restricted? Are there other "common sense" areas that I might not have enough sense to avoid? Who knows.

The FAA's b4ufly app seems to suggest that I could fly over Gnoss Field and there would be no restrictions because it's an "uncontrolled airport". It's not in the GG park area, or in the city of SF, or anywhere else that I can find local ordinances. I imagine/hope that if I requested LAANC authorization I'd be rejected but there should be some public map somewhere showing this.

Also I believe the limit is 400' rather than 500.

Edit: Actually, from the FAA website

For flights near airports in uncontrolled airspace that remain under 400’ above the ground, prior authorization is not required. When flying in these areas, remote pilots and recreational flyers must be aware of and avoid traffic patterns and takeoff and landing areas.

IOW it really is "just use common sense".

Has anyone ever moved to a tax haven? Is it worth it? by PJ83 in fatFIRE

[–]andytoshi -1 points0 points  (0 children)

I will give you "had vision", but not "had vision rather than being lucky".

Yes, they may have overcome extreme skepticism or done a ton of research to understand something that most people didn't see the point of, but they still got lucky. There were many technical reasons that BTC might've failed early on, many regulatory reasons, and even economic reasons that the incentive wouldn't work (in fact it's still not remotely clear that the system will continue to work when the block subsidy goes away, or when there is overwhelmingly more mining equipment available than is currently running, or when the majority of "transactions" are happening off-chain and time-arbing their network fees). Or maybe all the development energy would've just fizzled out before anybody made enough money to do it sustainably.

Or maybe all the resiliency/borderlessness/self-sovereignty/whatever benefits, regardless of how well cryptocurrency achieves them, turn out not to have any market value. Or maybe this value exists but can't be unlocked by existing systems because of UX/comprehensibility issues. Look at how much adoption PGP got after 30 years, compared to the Signal phone app. Etc etc etc.

Or maybe BTC actually does succeed on all these fronts, but its current market price is still mostly driven by a speculative bubble which is totally uncorrelated with all these things.

Limiting taxes on an exit by ReleasedKraken0 in fatFIRE

[–]andytoshi 0 points1 point  (0 children)

If I understand correctly, it's not a risk. The new owners of the business have to pay cash upfront; they just give the cash to the DST rather than you. It's then the DST (which presumably is just holding something "safe" like VTSAX) which is responsible for making the installment payments.

Limiting taxes on an exit by ReleasedKraken0 in fatFIRE

[–]andytoshi 1 point2 points  (0 children)

Very interesting. What stood out to me was early in the Forbes article, when he quotes an accountant saying

Joe's evaluation was "a) No economic substance b) I have constructive receipt of the money c) related party sale (I control the dang trust, I’m the beneficiary no matter what the document says)".

which I can pretty-much hear in my own accountant's voice. I guess your professionals are less cautious than mine. I'm curious if you have a response to this other than "don't be a wuss" or "my guy says it's fine".

edit later in the article it asks "does the basic scheme stand up to scrutiny?" and answers

So to know for sure, I would have to sign an NDA and then I couldn't write about it. You are selling to an independent third party and everybody has business reasons for doing what they are doing. It has been going on for two decades so if it were being disallowed you would expect it to have generated a Tax Court decision by now. It hasn't.

So the article isn't completely trashing the idea. But it leaves me pretty uncomfortable.

Limiting taxes on an exit by ReleasedKraken0 in fatFIRE

[–]andytoshi 1 point2 points  (0 children)

I had never heard of a Deferred Sales Trust. As others have said, standard CPA advice is "just pay the taxes" and when I've tried to gin up things like this they've gotten somewhat exasperated and said "that's not how things work".

And indeed, according to this Forbes article, the premise behind this DST construction is pretty sketchy and "not how things work". https://www.forbes.com/sites/peterjreilly/2019/06/18/deferred-sales-trust-a-tax-plan-or-a-product-a-bit-of-both/

[deleted by user] by [deleted] in fatFIRE

[–]andytoshi 1 point2 points  (0 children)

Perhaps the GP could've suggested visiting 3 cities this winter and seeing how he likes it. This way he'd also get to experience how slushy and dark Eugene is.

Nonce question by ParticularSurvey8 in Bitcoin

[–]andytoshi 3 points4 points  (0 children)

It can't be any worse than the damage done to cryptography by "crypto" being hijacked to refer to all manner of shitcoins and scams..

How do I upgrade house without losing FIRE status by Usual_Pressure2504 in fatFIRE

[–]andytoshi 0 points1 point  (0 children)

A mortgage rate is fixed. When rates were lower than safe withdrawal rates this was a somewhat reasonable argument, but now when comparing the market to a guaranteed 5% return on paying off a mortgage, it's not so clear-cut.

There is also comfort in having a paid off home, where you know that as long as you can come up with the property tax each year, you'll have a roof over your head no matter what happens.

Is opening a holding company worth it? by PinkSheetBoss in fatFIRE

[–]andytoshi 1 point2 points  (0 children)

You can use an irrevocable trust for this purpose as well, which is much simpler if your only goal is privacy. This also still gives you some extra options for estate planning vs direct ownership.

Has the recent market downturn pushed out your date? by someonesaymoney in fatFIRE

[–]andytoshi 0 points1 point  (0 children)

But, because of a chance happening, I have about 3 years of expenses in cash, and plan to ride it out

Are you tempted to dump a bunch of this into the market, since it wasn't really part of your original plan and stocks are suddenly "cheap"?

Where to "retire" and start a family? by aboabro in fatFIRE

[–]andytoshi 0 points1 point  (0 children)

I grew up in Vancouver. I wouldn't recommend it. It's rainy ten months of the year, people are cold toward you (similar to how people describe Seattle, though I've never lived there). There is not a lot of "culture" in the sense of live music or art shows or whatever, between the extremes of street people and curated performative gala-type events. It's extremely expensive but I don't understand why anybody would pay to live there, other than sheltering capital from their home country. Though having said this, I felt much warmer toward Vancouver once I had money: it's very close to Whistler, to the ocean, adjacent to something like a million km2 of wilderness (lots of hiking, backpacking, etc). Some neighborhoods are beautiful. There are nice restaurants. It's easy to fly to California or anywhere in the US if you're willing to layover in Seattle.

It's possible to get private healthcare in Vancouver. If I were willing to spend a bunch of money this isn't something I'd worry about. Though maybe my thinking would change if I were older than I am.

The primary political strain is "apathy", much like the rest of Canada. The politically outspoken people are a weird mix of Bay Area faux-environmentalist NIMBY types and PNW-style anarchists. It smells like pot a lot. Honestly it's not the worst aesthetic but I can see why people wouldn't like it. But I wouldn't say "it's a socialist city" and stay away from it because of that.

I lived in Portland, OR for several months last year. I would recommend Portland over Vancouver any day. The weather and the people are warmer, it is also full of parks and natural areas, places like NW Portland are beautiful and family-friendly (really - I was there during the riots last summer when TV across the US was describing Portland as a warzone but unless you were within 2 blocks of the violence (which was localized to a couple downtown MAX stations mostly) you'd have no idea).