• 0 Posts
  • 25 Comments
Joined 1 year ago
cake
Cake day: June 8th, 2023

help-circle




  • But anyone with access to source code licensed under GPL can legally redistribute said source code. One of the fundamental freedoms is that if you are given GPL-licensed source code, you can modify and redistribute it as much as you like.

    I think the real problem might be that some of the work from Red Hat doesn’t fall under the GPL, hence this wouldn’t apply, but I’m not sure.

    Or what if they only distribute it to companies that sign an agreement not to redistribute? Then they have the right to redistribute according to the GPL, but if they do, Red Hat will kick them out. This would seem like a way to circumvent the fundamental ideas behind the GPL and free software. If they do this, I can no longer be supportive of Red Hat in any way, and will likely have to distro-hop away from Fedora due to this misalignment of ideology.




  • I agree, I also make sure everything is fully local. I have separate subnets for the server that runs home assistant, the IoT devices, and the trusted home network. Then I have some firewall rules that ensure that the IoT network cannot communicate with the WAN or the trusted LAN network at all, only with home assistant.

    We have some simple automations at home to turn on the boiler in the afternoon when we have an abundance of solar power, and some basic automation to turn off aquarium lights at night such that the fish can sleep. Anything more complex just becomes unreliable and annoying.



  • Making sure you are still able to control everything when the network is down seems like a good idea.

    In our house, the smart plugs have a physical button that can be used to toggle them on or off. The lights are still connected to a physical power switch, so they can be reset by flipping the switch a few times, in which case they will probably just act as a normal light. Air conditioning units have an IR remote.



  • No, I phrased that poorly. What I meant is that if you have a struct that has some field (it owns that data), your operations on that data will be methods of that struct, and not some other struct that happens to have a reference to that struct. The latter is something people tend to do in OO languages like Java. In Rust, if a function accesses data, you usually “freshly” borrow from the owner of that data and pass it as argument to that function instead of relying on some “hidden” references somewhere in hidden in an object. Borrows will almost always be short-lived.

    I don’t know if any of this makes sense, I’m sorry for the bad explanation. It might make more sense if you play with Rust yourself.


  • When you create an instance of a struct and assign it to a variable or field of another struct, that variable becomes the owner of that value. When you assign it to some other variable or pass it to a function that takes ownership, ownership will move. Otherwise, you will borrow. But there will always only be one owner for each value. That way you know exactly when to free up memory: whenever the owner is dropped.


  • You can store references in another structure, but you probably don’t want to do this most of the time, since it’s a major headache to get ownership and lifetimes right. You shouldn’t think of references as pointers, but you should think of them as “borrows”: you are temporarily borrowing something from the owner, but you can only do so if the owner exists. So you need to statically guarantee that for as long as you borrow it, the owner must be alive, which gets tricky when you store that borrow somewhere in some data structure. In practice, references or borrows will be short-lived, and most operations on data will be done by the owner of that data.

    Underneath, references are represented by pointers, but you shouldn’t think of them as pointers, but rather as something you have borrowed, so in that sense it’s different from C.

    Also, Python does use references everywhere, it’s just implicit, and depends on the type. Try storing a list in a class: you’ve just stored a reference to another structure. Most things (e.g. lists, objects) are passed and stored by reference, some types like integers are copied. In Rust, you can choose whether you want to pass by reference, copy or move ownership. At this point we’re still at a high level of abstraction, we don’t think so much about whether this will be pointers at the low level.

    But my main point is that whether you use pointers, references, or whether it’s implicit or explicit doesn’t make a language slow or fast, it just defines how programs are written. Rust is very fast because it’s compiled to machine code and doesn’t do garbage collection or have any other overhead from a “runtime”. Python is relatively slow because it’s interpreted. You could argue that more manual control over references/pointers can make a language faster, but it’s not the main contributing factor.


  • I would argue that on the one hand you could say that the references to objects in garbage collected languages are also pointers.

    On the other hand, you could argue that such references are not pointers, but then you might as well argue that references in rust are not pointers.

    I just feel like “a language with pointers” is a weird way to describe a language and it isn’t really something that causes the language to become fast. Pointers are low level constructs that are used all the time, and whether or not they are abstracted away in the high level language doesn’t automatically make it slow or fast.






  • Updates can’t really break anything, and if something would go wrong, I can simply boot on the previous image, which will still be there. They can also happen in the background, such that I don’t even know it’s updating. It just happens and never bothers me.

    What’s even more interesting is that you can rebase on another base image without having to worry. If I don’t like it, I can just go back to the previous image. With ublue, you can even customize your own OS image.

    I believe modern Android uses a similar concept. They use two partitions, and install an update to the other image while your phone is running normally. Then all you need to do is reboot, and you’ll be on the new boot image.