I agree. I gave Zig a fair shake, even went so far as to find the compiler PR that automatically adds `_ = foo` to your source code while compiling[1] and set up the VSCode extension with autofix. I couldn't get used to seeing the lines with `_ =` appear and disappear all over my code while I was typing.
With the usual warnings approach, you can rely on compiler/IDE/pre-commit tooling to find unused variables - they'll all nag you until it's fixed. With Zig's autofix approach, those problems are immediately silenced and you don't have any help from the compiler or tooling to find unused variables. It's quite an ironic outcome if you think about it.
> I've been wondering lately whether a new spatial approach can yet again simplify matters.
I've been closely following the development of Vale since I first saw it here. Though their approach is slightly higher-level than Rust and requires (some) runtime safety checks (though to be fair, so does GC).
I think it would be tough to change the spatial model in a language as low-level as Rust, because that spatial model is just reflecting how your CPU actually works under the hood. If you try to hide that away, the programmer is going to end up losing some control.
When I was a kid I had a toy electronics kit and one of the circuits was an AM radio that worked without batteries. A normal radio station signal is strong enough to drive a pair of earbuds without any additional power. Since then I've always wondered if you could harvest that same radio energy to power other things without batteries, maybe even a Game Boy. There's electromagnetic radiation in the air all around us. And I'm sure you could build a Game Boy using today's tech that's much more power efficient than the ones from the 90s.
But it still works almost the same way. You hold it near a thing to get energy is mostly required because it works with very little power, let's say some milliwatts. Whereas old AM stations where sending in the range of megawatts.
That broadcast power is required to provide range. Radio waves obey the inverse-square law: for every doubling of the distance from source you get four times less power. This is also why wireless power transmission at a distance isn't really viable.
RFID can absolutely work at long range. Most applications don't by design because they don't want the data on the chip stolen. But there are applications that can read RFID from tens or hundreds of meters away.
I used to build crystal sets that would have two receivers in - one to harvest power from the strongest local station and then a second one that would take some of that power to bias up the detector diaode or to even use a germanium transistor to amplify the audio.
The first receiver would be able to drive a loudspeaker through a transformer loud enough you could hear it across a quiet room, so some power there, but only milliwatts.
I have wondered if these days with the zero volt FETS if there would be enough power for a regenerative receiver, some kind of negative resistance version seems most likely.
I heard a tale in the days of yore where a radio station was not getting the range promised by the laws of physics. When they did some investigating they found an engineer that lived next door to the tower was syphoning power from the radio waves as part of a home experiment.
I'm not qualified to determine the plausibility of this, but I hope it's true.
It’s a nice ‘Edison vs Tesla’ type story - but I’m pretty skeptical that there’s any truth to it. It just doesn’t seem viable enough to bother doing, for how much of a hardware setup you’d need versus how much electricity you’d be ‘harvesting’, to the extent that it meaningfully impacts the signal range itself.
Like unless this engineer built the Russian woodpecker array
If your object is roughly the size of a wavelength or less, it can siphon off power that would be a few wavelengths away.
So a bacterium might be able to annoy their neighbor. But that's about it.
If the sun was in some kind of equilibrium with stuff around it (ie. There was a big mirror acting kinda analogously to a ground plane) you could effectively cast a shadow much bigger than yourself.
I've heard of AM radio being audible in non-electric structures, like an old hangar door. Some combination of geometry, metal surface condition (corrosion?), and proximity to a station.
Lucille Ball very famously told a story on the Dick Cavett show about hearing radio transmissions in her tooth fillings in 1942 and it leading to the capture of a Japanese spy station. [0].
While the story seems a bit far fetched, having fillings act as diode rectification of an AM signal that is then conducted into sound via the jaw is completely real and has happened to many people, particularly moreso in the past when people more often had metal fillings and very powerful AM signals were more prominent.
Poorly shielded wires and speakers can pick up stations as well. My brother's cheap guitar amp would randomly pick up garbled bits of sound from radio stations (while not plugged into any power source)
SoundBlaster / Cambridge SoundWorks set of subwoofer and satellite speakers with long wires did this, too. Freaked me out when I suddenly heard voices inside my apartment at night. Turned out it had suddenly started to pick up a radio talk program.
I still have a solar calculator. They were pretty common in the 90s. Similar principle to the Gameboy, but also the workload was a lot slower (no frame refreshes).
There's an urban legend in the UK about a radio station having a dead spot in their signal. They send the boffins out to figure out what's going on, and they eventually track down someone who has filled his attic with coils of baling wire and is running his house lights off the radio station.
(Yes, I know all the practical objections. It's an urban legend. I've seen variations involving BBC radio, TV broadcasts, submarine communications, overhead power lines, the VLF transmitter at Rugby, and a farmer using the energy to milk his cows).
The cool thing about The Thing is that it's not really an energy harvesting device, and has no active components. It is a purely passive modulator of a signal being transferred over the air!
Funny, but I thought about the same thing. I guess AM radio waves don't have a big amount of energy by the time they hit the receiver.
I think Nicola Tesla experimented with sending energy wireless, at longer distances, over the air. I don't remember what his results were, but man, that guy was so ahead of its time.
Yeah, I don't think most people object to Ring video potentially being used by LE (I'm sure there are some though). I think the biggest complaint is the complete lack of due process and even the lack of notifying anyone when their footage is used.
No. The article is about a failure of that exact system. Judges just sign search warrants for just about anything; the only thing they check for generally is that it's not involving the search of hundreds of people. Invading the privacy of 1-10 innocents is just a rubber stamp.
Yes, but obtaining footage directly from 10 different people is ten times more work than obtaining the same footage from a single source. That additional work increases friction and decreases (but certainly doesn't eliminate) the level of abuse that will happen.
const foos = [("foo", 1, "bar"), ("foo", 1, "bar"), ...];
for (str1, num, str2) in &foos {
// ...
}
For a proper struct you have to name the fields, because otherwise refactoring the fields could cause struct instances to silently get out of sync with the definition.
>otherwise refactoring the fields could cause struct instances to silently get out of sync with the definition.
Having to name the fields is only part of the pain. You also have to redundantly repeat the struct name. I don't see any fundamental reason why something like this shouldn't be valid:
I can see the logic for insisting on field names. However, the builtin 'go vet' tool has a nice behavior where it will flag the use of unkeyed literals for public structs only. This strikes me as a good compromise between concision and safety.
You can use map() to turn an array of tuples into an array of structures. Unfortunately at time of writing the optimiser doesn't do a great job on this, so if you're making an array of several thousand of something, or an array of things which are themselves very large, this might have unacceptable performance, but in cases where I have say a modest N values and I want N structures based on those values...
I'd be happy even if they just didn't hijack Command/Ctrl-F. You can't even search for text on the screen you're viewing without being dumped into their shitful pseudosearch.
This is megabytes (at most) of text we're talking about, not gigabytes. And ripgrep is absurdly fast. Grepping a 5MB text file should be pretty much instantaneous.
The “text files” don’t have to be the primary backing store - merely a derived cache file that can be periodically refreshed with new content. It doesn’t have to be text either - SQLite is pretty structured if you need more features in a minimal container too.
I said something similar about it not being able to roast a chicken. Now I feel annoyed by my lack of originality!
While it's lightweight, I'm glad someone is trying to make AI with attitude. "Roasting" can get surprisingly dark and blunt (going by the celebrity roasts), so the AI Roaster will need to be tougher than this.
With the usual warnings approach, you can rely on compiler/IDE/pre-commit tooling to find unused variables - they'll all nag you until it's fixed. With Zig's autofix approach, those problems are immediately silenced and you don't have any help from the compiler or tooling to find unused variables. It's quite an ironic outcome if you think about it.
[1]: https://github.com/ziglang/zig/pull/12803