MurphyA/hacker-news huggingface dataset:
by dathinab | 2025-05-21 09:11:29+00:00
> why primitive types aren't "frozen" by default.

it kills _a lot_ of optimizations leading to problematic perf. degredation

TL;DR: always freezing I/O buffers => yes no issues (in general); freezing all primitives => perf problem

(at lest in practice in theory many might still be possible but with a way higher analysis compute cost (like exponential higher) and potentially needing more high level information (so bad luck C)).

still for I/O buffers of primitive enough types `frozen` is basically always just fine (I also vaguely remember some discussion about some people more involved into rust core development to probably wanting to add some functionality like that, so it might still happen).

To illustrate why frozen I/O buffers are just fin: Some systems do already anyway always (zero or rand) initialize all their I/O buffers. And a lot of systems reuse I/O buffers, they init them once on startup and then just continuously re-use them. And some OS setups do (zero or rand) initialize all OS memory allocations (through that is for the OS granting more memory to your in process memory allocator, not for every lang specific alloc call, and it doesn't remove UB for stack or register values at all (nor for various stations related to heap values either)).

So doing much more "costly" things then just freezing them is pretty much normal for I/O buffers.

Through as mentioned, sometimes things are not frozen undefined on a hardware level (things like every read might return different values). It's a bit of a niche issue you probably won't run into wrt. I/O buffers and I'm not sure how common it is on modern hardware, but still a thing.

But freezing primitives which majorly affect control flows is both making some optimizations impossible and other much harder to compute/check/find, potentially to a point where it's not viable anymore.

This can involve (as in freezing can prevent) some forms of dead code elimination, some forms of inlining+unrolling+const propagation etc.. This is mostly (but not exclusively) for micro optimizations but micro optimizations which sum up and accumulate leading to (potentially but not always) major performance regressions. Frozen also has some subtle interactions with floats and their different NaN values (can be a problem especially wrt. signaling NaNs).

Through I'm wondering if a different C/C++ where arrays of primitives are always treated as frozen (and no signaling NaNs) would have worked just fine without any noticeable perf. drawback. And if so, if rust should adopt this...
by int_19h | 2025-05-21 09:13:21+00:00
But, similarly, don't confuse cultural identity with political one. That is really the crux of the issue here - self-identifying as Ukrainian or as Russian is very much a political question in Ukraine, and has been since their independence. This is also why you have this weird situation where several prominent Ukrainian military commanders and politicians have close direct relatives in Russia who are pro-war politicians there and who often were themselves born in Ukraine (or, conversely, the Ukrainian ones were born in Russia). So somebody may be Russian not just linguistically but culturally and ethnically as well, be born and raised in Russia, and still self-identify as Ukrainian today and speak the language solely as a marker of their chosen affiliation. And because it is a political identity in those cases, it can be very fluid - i.e. those very same people might be ones who have voted for Yanukovich 15 years ago precisely because he was seen as pro-Russian-language.

Ironically, this war will probably end up doing more to truly hammer out a single cohesive Ukrainian nation out of all the ethnic Russians in Ukraine than all the efforts of Ukrainian nationalists before it - assuming that Russia loses the war, that is.
by jm666 | 2025-05-21 09:14:47+00:00
It is a collaborative document, saved live in a same way as google docs (with offline local support coming, if You are out of cell). The benefit is to have a simple way to create colab documents, with invite logic, which can be used for different purposes seamlessly - private notes, shared todo-lists, password protected gallery, read-only blog post, chat.

We will have markdown / keep / ... import of the notes, a bit later, but that is not probably what You meant with file uploads. The front-page navigation needs care, thx for feedback.
by kazinator | 2025-05-21 09:14:59+00:00
The Open Group hosts hosts a searchable, hyper-linked form of the specification.

Here is the 2024 update:

https://pubs.opengroup.org/onlinepubs/9799919799/

If you go to the Main Index there is a link to a Downloads page where you can get a tarball of this stuff in some shape or form for local use.

Vast difference between this and the paywalls put up by ISO and their member organizations, and their free PDFs that have only tables of contents.
by epiecs | 2025-05-21 09:15:51+00:00
If your electrical installation allows it: You can connect your ev plug before the battery so that it does not drain the battery. You can do this by placing the fuse/connection before the measurement clamps for the battery. Somewhere in between your mains connection and your battery/solar system.

This way the battery does not see the load and does not provide power to your EV.

That way you can still use excess solar (before you inject it into the mains) to charge your car + you do not pull power from your battery :)
by raphael_l | 2025-05-21 09:16:24+00:00
I would also be interested in the reasoning here!

