Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)NO
Posts
0
Comments
856
Joined
2 yr. ago

  • By clear receiver it means there is only one function a name can point to. For instance you cannot have:

     rust
        
    struct Foo;
    impl Foo {
        pub fn foo(self) {}
        pub fn foo(&self) {}
    }
    
    
      
     
        
    error[E0592]: duplicate definitions with name `foo`
     --> src/lib.rs:5:5
      |
    4 |     pub fn foo(self) {}
      |     ---------------- other definition for `foo`
    5 |     pub fn foo(&self) {}
      |     ^^^^^^^^^^^^^^^^^ duplicate definitions for `foo`
    
    
      

    Which means it is easy to see what the function requires when you call it. It will either have self or &self and when it is &self it can auto reference the value for you. This is unlike C and C++ where you can overload a function definition with multiple different signatures and bodies and thus the signature is important to know to know which function to actually call.


    Yes rust has a operator for dereferencing as well (the *). This can be used to copy a value out of a reference for simple types the implement Copy at least.

  • That is a bit more expensive and complex. Looks like this is configured with a couple of resistors for 5v from USB which is simple to get and a voltage reg to drop down to 3v3 optionally. Full PD requires a chip and active negotiation for higher voltage levels. Though there are chips that do that it does increase the complexity and cost and soldering skills a bit. Might not be worth it if all you work on is 5v or 3v3.

  • but I do think a sizeable portion of existing C++ devs who don’t want to use rust exist

    That may be true. But out of that pool of people it seemed that very very few wanted to work on the fish project. So it was not helping them much at all. The is a vastly larger pool of people that don't want to learn C++ and some of those may be willing to pick up rust. It would not take much for that to out number the number of C++ devs that want to work on fish that also don't want to learn rust. Given there are not a huge amount of contributors that regularly contribute to it according to their announcement blog post.

  • Protip: Don't write 600 lines of code without ever testing it at all. And by testing I mean anything, manual testing included or even just compiling it or running a linter over it. Do things incrementally and verify things at each step to make sure you are not drifting off course by some faulty assumption you made near the start.

  • That is not the issue at all. This lawsuit has nothing to do with user of honey, only on behalf of creators and affiliate marketers. Langley in part because users of honey signed a class action waver and makes it a sticky issue to also include them in the lawsuit.

    One of the lawyers taking part in it explicitly points this out: https://youtu.be/ItiXffyTgQg?t=182

  • Syntax is in a large part what people are used to. Which is trivial to change by just using the thing for a while and getting used to the different syntax. But syntax is only part of a language. The tooling, documentation, error messages, and general feed back are all IMO much nicer in rust than C++. It is also easier to people new to programming or used to other languages to get into than C++ is, even including the syntax into that.

    C++ was one of the first languages I learnt - and now after not using it for years I cannot stand its syntax.

  • From their blog post:

    Finally, subjectively, C++ isn’t drawing in the crowds. We have never had a lot of C++ contributors. Over the 11 years fish used C++, only 17 people have at least 10 commits to the C++ code. We also don’t know a lot of people who would love to work on a C++ codebase in their free time.

    Hard to tank when you don't have many to begin with. Rust is far nicer to new users to contribute to then old C++ code. Which can be seen in their github - in the last 24 months 16 people have contributed more then 10 commits. Which is during the conversion period - I dont expect that many of those to be C++ contributions. So rust does not seem to have hurt their contributions at all and in fact looks to have helped.

  • First thing I typically do when that happens is update my system and reboot. This is useful for ensuring everything is in a known consistent state and there is no weird runtime issues that happened since you last booted. And it is always good to upgrade before you reboot to ensure you are booting the latest kernel and drivers.

    If that does not help then I would start by closing down steam completely (ensure it is not running in the systray at all). Then launch steam though a terminal and start the game as you normally would. You will hopefully see some logs for the game in the terminal. Though it is very game dependent as to if that will be useful at all. If not I would look online to see if the game logs anything to any other file as some games tend to do their own logging or have a flag you can enable.

    If the game gives you some logs and hopefully an error message you can then see if it is useful to you and if not try googling for that error and the game name. I find this tends to dig up more specific help for games then general searches for terms like wont start or crashes though sometimes those general terms can find a solution as well.

    Note: if you try to launch steam in the terminal and it is already running you wont get any logs at all from it - it basically just forwards things to the main instance or quits as it does not need to do anything. Only the first instance you start will give you and useful logs.

  • On quite a few terminals, alacritty is one, you can hold SHIFT while dragging to select things on the screen to copy from. This suppresses sending mouse events so works when you have editors, tmux or other things that can interpret mouse clicks. It does mean that it is just copying chars from the terminal so ends up copying everything on the screen. Unlike the copying baked into things like tmux of editors.

  • IMO it is clickbaity because it promises to compare rust and zig, but in reality it is just comparing unsafe rust and zig. IMO all it really needed to not be is the word unsafe in the title like they use everywhere else in the article. That is fundamentally my only problem with it. I do agree with your other points on knowing when a tool is good or not to use but I would have been much less likely to click on it if it mentioned unsafe in the title - I already know rusts unsafe is not the best and was expecting some arguments around the advantages of zig over safe rust -ie what most people write, not a small subset of the language.

  • That’s true for your application maybe, but they go on to say how one should consider whether or not their problem is going to fit well within the rules of the rust borrow checker and that needs to be talked about more (vs just assuming Rust is the safest option).

    Yeah, that is why I was calling out their title as click bait. Saying Rust vs Zig will mean most people think of safe rust vs zig. But the article is about unsafe rust vs zig which is a completely different story IMO. If you need lots of unsafe zig might be better - but the title does not say that. Hence IMO it is clickbaity.

    Rewrites aren’t often done outside of hobbyish projects because they’re very expensive, stop new feature development, and you really can end up with something that’s worse than what you started with (this is especially true if you’ve switched languages or frameworks).

    Ok I will give you that for big projects. But this is on the other side of that. If you write two things in quick succession you will more likely still have the problems encountered in mind and be better able to navigate them the second time than if you are part of a large team that has had a lot of turn over since the project was first written. And you might make different mistakes - but the second round of mistakes is normally less impactful then the first set.

    They do explain with citations why it makes more sense (i.e. you end up with something more performance) to write their VM outside of the restrictions of the borrow checker.

    Oh yeah, of course this case I can see all that being true. But fundamentally they chose this problem because of that given they said:

    I wanted to test this myself and see how hard unsafe Rust would be by building a project that required a substantial amount of unsafe code.

    Sounds like they want to compare unsafe rust with zig. They started with that idea which from my experience is not typical of most applications so their findings are not either.

    I think the claim is a bit of a stretch off the cuff.

    Yeah that one might be.

    Though unsafe rust overall is not a large amount of what rust code is, the author does seem to be picking the topic based on the hardest parts of rust and their title talks about all of rust which IMO is an unfair comparison. The story of zig being better than unsafe rust is interesting but only part of the whole zig vs rust debate.

  • Title is clickbait. They only talk about unsafe rust, which I can see zip being safer/easier than unsafe rust. But 99.9% of code I write is safe rust - which most people just call rust. Even the author calls out the vast difference to writing safe vs unsafe rust:

    Overall, the experience was not great, especially compared to the joy of writing regular safe Rust.


    Then I would re-write the project in Zig to see if would be easier/better.

    Of course it will be. The second time you write any project it will be easier and faster as you learn a lot form the first time you write something. If zig is always the rewrite it will come off better. Almost all rewrites are better or faster, even if you are moving to a slower language - the language makes a difference to performance and ease of writing. But far more does how you write things and the data structures/algorithms you use.

    Overall they seem to want to write as much unsafe as they can and are writing rust like it is C. This is not a good idea and why zig will be better suited. But you can write a VM without large amounts of unsafe if you want to and it can be performant. Unsafe can be used in small parts where performance matters and cannot be done without it (though this is not that common I find).

  • But while that is technically true how would you form a policy around it? If you can afford to pay for private school but not the VAT have it VAT free? But if you can afford the VAT then you must pay it? That would be very hard to enforce and ripe for abuse. A blanket VAT/no VAT on private schools is far easier and overall will be a positive even if some more students will drop down to the state paying for their education.

    And yeah, having VAT exception rules for stuff children need to buy, like books cloths food etc is good. But why is that good? Because it applies to everyone not just a select few people rich enough to buy the best books, designer cloths and luxury foods. And public schools are already VAT free - by virtue of being free. This is not a blanket tax on all education, just the luxury side of it which only the wealthy currently partake in.

    Pointing out the £7000 cost without putting it into context seems like an argument a conservative would use against this policy - even though there is an overall net gain with it taken into account. Yes we should take it into account but so should we the amount of money brought in. And that is how we decide if it is a good policy or not (and it seems like it will be).

    The only real concern here would be if the government implements the tax and does not give that back to the schools - which TBH is a real concern. Though even if it is neutral - the government paying for the extra students but not giving extra overall funds I would still say it is worth while as it is a form, even a small one, of tax on the rich. So long as it does not hurt the public schools (which the government would have not pay for the extra students for that to be true - I am not sure they would go that far).

  • Education is a universally good thing, not unlike healthcare. Everybody should have access to as much as possible and society can afford.

    Yes this is true. And how do we get everybody access to as much as possible? Provide good quality services for free to everyone. Not by encouraging a tiny fraction of of people that private schools are vastly better then public ones.

    . And 2% tax on 7% of pupils in your county won’t change that or significantly impact public school funding.

    VAT, which I believe this is what they where exempt from, is 20%, not 2%. It might still be a small amount overall, but why should that matter? Any more money towards public education is a benefit. I would like to see other efforts to increase that further from other areas but I am not going to be against this just because it is not a big enough difference.

    So what you are saying is: abolish being rich.

    Ultra super rich, yes. They don't need all that money and it could be used to better the lives of a lot more people. The wealth gap increasing does not improve the lives of people, just they few that are on top.

    Because some members of society used to eat first so they are strong and defend the group. Not that today’s well fed members of society do that, but they should.

    I mean yeah? That is my point. They should but they don't. So what benefit do they give us? There has been a big push for trickle down economics for a long time... but it does not work. All we have seen is an increased wealth gap and more people getting into poverty. We need to start taxing the rich and actually funnel that money to the people that need it - defend the group as a whole, which they are failing to do currently.

  • Fair point, would love to see the numbers on this. But it smells of trickle down economics to me. VAT is 20%, I assume this is what will be paid. And lets assume it is on the tuition that parents will now pay. Seems the average tuition paid is around £15k (rounded) for private schools. Which means about a 3k increase in the tuition. That would mean for every 3 students in a private school you could afford to send 1 to public school with room to spare. So to have a negative impact this policy would have to have a what 1 out of every 4 students to drop out of public school and return to private school? Or 25% of students give or take a lot.

    But according to the article:

    In October however, the ISC said some private schools reported a 4.6% drop in pupil attendance in secondary school uptake, which it attributed to parents now deciding against sending their children to private school.

    Which is vastly less than 25% which should make this policy a net positive with loads of head room for my math crude back of the napkin attempt.

    Thus, smells a lot like trickle down economics argument to me.

    Would love to see a more concrete analysis of this.

  • I do use scripts for more complex things. But even then I have a few very frequent one liners in my history that are 3-4 commands chained together that I have not bothered to convert. It tends to only be when they start to have logic in them that I will write a script for. Or more one off commands that are easier to edit in a multi line editor then trying to get everything right in the shells prompt.

  • I used to know a guy that would put everything into aliases or scripts in order to avoid remembering them. It worked well most of the time but when something went wrong or was not covered by his scripts he would struggle a lot. He avoided learning the underlying commands and what they did and so could not adapt to things when circumstances changed even a little - which does happen quite a lot.

    Which is probably another reason I don't use them. I don't like to set them up straight away while I am learning the tool and once I am comfortable with it a reverse history search is good just as good/quick as a true alias anyway and means I never forget what I am doing and can edit it on the fly easily when needed.