• 0 Posts
  • 69 Comments
Joined 1 year ago
cake
Cake day: September 2nd, 2023

help-circle





  • To be fair, mechanic items, and especially electronic ones were far more repairable back then.

    You could see, desolder and solder components without issue. Nowadays most of the electronics are inside chips, and only the components that need to be physically big (like those responsible for the power supply) are human sized. Sure, there are some small SMD that can be manually diagnosed and replaced, but even then you often need a lot of skill and equipment.


  • The good thing about Box::leak() is that it returns a raw *mut pointer. So you need unsafe{} to dereference it. Might as well: let my_ref = &mut unsafe{*ptr}; while you are at it, so you have a perfectly normal rust reference, so the function signatures don’t need any change.

    The problem with Rc is that it would also require a RefCell most of the time. So the whole thing would be filled with Rc<RefCell<T>>. With the required .borrow_mut(). It would both do a pain to do and undo.

    And of course I want to undo it, because RC is a shitty GC.






  • Using “clever” ways to disable the borrow checker is one of the few things I don’t like about rust. I much rather it having a “borrow checker version” and a “garbage collector version”. That way we could rapidly iterate through design choices with the GC, and once the design has proven good, apply lifetimes and such to use with the borrow checker. The only downside to this I can think of is that most would just leave it in the GC version and not bother to move to borrow checker. But that’s fine by me, rust has many other features to take advantage of. As long as no GC libraries are allowed in crates.io, it should be fine.







  • Git is not the only version control software out there, and not the first one either.

    Facebook for example is famous for not using git. Because their own modified copy of mercurial fits their needs better.

    Microsoft didn’t use git until relatively recently either. They had to make some big contributions to make it work for their system.



  • Just recently a bug was found in openssh that would let you log into the root user of any machine. With extreme skill and luck of course, but it was possible.

    OpenSsh is probably one of the most safe C programs out there with the most eyes on it. Since it’s the industry standard to remotely log in into any machine.

    There is no such thing as fully tested and safe C. You can only hope that you find the bug before the attacker does. Which requires constant mantainance.

    The the about rust is that the code can sit there unchanged and “rust”. It’s not hard to make a program in 2019 that hasn’t needed any maintainance since then, and free of memory bugs.