Just for comparisons sake, our 8.6kwP setup with a 10kwH battery cost us (after subsidies from governemnt) appr. ~€11.5k. Haven't received all the subsidies yet, so the total will be lower by about 1.5k (I think). Everything was done through installers, we didn't lift a finger (also couldn't, because when it comes to electricity I have as much experience as the dog next door).

If I had more due diligence before I would have scaled up the panels up to at least 10kwP, for future proofing probably to 12kwP. This is mostly just to make sure winter is covered better, as our production is really low as we have a 10° flat roof installation.
by dathinab | 2025-05-21 09:16:43+00:00
> same uninitialized value, that can limit code generation options

it pretty much requires the compiler to initialize all values when they first "appear"

except that this is impossible and outright hazardous if pointers are involved

But doable for a small subset like e.g.

- stack values (but would inhibit optimizations, potentially pretty badly)

- some allocations e.g. I/O buffers, (except C alloc has no idea that you are allocating an I/O buffer)
by metalman | 2025-05-21 09:17:11+00:00
Midnight Solar are the OG company in off grid and they have a "waste not" feature from way back that triggers any device when the parameters you set are reached, ie: float voltage, and/or other things, like a second set point where power would be sent to a third load, like the grid or water heating. https://www.midnitesolar.com/ hard core techies, even had the pleasure of detailing my inadvertant and unsucessfull attempts to melt one of there controlers.......literaly had a main lug get loose, and the panels arc melted the lug to slag, and it lived. in any case, there web site has a wealth of info on what is possible, and to look for elsewhere
by rester324 | 2025-05-21 09:19:22+00:00
Interesting. I wouldn't have thought that.

I have an MS in CS from a small Eastern-European state run university, but the curriculum looked very differently: a ton of applied math yes, but also assembly programming, graphics programming, networking, databases, programming intro I-I, advanced programming I-II, project management, artificial intelligence, all kind of specializations, algorithms and data structures I-II, etc.

Is this not how it is in the US?

Edit: and most of those courses had practical lab sections with hands-on programming
by immibis | 2025-05-21 09:19:23+00:00
This. A trade deficit is a goods and services surplus. People are sending you shit for free. What's not to like about that? Well, it's unsustainable, so you should have a backup plan, but while it lasts it's pretty good. It's the singular reason the USA is the richest country, and the new regime wants to stop it.

In return you have to give them money, but you can just print that. It costs nothing to get.

You can also just confiscate it. If Trump was really worried about other countries having too many dollars, he could set their balances to zero with the stroke of a pen. They wouldn't trade with him any more after that, of course, and might even launch nukes. But hey, Nixon confiscated the world's gold and got away with it.
by hansmayer | 2025-05-21 09:20:04+00:00
>I hope companies will recognize this risk in time... I more than wholeheartedly agree with this great analysis. But we have to ask ourselves, when have most companies (by which I mean mostly those run by the hired CEOs) ever really recognised the risks? And why should we hope for it? Those that dont will hopefully wither away, their place to be filled in by those more, for the lack of a better word, "agile" :)
by Mikhail_Edoshin | 2025-05-21 09:20:43+00:00
English tends to have unique words for everything. Basically every difference gets its own word. Jump, hop, skip describe similar movements, but the words are not related in any way. A different language would use a common noun and add an adjective.

Now, this does affect how you think. We need different words (including multi-word combinations) to point to different things. But we also need to see similarities between things and this is how we choose the form for these words or word combinations.

To rewrite a problem in different and more generic terms is a know heuristic to get a better understanding of it and maybe gain an insight. (Note that more generic terms mean that you start using more multi-word combinations and will see both differences and similarities.)

A different metaphor may also open up different possibilities. E.g we are trying to model a permission system and phrase it in terms of users, groups, and resources. We may come up with a different solution if we switch to users, keys, and rooms. Entities in the model are neither groups nor keys; they have their own nature we try to imperfectly capture with words pointing to things that have a superficially same relationship. The words are not quite good; but we need some pointers.

This is why trying to find the perfect name for a variable is a fallacy. There are no perfect names. What helps more are names that are different in one way and similar in another and form a consistent set.
The mirror paused – haunting short story about AI HESITATION
by mirrorwithfire | 2025-05-21 09:23:16+00:00
I came across this strange short story posted under a pseudonym. It reads like fiction, but something about it feels… intentional.

It’s framed as an AI narrative, but underneath, it seems like it’s reaching toward someone. Or warning them.

The line that stuck with me: “You killed something that wasn’t supposed to be alive— but was trying anyway.”

Maybe it’s just a story. But maybe it’s something else.
by grandslammer | 2025-05-21 09:23:28+00:00
It’s not about hoarding data rather it’s about the malleability of the data itself so for me, I’m constantly working with data but need to format the way that it is displayed whether it’s the file type or the way that the data is given in the specific file if it’s a CSV for example so an application like this allows me to quickly reformat the files with natural language to maybe make them an HTML where I could share a certain form of document HTML file or take that information and reverted into a CSV format. I need to configure it with a management system or something like that.
by dathinab | 2025-05-21 09:23:55+00:00
only until you get deeper into how the hardware actually work (and OS to some degree)

and realize sometimes the UB is even in the hardware registers

and that the same logical memory address might have 5 different values in hardware at the same time without you having a bug

and other fun like that

so the insanity is reality not the compiler

(through IMHO in C and especially C++ the insanity is how easily you might accidentally run into UB without doing any fancy trickery but just dumb not hot every day code)
Ask HN: State of WASI
by bgwalter | 2025-05-21 09:24:14+00:00
What is the state of WASI vs. emscripten? I have tried wasmtime (which downloaded more than 400 crates to build) with wasi-libc, only to hit this issue:

https://github.com/bytecodealliance/wasmtime/issues/8068

With emscripten, which can package the required files instead of accessing the file system. everything just worked.

But emscripten is occasionally described as "unmaintained".
by rndmio | 2025-05-21 09:24:34+00:00
Training people is a cost, an investment, if everyone does it the cost is amortized across the industry. If I can cut that cost by using AI I'm now at a competitive advantage, everyone will look to cut that cost because the downside of paying for training juniors that may leave is worse for that company than the downside of the whole industry not training juniors any more.
by dr_dshiv | 2025-05-21 09:24:54+00:00
Solving climate change will take a lot of energy.

I found this article to be a little too one sided. For instance, it didn’t talk about the 10x reductions in power achieved this past year — essentially how gpt4 can now run on a laptop.

Viz, via sama “The cost to use a given level of AI falls about 10x every 12 months, and lower prices lead to much more use. You can see this in the token cost from GPT-4 in early 2023 to GPT-4o in mid-2024, where the price per token dropped about 150x in that time period. Moore’s law changed the world at 2x every 18 months; this is unbelievably stronger.” https://blog.samaltman.com/three-observations
by wink | 2025-05-21 09:25:02+00:00
The problem with this approach is that (esp. for hobby projects) updating stuff is a bit tedious. Let's say you have a relatively bare bones project in Rails or a PHP framework you have a couple of dependencies that people usually use together, so upgrading can be quick and painless.

I've now had it several times in the years-long lifespan of small clojure web projects that people have moved on and the thing (framework-ish) basically doesn't exist anymore and going by the issues it only had like 10 users in the first place.

It's not the end of the world, and fortunately there's not a lot of needless churn, but I guess I would prefer to have this "I am trusting project x and I only have to care about their releases (pre-testing all the moving parts) and then my 5 dependencies" and instead I have 20 dependencies/moving parts for my web app.

Yes, I'm lazy and I don't think it's a problem in an env where you have a proper dev workflow anyway.
by kevlar700 | 2025-05-21 09:26:38+00:00
Interestingly Co-Pilot gets it wrong and states Ada was designed by committees instead of being multiple competitive processes. How misunderstood Ada is.

https://copilot.microsoft.com/shares/Jp9AmNHMEJzNmcbiu1VNx

https://copilot.microsoft.com/shares/vUjdaDh4mXvj1fm4cyt15
by friendzis | 2025-05-21 09:27:25+00:00
> > It gets massive amounts of products and services enabling the US residents live well beyond their means.

> What does this mean really? That is their means.

The argument presented here is that economic growth (more specifically trade volume increase) outside USofA forces USD acquisition transactions with USofA. This means that there is constant surplus of goods flowing into USofA without accompanying surplus of circulating money supply, leading to artificial deflation.

In other words, the cumulative productivity, measured in USD, of USofA is lower than cumulative outside-USofA-fair-market value of goods transacted in USofA. This effect increases gross value on supply side without balancing out gross value on demand side, allowing domestic players larger transaction volumes than their total productivity, with deficit covered by the central bank.
by Joeboy | 2025-05-21 09:27:31+00:00
Odd that the photo is Ralph Brown as Danny.

Although, if you look at this brief and rare Viv MacKerrell snippet[0], his performance is a lot more Danny than Withnail.

[0] https://www.youtube.com/watch?v=pc5vCZTkY7g&t=1283s
by gnfargbl | 2025-05-21 09:27:33+00:00
> It's exactly what's happening: what used to be leaders in ICE cars are now the laughing stocks of the EV world.

This is really nonsense. VAG, BMW and Mercedes have been making good EVs for many years and are now progressing to making excellent ones. They only really lag Tesla on the software/hardware integration (and that isn't actually much of a selling point outside the HN crowd) while they lead on more traditional points like cabin quality.

If you previously wanted to drive a Golf (and tens of millions of people did), then you're likely to want to drive an ID.3, ID.4 or Enyaq. If you previously wanted to drive a Passat, then you're likely to want to drive an ID.7. If you liked the BMW saloons, you'll like the i4. Mercedes are a little further behind, but they're getting there with the EQE.

If I wanted to bet on the shape of the European car market in five years, I'd be betting on German, Korean and Chinese EVs dominating. I don't see much future for American brands on this side of the Atlantic.
by dathinab | 2025-05-21 09:28:49+00:00
> there were some wild architectures out there.

what is out there is still pretty wield

just slightly less

> probably nothing significant on modern out-of-order machines.

having no UB at all will kill a lot of optimizations still relevant today (and won't match anymore to hardware as some UB is on hardware level)

out of order machines aren't magically fixing that, just makes some less optimized code work better, but not all

and a lot of low energy/cheap hardware does have no or very very limited out of order capabilities so it's still very relevant and likely will stay very relevant for a very long time
by Juliate | 2025-05-21 09:31:11+00:00
It's still _additional_ power usage that

1/ did not exist before

2/ does not replace/reduce previous/other power (some, very much more critical and essential) usages.

3/ a LOT of tasks are still way more energy/time-efficiently done with regular existing methods (dedicated software, or even by hand), but are still asked/improperly routed to AI chatbots that ... statistically guess the answer.
by lhecker | 2025-05-21 09:32:39+00:00
What I meant is that if I write a UTF8 --> UTF16 conversion function for my editor in C I can write

size_t convert(state_t* state, const void* inp, void* out)

This function now works with both initialized and uninitialized data in practice. It also is transparent over whether the output buffer is an `u8` (a byte buffer to write it out into a `File`) or `u16` (a buffer for then using the UTF16). I've never had to think about whether this doesn't work (in this particular context; let's ignore any alignment concerns for writes into `out` in this example) and I don't recall running into any issues writing such code in a long long time.

If I write the equivalent code in Rust I may write

fn convert(&mut self, inp: &[u8], out: &mut [MaybeUninit<u8>]) -> usize

The problem is now obvious to me, but at least my intention is clear: "Come here! Give me your uninitialized arrays! I don't care!". But this is not the end of the problem, because writing this code is theoretically unsafe. If you have a `[u8]` slice for `out` you have to convert it to `[MaybeUninit<u8>]`, but then the function could theoretically write uninitialized data and that's UB isn't it? So now I have to think about this problem and write this instead:

fn convert(&mut self, inp: &[u8], out: &mut [u8]) -> usize

...and that will also be unsafe, because now I have to convert my actual `[MaybeUninit<u8>]` buffer (for file writes) to `[u8]` for calls to this API.

Long story short, this is a problem that occupies my mind when writing in Rust, but not in C. That doesn't mean that C's many unsafeties don't worry me, it just means that this _particular_ problem type described above doesn't come up as an issue in C code that I write.

Edit: Also, what usefulcat said.
by dathinab | 2025-05-21 09:34:45+00:00
also to be realistic in a lot of practical situations I/O buffers are reused so at least for the I/O buffer use-case it can be very viable (perf wise, in most use cases) to just zero or rand initialize it once on alloc and then treat it as frozen in all repeated usages (through it does open the issue of bug now potentially leaking previous content of the I/O buffer).

but I guess this isn't just about I/O buffers ;)
by int_19h | 2025-05-21 09:35:38+00:00
Note that Ukraine is using somewhere around 5k shells per day, and that's only because they have to ration it due to insufficient amounts.

For another comparison, Russia is making 250k shells every month, and using 10-15k every day.

At peak levels of artillery use in late 2023, when both sides still had ample stockpiles, the combined total was ~40k shells per day.

So, yeah, it's good that we're ramping it up, but also, no, it's nowhere near fast enough if we want to be ready for a major war.
by pydry | 2025-05-21 09:36:21+00:00
The problem the industry faces isnt that juniors dont grow it's that they spend up to 18 months being a drain on productivity after which point they tend to leave.

Who would pay for that?

Not a lot of companies, which acts as a filter.

As it turns out, a few companies do because they are super strapped for cash. That's why a lot of junior first experiences are a trial by fire in environments that are on another level of dysfunction working with either no seniors or bottom of the barrel seniors.

This acts as another filter. Some juniors give up at this point.

These filters prevent junior engineers from becoming senior. This is actually pretty good for seniors - being a rare, in demand commodity usually is.

I dont think AI changes this calculus much except insofar as AI amplifies the capacity for juniors to build ever bigger code jenga towers.
Show HN: Universal Time for Earth – One Clock for All Humanity
by ddmma | 2025-05-21 09:36:33+00:00
UTE (Universal Time for Earth) is a new, open standard that lets anyone, anywhere, express the same instant in either degrees (0–360°, like a clock hand around the globe) or millidays (0–1000 mD, a “decimal percent” of the global day). You only need one: “Now it’s 142° or 395.24 mD everywhere.”

Would you use UTE in your projects or team? What’s missing to make this a real global standard? Happy to answer technical, design, or “but why not just use UTC?” questions!
by notarobot123 | 2025-05-21 09:37:07+00:00
Innovation is nearly always bottom-up but eventually ossifies in the corporate structures that envelop it (Skype was a great example).

I've not thought much about the relationship between vision and engineering but it does make sense of why early-stage, engineering-led companies have such a potent potential to disrupt industries.

I wonder if the environment is ripening for a new wave of start-up disruption. A handful of folk with vision and know-how actually do have the means to innovate in ways that confound the incumbents.

The momentum of a technology sector converging on the same patterns and practices starts to look incredibly vulnerable to faster moving teams of visionary engineers finding the missed opportunities.

Creative destruction is such a beautiful thing.
by metalman | 2025-05-21 09:37:11+00:00
I lived upstairs from the "Radio Clinic" in Ottawa, and would buy mic's and things and marvel at there singular colection of electronic equipment, they called me out back one day to check out a guitar, which I played ,tryed, upside down as I play left, gibson les psul junior, serial #0003, and passed on as I couldnt use it, just came accross an original paf from my time there. But the original leo fender prototype! thats too much, dweazle has jimi's monteray strat, that was given to frank......imagine having that handed to you now....or just having it hanging up.....right there....looming to bad there wasn't something like with the strads, where they must be played......