tinkralge

@[email protected]

This profile is from a federated server and may be incomplete. View on remote instance

tinkralge OP , to Programming in RFC: Suggestion to monetise without ads

Extra support could be added to try and retrieve the FUNDING file when browsing source forges. Good idea.

I read about Brave Rewards. It's definitely not something I aim to replicate as a whole. Maybe they have nifty distribution methods worth copying? Would be interested in that.

tinkralge OP , to Programming in RFC: Suggestion to monetise without ads

I look forward to the feedback :) Enjoy your vacation!

tinkralge OP , to Programming in RFC: Suggestion to monetise without ads

Why? If the tracking picks it up, then it'll be up to the user whether they want to transfer money via those methods. Someone did make me think that filtering donation methods would be useful. So if there are website that use a donation method you disapprove of or do not support, you don't have to transfer money to them.

tinkralge OP , to Programming in RFC: Suggestion to monetise without ads

I remember seeing this and losing track of it a year or more ago. But the ecosystem seems to have died about 2 years. Libraries are all 2+ years old. The downside I see with it is that it requires signing up to join the system, which is surely a blocker for many people. First you have to know about it, then you have to trust it, and then you have to find the people who use it.

That said, I love the idea of being able to pay for anything with your web-browser. How far away we are from it though, I don't know. The name "interledger" is also unfortunate as it immediately makes you think "crypto", which will probably turn off a lot of people to the wallet.

It isn't clear to me how the connection to the bank is actually made. Gatehub for example says SEPA and Wire transfers work, but so do XRP, and bitcoin. The wallet seems to be held by them, but does that make them a bank? Maybe I'm thinking to much about it...

Maybe it warrants another look. But I do think that connecting the current world to easy donations is important. Web monetisation could be added later once it becomes a standard.

tinkralge OP , to Programming in RFC: Suggestion to monetise without ads

Is the main issue really tracking and consolidating microdonations, or is it transferring credit between these donation systems and traditional finance entities like banks and credit card networks?

They are 2 main issues. As mentioned, you want to transfer the money to the right person, which means tracking (or collection, whatever term you want to assign to it). And you want to transfer in the first place. Since there are so many systems, and some that don't allow one-time donations, and people are all over the world, it definitely is a problem. That's why not doing it monthly but annually could help. But that does make me think that it should be possible for the user to filter donation methods. For example filtering out direct transfers to accounts outside of your region due to transfer costs. Thanks, I can add that.

Which regulatory compliance things would apply to this in its current form? Or do you mean that connecting to a user's bank account would incur the wrath of the authorities?

tinkralge OP , to LibreWolf in There seems to be a problem joining the matrix room

Thanks for reporting. I hope it'll get resolved!

tinkralge OP , to LibreWolf in There seems to be a problem joining the matrix room

Man... that's unfortunate. Thanks for the link!

tinkralge OP , to Linux in PSA: /c/linux has a matrix chat!

Sure, why not. I'm not the creator of the room 🙂

tinkralge OP , to Linux in PSA: /c/linux has a matrix chat!

I know that @Ategon@programming.dev avatar Ategon is there. Maybe he can make you a mod there too? And the channel could be added to the sidebar of this community too.

tinkralge , to Rust in What are you working on this week? (Mar. 31, 2024)

This week some more work was done on inheriteRS to support inheriting non-trait implementations of functions.

Basically


<span style="font-weight:bold;color:#a71d5d;">use </span><span style="color:#323232;">inheriters::specialisations;
</span><span style="color:#323232;">
</span><span style="color:#323232;">specialisations!(
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">struct </span><span style="color:#323232;">Parent {
</span><span style="color:#323232;">        attr1: </span><span style="font-weight:bold;color:#a71d5d;">u8</span><span style="color:#323232;">,
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">impl </span><span style="color:#323232;">Parent {
</span><span style="color:#323232;">        </span><span style="font-weight:bold;color:#a71d5d;">fn </span><span style="font-weight:bold;color:#795da3;">from_parent</span><span style="color:#323232;">(self) -> </span><span style="font-weight:bold;color:#a71d5d;">u8 </span><span style="color:#323232;">{ </span><span style="color:#0086b3;">8 </span><span style="color:#323232;">}
</span><span style="color:#323232;">        </span><span style="font-weight:bold;color:#a71d5d;">fn </span><span style="font-weight:bold;color:#795da3;">overridden</span><span style="color:#323232;">(self) -> </span><span style="font-weight:bold;color:#a71d5d;">u8 </span><span style="color:#323232;">{ self.attr1 }
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">    
</span><span style="color:#323232;">    #[inherit(Child)]
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">struct </span><span style="color:#323232;">Child {
</span><span style="color:#323232;">        attr2: </span><span style="font-weight:bold;color:#a71d5d;">u8</span><span style="color:#323232;">,
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">impl </span><span style="color:#323232;">Child {
</span><span style="color:#323232;">        </span><span style="font-weight:bold;color:#a71d5d;">fn </span><span style="font-weight:bold;color:#795da3;">overridden</span><span style="color:#323232;">(self) -> </span><span style="font-weight:bold;color:#a71d5d;">u8 </span><span style="color:#323232;">{ self.attr2 }
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">);
</span>

results in


<span style="font-weight:bold;color:#a71d5d;">struct </span><span style="color:#323232;">Parent {
</span><span style="color:#323232;">    attr1: </span><span style="font-weight:bold;color:#a71d5d;">u8</span><span style="color:#323232;">,
</span><span style="color:#323232;">}
</span><span style="font-weight:bold;color:#a71d5d;">impl </span><span style="color:#323232;">Parent {
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">fn </span><span style="font-weight:bold;color:#795da3;">from_parent</span><span style="color:#323232;">(self) -> </span><span style="font-weight:bold;color:#a71d5d;">u8 </span><span style="color:#323232;">{ </span><span style="color:#0086b3;">8 </span><span style="color:#323232;">}
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">fn </span><span style="font-weight:bold;color:#795da3;">overridden</span><span style="color:#323232;">(self) -> </span><span style="font-weight:bold;color:#a71d5d;">u8 </span><span style="color:#323232;">{ self.attr1 }
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="font-weight:bold;color:#a71d5d;">struct </span><span style="color:#323232;">Child {
</span><span style="color:#323232;">    attr1: </span><span style="font-weight:bold;color:#a71d5d;">u8</span><span style="color:#323232;">, </span><span style="font-style:italic;color:#969896;">// new
</span><span style="color:#323232;">    attr2: </span><span style="font-weight:bold;color:#a71d5d;">u8</span><span style="color:#323232;">,
</span><span style="color:#323232;">}
</span><span style="font-weight:bold;color:#a71d5d;">impl </span><span style="color:#323232;">Child {
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">fn </span><span style="font-weight:bold;color:#795da3;">from_parent</span><span style="color:#323232;">(self) -> </span><span style="font-weight:bold;color:#a71d5d;">u8 </span><span style="color:#323232;">{ </span><span style="color:#0086b3;">8 </span><span style="color:#323232;">} </span><span style="font-style:italic;color:#969896;">// new
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">fn </span><span style="font-weight:bold;color:#795da3;">overridden</span><span style="color:#323232;">(self) -> </span><span style="font-weight:bold;color:#a71d5d;">u8 </span><span style="color:#323232;">{ self.attr2 }
</span><span style="color:#323232;">}
</span>

There might be some clean-up necessary code-wise and the README has to be expanded. But the project is well on its way to version 1! It’s a pity codeberg doesn’t have easy CI/CD yet nor domain hosting e.g inheriters.codeberg.io or something. So auto-formatting, testing, auto-tagging, etc. will have to come once I can convince myself to setup a VPS somewhere that hosts all that.

tinkralge , to Rust in What are you working on this week? (Mar. 24, 2024)

That sounds like fun! Wow. How stable is it at the moment?

tinkralge , to Rust in What are you working on this week? (Mar. 24, 2024)

Working on some form of inheritance in rust. It’s my first foray into procedural macros and so far it’s fun. The idea is quite simple: generate structs with common attributes (and eventually functions) instead writing them yourself.


<span style="font-weight:bold;color:#a71d5d;">use </span><span style="color:#323232;">inheriters::specialisations;
</span><span style="color:#323232;">
</span><span style="color:#323232;">specialisations!(
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">struct </span><span style="color:#323232;">Parent {
</span><span style="color:#323232;">        attr1: </span><span style="font-weight:bold;color:#a71d5d;">u8</span><span style="color:#323232;">,
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">    #[inherit(Child)]
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">struct </span><span style="color:#323232;">Child {
</span><span style="color:#323232;">        attr2: </span><span style="font-weight:bold;color:#a71d5d;">u8</span><span style="color:#323232;">,
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">);
</span>

becomes


<span style="font-weight:bold;color:#a71d5d;">struct </span><span style="color:#323232;">Parent {
</span><span style="color:#323232;">    attr1: </span><span style="font-weight:bold;color:#a71d5d;">u8</span><span style="color:#323232;">,
</span><span style="color:#323232;">}
</span><span style="font-weight:bold;color:#a71d5d;">struct </span><span style="color:#323232;">Child {
</span><span style="color:#323232;">    attr1: </span><span style="font-weight:bold;color:#a71d5d;">u8</span><span style="color:#323232;">,
</span><span style="color:#323232;">    attr2: </span><span style="font-weight:bold;color:#a71d5d;">u8</span><span style="color:#323232;">,
</span><span style="color:#323232;">}
</span>

not


<span style="font-weight:bold;color:#a71d5d;">struct </span><span style="color:#323232;">Parent {
</span><span style="color:#323232;">    attr1: </span><span style="font-weight:bold;color:#a71d5d;">u8</span><span style="color:#323232;">,
</span><span style="color:#323232;">}
</span><span style="font-weight:bold;color:#a71d5d;">struct </span><span style="color:#323232;">Child {
</span><span style="color:#323232;">    attr1: </span><span style="font-weight:bold;color:#a71d5d;">u8</span><span style="color:#323232;">,
</span><span style="color:#323232;">    parent: Parent,
</span><span style="color:#323232;">}
</span>

The latter leads to indirection which I’m not a fan of.

Last week I squashed one bug on the order of attributes according to inheritance. In the example above attr2 was coming before attr1. A feature is nearly done to exclude the Parent from the output and only output the child. That’s useful for parents that just serve as holders for shared attributes.

The goal for v1 was to also support basic inheritance of implementations: Parent has an impl block, then that block is copied for the Child. Not sure yet if I’ll implement overrides in v1 or v2. Overrides being if Parent implements do_something() and Child does too, then the implementation of Parent is not copied into the impl block.
That’s what I’ll try to tackle in the coming weeks.