Preferences

Fwirt
Joined 669 karma
Just another suburban dad in an underpaid programmer/analyst role, trying to stay sane while raising 2 kids.

  1. Thanks to Lua’s great metaprogramming facilities, and the fact that _G is just a table, another workaround is to add a metamethod to _G that throws an error if you try to declare a global. That way you can still declare globals using rawset if you really want them, but it prevents you from declaring them accidentally in a function body.
  2. The Lua ecosystem is more like the Lisp ecosystem than Python. The language is small enough that there’s a lot of stuff out there that’s just… finished. Hasn’t been updated in 10 years but still works. The LunarModules org tries to gather it up and keep it compatible.

    For an extended standard lib, the closest thing is probably Penlight. https://github.com/lunarmodules/Penlight If you want async IO, sockets, etc, check out Luvit. https://luvit.io

    Lua is really designed as an extension language but it’s such a nifty little language that sometimes you really wish you could use it in place of Python or Perl, which is why LuaJIT is so popular. But LuaJIT is really just one guy’s project. Its metaprogramming features are really nice and let you build some Lisp-style DSLs, and if you want full Lisp syntax you can drop in Fennel. If you’re just writing extension code you often don’t need a standard lib because it’s easier just to roll your own function to fill the gap.

    Personally, I found it easier and quicker to just read the reference manual to learn the language. It’s small and simple enough that you shouldn’t have trouble getting up to speed if you have a couple other imperative languages under your belt. IMO metatables are much easier to work with than JavaScript’s prototype inheritance.

  3. It’s still up on his website as well: https://qntm.org/perso
  4. No, but watching a novelist at work is boring, and yet people like books that are written by humans because they speak to the condition of the human who wrote it.

    Let us not forget the old saw from SICP, “Programs must be written for people to read, and only incidentally for machines to execute.” I feel a number of people in the industry today fail to live by that maxim.

  5. I keep mulling over decisions like this, and I think the fundamental clash between the hacker ethos of repairability and the corporate ethos of products with well-defined failure modes comes down to a clash of innate human values with capitalism.

    Capitalism fundamentally does not view human life as sacred. Or rather, it puts a finite value on human life. The bond between a mother and son is priceless, there is (in the case of a loving relationship) no price that either would put on the life of the other. That is to say, there is no amount of money that either would accept in exchange for the death of the other. As actuaries know, this is not true from a capitalist viewpoint. The value of a human life is frequently calculated by various means to be somewhere around 3.5 million dollars at birth. Which is to say, if a policy change costs an organization (private or public) over 3.5 million dollars to save one human life, it does not make financial sense. So when you look at a decision by an automaker to include a "safety" feature, you have to ask "did the amount of money that this costs the company work out in terms of human lives". In this case, BMW likely concluded that the financial damages of settling an insurance claim for a battery fire, and damage to their brand from the massive negative publicity of battery fires (see Tesla) would be more than the cost of implementing this "feature". This is also true from the legally mandated standpoint of crash safety features, which result in cars being much easier to total because of crumple zones. The cost of a $100k vehicle is much less than the cost of a $3.5 million human life. On the other hand, the carbon and pollution cost of replacing many $100k vehicles is borne by the public. An interesting view of this topic is summarized in the Wikipedia article "Value of Life" under the heading "Uses", which specifically covers the cost of implementing emissions regulation vs. the cost of the human lives that reduced emissions would save. https://en.wikipedia.org/wiki/Value_of_life#Uses

    As has been pointed out many times, vehicles these days are cost engineered to last as long as the average buyer of a new vehicle will hold onto the car. Since BMW targets a luxury market, that lifetime is likely on the order of 4-5 years. A Toyota is probably closer to 10 years. Automakers do not (as far as I know) make a meaningful amount of money on the maintenance of used cars; OEM parts do not necessarily come directly from the automaker, but rather a company that contracts with them or a subsidiary whose financials are not counted as part of the manufacturer's bottom line. Therefore, in our modern era of late-stage capitalism, companies have no incentive to make cars that last longer, and complaints from customers who wish that their end-of-life cars were easier to repair will fall on deaf ears. Those of us who wish our cars were less "safe" in order to contribute less to the criminal waste of disposal of otherwise sound vehicles and carbon cost of making a new vehicle would do well to consider the financial calculations that went into those decisions. Is making batteries that are easy to fix but kill someone when improperly repaired in 1/1000 crashes more ethical than installing systems to prevent batteries from ever being misconfigured? Are there more BMW crashes than other brands due to the target demographic? Is the number of batteries that will be repaired improperly significant enough to cause a large number of battery fires? I don't know.

    This is by no means an excuse of these practices, but merely an attempt to understand them. I would love to hear where my reasoning is flawed so I can better understand this. It certainly seems to me that the risk of a shade tree mechanic soldering a piece of wire into a BMW battery computer is astronomically low, but I have seen repairpeople of all shades do really stupid things to save money so probably not zero.

  6. Home Assistant is the poster child for an incredible open-source project. There are community plugins for a mind-boggling number of devices, and crazy functionality that seems like magic. (Flash a $5 ESP32 with some pre-built image and you can connect HA to any BLE devices it can see.)

    However, it is very much a product by nerds, for nerds. My wife loves it but she's not going to bother writing YAML to create her own dashboards. She used to write simple web forms so I have no doubt she could, but it's not something that appeals to the average person. Imaging a machine is beyond the realm of what the average consumer is willing to do.

    HAOS runs really well as a VM image and doesn't use much in the way of system resources, if you have a home server with 4GB of extra memory you can throw it in KVM and it'll be happy as a clam. I've never had it brick itself.

  7. That’s horrible that you legally cannot replace your own water heater. What region mandates that?

    Where I live I can replace my own water heater, but it’s more cost-effective not to because the most reliable brands will only sell to licensed plumbers. So I can get a big box store model that will leak or die in 3 years for $300, and then have to pay for fittings, wiring, etc. myself and pay to dispose of the old one and provide my own labor, or pay a plumber buddy of mine who has access to the good stuff that will last 10-15 years $1000 to install one for me.

    Building permits and inspections make sense in a lot of cases for things that could cause societal damage. E.g. if I wire my house wrong and it burns down, it could kill the people living in it (even if it’s not me) or set my neighbor’s house on fire. If I put in a septic system wrong it could poison all the wells in the area. But when you start needing permit and inspections for basic maintenance, it becomes difficult to justify the regulations.

  8. On the other hand, I have a friend who worked in retail as a teenager tell me that employees sometimes appreciate carts getting left out, as it means they get to go for a nice leisurely walk outside, away from the toxic work atmosphere, to go round them up. So while carts getting left out may be positive for other shoppers, it might be doing a disservice to overworked employees.
  9. This is often misunderstood and varies by jurisdiction. Often called "squatter's rights", it is often thought to mean "if I use this land for a long time without anybody noticing it becomes mine", but e.g. in my jurisdiction, you also have to have prove that you didn't know it wasn't yours. For example, if your backyard fence has been 5 feet over the property line for 10 years and nobody noticed, but then suddenly your next door neighbor has the property surveyed and tells you to move your back fence, you can take them to court and potentially claim that extra 5 feet as your own. But you can't just scoot your back fence over a couple inches every year and then eventually lay claim to your neighbor's backyard because they didn't notice it was shrinking, nor can you "find" "abandoned" land, build a house on it, and then claim it as your own. I believe there are a few jurisdictions where this actually is the case, but it's fewer than many people believe. And then of course you have the reality of squatters invading people's homes while they are on vacation for a week and the police being completely unwilling to get involved, which I understand was a big problem in France for a while.

    IANAL

  10. See my other reply, when people count energy costs they fail to take into account the existing sunk cost of producing said resources, and the energy from having to build out new infrastructure to create these “more efficient” datacenters.

    It’s like when people replace their fridge with a “more efficient” one and wipe out any energy savings with the cost of the new fridge. The difference in energy use will not pay for the new fridge for many years and by then you’ve already replaced the new fridge with another newer “better” one.

  11. Unless you count in the effects of distributed solar and the environmental effects of building said datacenters in the first place. Many homes with solar produce more than they consume, and many homes pay for heat. Instead of new construction (concrete is another huge CO2 contributor) and AC units or pumping surface water for cooling, putting a server in your house is basically free heat and making use of an existing, underutilized resource.

    I could run my entire rack off of one to two solar panels (decommissioned ones from a power farm might I add). Even that would take a few years to pay for itself (when you factor in the costs of mounting and permitting) and my power company over 80% renewables the last time I checked anyway.

  12. The amount of e-waste in general is truly nauseating. My employer just cleaned 30 years of “junk” out of our in house IT “tech shop” and the number of working but obsolete computers that went out (many simply because they couldn’t support Windows 11) is sickening to me. The amount of carbon generated from the mining activities, steel production, etc. that went into producing “obsolete” computers has to absolutely dwarf any carbon “savings” you get by replacing them with more “efficient” machines. Especially when you consider that renewable power is taking over and many places aren’t burning coal to run the things anymore. A 12 year old i7 server runs my NVR, home automation setup, web server, and network router (not to mention a small handful of other services) without even breaking 25% CPU usage. We could replace so many data centers with old desktops.
  13. I have been spending hours the past couple weeks "ensmartening" my home with IoT switches and power outlets. Home Assistant is gorgeous and is an absolute feat of engineering and a testament to the power of open source, but messing with it you can tell that it's very much "by nerds, for nerds". I don't expect my wife to learn to edit YAML files so she can customize a dashboard. The drag and drop editor mostly works but it's missing a lot of functionality. And if your network topology is anything but flat (i.e. everything connected to one consumer router, which probably does cover 95% of people) then good luck with any of the discovery technology like mDNS or broadcast domains. I have dnsmasq allocate hostnames and static IPs for all my stuff and manually punch in the hostname for 99% of things in HA.

    The ecosystem I've had the best luck with is, sadly, Tuya, aka Smart Life, aka giant Chinese conglomerate. Pretty much any small brand (or even some bigger brands) use Tuya to build because they have easy off-the-shelf solutions, and I have some confidence that they're large and entrenched enough that they won't randomly shut off their cloud services. But even if they do, enough reverse-engineering work has been put in that you can run most of your devices locally without a cloud connection. The cloud connection is pretty seamless and is the easiest thing I've had to configure in HA. Once you add a device in the Smart Life app you just reload the HA integration and there it is, ready to go. I actually get less latency toggling lights through HA than through the Smart Life app. I don't really worry about them knowing when my front door is shut or my living room lights are off, and I keep all that stuff on its own VLAN with no outgoing access to the rest of my network.

    As I start dabbling with Zigbee and Thread and Matter and stuff, it seems like all of these other "open" "ecosystems" are really complicated and require buying a bunch of hardware I don't want and coordinating another network on another protocol, whereas the Wi-Fi stuff just usually works. It makes (some) sense for extremely low power devices that need to run for years on a battery, but lights and outlets don't really need to be Zigbee devices. BLE devices over an ESPHome Bluetooth proxy work surprisingly well too, and BLE is a less crummy technology than Bluetooth proper and seems to be low power enough for a lot of battery operated devices. I wish everything would just support MQTT because that seems like the most "universal" IoT protocol there is.

  14. It’s not as “integrated” into the car, but if you just want CarPlay, there are cheap single-purpose “tablets” that mount to your dashboard and either pair to your car’s Bluetooth or plug into the Aux port and just do CarPlay/Android Auto. Amazon is full of them. Ultimately it’s just a video and touch transport protocol, with some additional channels like illumination and I hear speed on some models.
  15. My point was more along the lines of the fact that below a certain price point, you can't be sure whether you're paying $3500 for actual build quality and features or marketing. A $500 fridge could last forever, or it could last exactly as long as the (very short) warranty period. Also, cheap stuff may last forever in some ways, but it's been cost optimized in a million different ways that make it more annoying to use. In my case the compressor is fine, but the plastic interior has some inexplicable cracks in it and the feet broke off. But at least it will never advertise to me.
  16. Drop x Sennheiser HD 58X Jubilee through a Qudelix 5K. Both are great pieces of kit, the Qudelix especially. The onboard parametric EQ combined with AutoEQ is fantastic. However, after running a hearing test and enabling Hearing Assist, the EQ on the Airpods is incredible and everything sounds very natural. I have no idea how they managed to get this much soundstage and bass out of these things. I also have a pair of Grado SR 80, and have a soft spot for Koss KSC 75.

    FWIW I got mine at Costco and their return policy is top notch, and I believe they include AppleCare+ with the purchase. I had bought my APP2 fairly recently before the APP3 were released, experienced buyers remorse, but had kept them in like new condition with the box and accessories, and had no problem exchanging them.

  17. When I tried to pair mine out of the box it initiated an "Update to iOS 26!" workflow and wouldn't let me pair until I did. Also, after I updated my iPhone and paired them to my iPad Pro, still on iPadOS 18, they just showed up as generic bluetooth headphones with none of the ANC or Hearing Assist features available.
  18. Yes, but good luck finding a way to integrate CEC with Home Assistant, or anything else for that matter. Even modern GPUs don't support it. You usually have to buy a USB dongle that MITMs the connection for a disgusting amount of money. It looks like Raspberry Pis support it, but then you have an SBC and its power source dangling off of your TV just to run a single lightweight daemon that may not even fit your use case. CEC is not designed for total control, and on many TVs it's even a bit flaky. I had to disable it on mine because misbehaving devices would randomly turn the TV off and on when I didn't want it.
  19. I never thought I would connect my Hisense to the internet, but it turns out that it runs an MQTT broker and responds to WoL packets, so control via Home Assistant was really easy to setup and is much better than the IR blaster I was using before as response is almost instant and I can get power state so I can sync it to the rest of my living room. Most smart TVs seem to do well behind a DNS black hole, and if you're knowledgeable enough for that then self-hosting a dnsmasq instance on an old box you have lying around and pointing the TV at it is a snap.
  20. Samsung appliances have among the worst reputations for ease of repair and lifespan. Sadly most other brands are rebrands of Chinese conglomerates or not much better on the quality chain. But honestly it's also a lottery. We bought a fridge on sale for $500 as an emergency stopover when our expensive fridge was delayed by a month during a move, and it's still plugging along out in the garage, a hostile environment for fridges. All the parts are very accessible too which bodes well for repair, although the leveling feet did snap off.

    However, when you see the viral videos of "dream fridges" from the 1950s, it's important to remember that adjusted for inflation they would be something like $10k today. Of course they also last 10x as long, but you can still find fridges in that price range today with a similar value proposition. The question is whether or not you're willing to pay that upfront. I think we've all been so conditioned to accept that appliances go obsolete that it doesn't seem possible for a fridge like that to ever pay for itself.

    It's the boots theory at work.

This user hasn’t submitted anything.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal