How does this work out for functions in the middle of the call stack? Can the objects a function creates be mutated by functions they call? Phrased differently, can functions modify their input parameters? If a function returns one of their input parameters (modified or not), does that mean the calling function can no longer mutate it?
Maybe I'm discarding this too readily, but I don't think this idea of "local mutability" has much value -- if an object is mutable, the compiler and runtime has to support mutation and many optimizations are impossible because every object is mutable somewhere during their lifetime (and for objects created in main, they're mutable for the lifetime of the program).
If we include as a axiom for the purposes of this conversation that we must be able to refactor out any part of the "constructor" and that the refactored function must have the same mutation "privileges" as the original creator, which I think is fairly reasonable, this leads you in the direction of something like Rust I think, which can construct objects and lend bits and pieces of it out in a controlled manner to auxiliary functions, but the value being returned can still have constraints on it.
Local mutability is fantastic and practical... In a language like Haskell where the type system tracks exactly what values are mutable and all mutation is precisely scoped by functions that freeze the value they generate in a way that prevents leaking.
In a language that isn't so precise, it's a lot harder to get value from the idea.
You can get value out of local mutability in languages like Scala or Kotlin. Variables can be declared mutable in the scope of a function, and their value can then later be assigned to a non-mutable variable, for example. Collections also come in mutable and immutable variants (although this has some pitfalls in Kotlin).
I have to say I don’t understand your point! The parents comment is both clear and a reasonable, common approach of programming
> Can the objects a function creates be mutated by functions they call?
No
> can functions modify their input parameters?
No
> If a function returns one of their input parameters (modified or not), does that mean the calling function can no longer mutate it?
No. Because the called function isn’t allowed to mutate its inputs, there’s no problem for the caller to mutate it. It’s irrelevant whether the input was also an output of the called function as it cannot mutate it anyway.
I suppose you can get into race conditions between caller and callee if your language provides asynchronicity and no further immutability guarantees. Still, you eliminated a whole lot of potential bugs
I mean, this isn't that different from any number of things you do in real life? You took a car to some destination. It is assumed you didn't change the engine. Took it to a mechanic, maybe they did?
More, many modifications are flat out expected. You filled out a job application, you probably don't expect to change the job it is for. But you do expect that you can fill out your pieces, such that it is a modifiable document while you have it. (Back to the car example, it is expected that you used fuel and caused wear on the tires.)
As annoying as they were to deal with, the idea of having "frozen" objects actually fits really well with how many people want to think of things. You open it to get it ready for use. This will involve a fair bit of a setup. When done, you expect that you can freeze those and pass off to something else.
Transactions can also get into this. Not surprising, as they are part of the vocabulary we have built on how to deal with modifications. Same for synchronization and plenty of other terms. None of them go away if you just choose to use immutable objects.
I think the M1 was a pretty huge innovation. It's the first time a laptop felt portable and without compromise. I can get a full day of work out of my laptop without plugging it in. It's pretty wild.
Before this laptops were simply things that were small enough that you could carry one from point A to point B, but they were still effectively tethered to a wall and desk for any non-trivial usecases.
I assume Facebook doesn't want anything posted on FB that can't be turned into a racist diatribe. There's not a whole lot of racism potential in Kernel tuning.
Maybe you could squeeze in anti-Finnish rant about Linus, but it would be minimal
I just ordered by first 3D printer, I'm not normally sensitive to air quality issues, but my partner is, so I spent some time doing some research on the issue.
It's amazing how many people believe "if you can't smell it, there's no problem" and quite incorrectly assume that things like PLA won't hurt them. Surely minimal exposure is fine, but 3d printers run over many hour periods and those VOCs can build up.
I decided to be safe and bought a basic fabric enclosure with an exhaust fan that vents to the outdoors. It's probably not perfect, but maintaining negative pressure inside the enclosure should remove most particulates. I wouldnt handle bromine in it.
I'm worried about all the folks running print farms in their house with minimal ventilation.
A lot of the so-called "water washable" bio resins need to be diluted down to 1L of resin + 1 million L of clean water before they are considered safe enough that you're allowed to flush them down the toilet. So I would never touch them without gloves.
And while you are correct that some plant-based resins are not a class 3 lung poison anymore, they are still a class 2 eye irritant and can cause burns in your eyes purely through aerial exposure. Which means you need to wear goggles whenever you're in the same room.
It's similar to 2 component epoxy: The raw materials are highly poisonous, but the reaction end product is safe. It's just that you need to be 100% sure that there are no un-reacted resin leftovers anywhere on your part. And that part is very difficult.
The nozzle will hit that temp, but air temp will be much closer to room temp. A porous and poorly insulated fabric enclosure will probably not add more than 10 C temp increase.
Air temperature is not the issue and is not how 3D printers catch on fire, I should have clarified in my previous comment.
Nozzle clogs can happen frequently, and if left unmonitored, can quickly turn into a disaster. If your nozzle is clogged it can essentially destroy your printer and cause an electrical fault that can set the printer on fire.
Printer fires are a lot less frequent in recent years than a decade ago, but it can still definitely happen.
A nozzle clog won't set a 3d printer on fire either. It'll make a good mess of the hot-end. There'll be a bunch of charred filament, and heat creep will clog the nozzle nicely. It won't however magically get any hotter than it does while printing with an unclogged nozzle.
What does cause fires is failed thermistors. These days most firmware will detect unreasonably high or unreasonably low temperature readings and turn off the heaters. You thermistor can still however fail with a reasonable reading if you're very unlucky.
Another factor is MOSFET failure. MOSFETs have a failure mode where they can fail closed. This can turn a heater on permanently. Modern firmwares will detect the temperature going unreasonably high, but most hardware is not set up such that the firmware can do much about it.
Leg Lab evolved into Boston Dynamics, which have been (and maybe continue to be) the leader in real bipedal walking.
reply