Hacker Newsnew | past | comments | ask | show | jobs | submit | rom-antics's commentslogin

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.

[1]: https://github.com/ziglang/zig/pull/12803


Yvette and Ling would be perfect for each other. https://www.lingscars.com/


Can George Hutchins come over and play, too?

http://www.georgehutchins.com/


"A Concusses Will Be Taken To Represent The True Desires Of North Carolina 4th U.S. Congress District Voters."


GEORGE HUTCHINS U.S. CONGRESS WEBSITE RETURNING SOON !!!

GEORGE HUTCHINS U.S. CONGRESS VIDEOS RETURNING SOON !!!

HUTCHINS U.S. CONGRESS MESSAGE BOARD RETURNING SOON !!!


Lovely website, though I never quite understood why they portray the BMW 8 series saloon as a missile launcher truck.

https://www.lingscars.com/personal-car-leasing/bmw/8-series-...


> 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).

https://vale.dev/

https://verdagon.dev/blog/zero-cost-memory-safety-regions-ov...

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.


On the other hand though, it brings symmetry to types and values, and makes destructuring feel natural.

  let i: i32 = 1;
  let &i: &i32 = &1;
  let &mut i: &mut i32 = &mut 1;
  let (i, &mut j): (i32, &mut i32) = (1, &mut 2);
I'm not sure how you'd recreate this symmetry without using the same symbol in both places.


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.


That sounds like the field of energy harvesting [1], specifically the "ambient radiation sources" category [2].

The page is ... not short, more people have been thinking about this!

[1]: https://en.wikipedia.org/wiki/Energy_harvesting

[2]: https://en.wikipedia.org/wiki/Energy_harvesting#Ambient-radi...


> I've always wondered if you could harvest that same radio energy to power other things without batteries

That's how passive RFID tags work. The tag has a tiny little computer, and you hold it near a thing that emits an electric field that energizes it.


I think the poster wants this to work without the “you hold it near a thing” part.


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


Can you siphon power from the sun so other people can't get its radiation, without you covering the entire surface with something like a Dyson sphere?


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.

But that's about it. Visible light is very small.


Mr. Burns managed to do it.


In moderation, isn't that a potential upside of space based solar farms?


Are black holes allowed?


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.


Well, if you're mad enough and don't care about trivial things like life, you can listen to AM radio by just touching the mast with any random item:

https://youtu.be/b9UO9tn4MpI


Why am I not surprised to hear the odd «сука» in that video?


There's an anecdote of someone hearing voices, but it turned out to be AM radio.

They found out it was the metal in two cavity filling that made the teeth vibrate and transmitted sound to their ear.

Not sure if it's just an urban legend or legit, but I like that story.


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.

[0] https://www.youtube.com/watch?v=M-Mhl42bu1s



All you need is a rectifying junction: https://en.m.wikipedia.org/wiki/Foxhole_radio

Primitive diodes.


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)


>Poorly shielded wires

That's literally an antenna[1][2], actually.

[1]: https://en.wikipedia.org/wiki/Monopole_antenna

[2]: https://en.wikipedia.org/wiki/Whip_antenna


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.


Nikola Tesla spent a good deal of his time working on wireless power. https://en.wikipedia.org/wiki/Wireless_power_transfer#Tesla


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).


You can power florescent light bulbs underneath high voltage power lines IIRC.


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).


Oh - and a story that actually happened, in a similar vein: https://en.wikipedia.org/wiki/The_Thing_(listening_device)


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.


That seems potentially influential for human health long term. Let alone radio waves are one of the weakest forms.

We've since enveloped the planet with SpaceX satellites. Last I saw a gif, it was terrifying


You mean due process? Sounds great, sign me up!


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.


US law enforcement is not to be trusted. Any data to which they have access is police abuse waiting to happen.


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.


Great point.


If you want compact, use an array of tuples:

  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:

    let foo: [MyStruct; _] = [{a: "foo", b: 1, c: "amp"}, {a: "bar", b: 1, c: "fff"}, {a: "amp", b: 1, c: "aaa"} ];
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...

  fn make_struct(x: (&str, u8, &str)) -> MyStruct {
     MyStruct { a: x.0, b: x.1, c: x.2 }
  }

  let foo = [("foo", 1, "amp"), ("bar", 1, "fff"), ("amp", 1, "aaa")]
    .map(make_struct);
[I have not actually compiled this code, but it should do roughly what you meant]


> discord has a search feature, but it’s pretty awful

Their search makes me want to pull my hair out.

Why can't I just search the history with grep? That's a feature I would pay for (if anyone at Discord is reading this and wants my $10/month)


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.


Microsoft GitHub does this nonsense too stealing add-ons' and native `/` for quick search even when you disable the it in their settings


Massive pet peeve of mine too.


Because it would be obscenely expensive (in terms of computational resources) to search history via grep. Hence why we use an inverted index.


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.


Do you know of any service that is running at scale out there that stores their data as 5mb plain text files?


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 can't say I'm impressed.

https://i.imgur.com/Iq9DcSY.png


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.


How about a nice game of chess?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: