MurphyA/hacker-news huggingface dataset:
C++ ranges/views vs. Rust iterator
by bijan7 | 2025-09-15 19:11:43+00:00
it seems there is a quite a bit of gap between the performance of Rust iterator and C++ ranges/views unless I am missing something.

https://godbolt.org/z/v76rcEb9n https://godbolt.org/z/YG1dv4qYh

Rust: <code> use std::time::Instant;

fn expand_iota_views(input: &[i32]) -> impl Iterator<Item = i32> + '_ { input .iter() .flat_map(|&n| 1..=n) .flat_map(|n| 1..=n) .flat_map(|n| 1..=n) }

fn main() { let input: Vec<i32> = (0..=50).collect();

let sample_result: Vec<i32> = expand_iota_views(&input).collect(); println!("Rust Result count: {}", sample_result.len()); let start = Instant::now(); let mut total_count = 0; for _ in 0..1000 { let result = expand_iota_views(&input); total_count += result.count(); } let duration = start.elapsed(); println!("Rust Total count (1000 iterations): {}", total_count); println!("Rust Total time: {} microseconds", duration.as_micros()); println!( "Rust Average per iteration: {:.2} microseconds", duration.as_micros() as f64 / 1000.0 );

} </code>

Output: Rust Result count: 292825 Rust Total count (1000 iterations): 292825000 Rust Total time: 1025 microseconds Rust Average per iteration: 1.02 microseconds

C++: <code> #include <chrono> #include <iostream> #include <numeric> #include <ranges> #include <vector>

inline auto expandIotaViews(const std::vector<int>& input) { auto iota_transform = [](const int number) { return std::views::iota(1, number + 1); };

return input | std::views::transform(iota_transform) | std::views::join | std::views::transform(iota_transform) | std::views::join | std::views::transform(iota_transform) | std::views::join;

}

int main() { std::vector<int> input(51); std::iota(input.begin(), input.end(), 0);

auto sample_result = expandIotaViews(input); std::vector<int> result_vec; for (auto val : sample_result) { result_vec.push_back(val); } std::cout << "C++ Result count: " << result_vec.size() << std::endl; auto start = std::chrono::high_resolution_clock::now(); size_t total_count = 0; for (int i = 0; i < 1000; ++i) { auto result = expandIotaViews(input); total_count += std::ranges::distance(result); } auto end = std::chrono::high_resolution_clock::now(); auto duration = std::chrono::duration_cast<std::chrono::microseconds>(end - start); std::cout << "C++ Total count (1000 iterations): " << total_count << std::endl; std::cout << "C++ Total time: " << duration.count() << " microseconds" << std::endl; std::cout << "C++ Average per iteration: " << duration.count() / 1000.0 << " microseconds" << std::endl; return 0;

} </code>

Output: C++ Result count: 292825 C++ Total count (1000 iterations): 292825000 C++ Total time: 174455 microseconds C++ Average per iteration: 174.455 microseconds
by xp84 | 2025-09-15 19:11:50+00:00
I am in a similar place, I think, to you. Caveat: I don't spend a lot of my day-to-day coding anyway, so that helps, but I've never even tried Cursor or Windsurf. I just poke copilot to write whole functions, or ask ChatGPT for things that seem like they'd be tedious or error-prone for me. Then I spend 3-5 minutes tying those things together and test. It saves about 80% of the time, but I still end up knowing exactly how the code works because I wrote most of the function signatures and reviewed all the code.

I know in the very right circumstances the "all-in" way could be faster, but it's already significant that I can do 5x as many coding tasks or do one in a fifth the time. Even if it never ever improves at all.
by hopelite | 2025-09-15 19:11:59+00:00
I didn't catch that, but my point not only still stands as it applies to both Germanies, and really only makes my point even more salient.

Fact of the matter is that Germany simply does not have anything that can be considered a Constitution/Verfassung no matter how much Germans are bamboozled to believe they have something like a Constitution; a core set of laws that cannot simply be removed by a captured body of government.

If it is a Constitution/Verfassung, what is the obtuse nonsense that "the human dignity is inviolable" in the German basic law, when the German government has done nothing but violate the dignity, not even to mention the rights of the German people? They don't even abide by their own basic law.

What else can you call it when like happened in Germany a few months ago, a government that had already failed, held elections which it lost in the form of clear rebuttal of its policies, and then before ending and then further engaging in undemocratic practices, quickly voted to majority change this fake "Constitution".

Imagine if the US House controlled by Republicans could, after the midterm elections where Democrats take a major number of seats, simply just voted to change the constitution so that Democrats could not take control in a single vote. Would you consider that as having a Constitution?... a fundamental, difficult to move foundation of law that even the legislature had to abide by as it is only very difficult to change?

That is the fundamental difference between a constitution and just a facade of "fundamental law" that acts as if it is a Constitution in Germany.

Again, it also seems to be ignored that this fake Constitution in not even only Germany, but effectively all European countries is being totally subverted and undermined by the illegitimate suppression of EU fake law crated by an entity that was simply imposed on Europe without any objective legitimacy democratic legitimacy.

It sometimes disappoints me just how ignorant Europeans are of not only their own government situation, but even across Europe and America. These are not difficult concepts and not a matter of "I'm better than you", it's simply a matter of objective analysis and people don't like their ugly baby being called ugly.
by 0xffff2 | 2025-09-15 19:12:06+00:00
I'm old enough to remember when supermarket brown paper bags didn't have handles... Agree with the other commenter that the handles are pointless but the bags work fine if you just ignore them.

Incidentally, given that I'm _not_ old enough to remember a time before supermarkets had plastic bags, either the invention of attaching handles to paper bags took a very long time to migrate to my corner of California, or this comment makes no sense
by rs186 | 2025-09-15 19:12:20+00:00
LOL downvoted. The sentence "self hosting fonts is as easy as making the static font files available and then adding a few lines of CSS" is a complete lie and you could tell they have never gone through the process themselves and were just making things up.

If you don't believe me, you are welcome to try it out yourself FROM SCRATCH without any references whatsoever, and see how long it takes you to come up a solution that works on all 5 or 6 platforms, desktop or mobile.
by apsurd | 2025-09-15 19:12:29+00:00
I'm going to read this article because the image is cool and I love California.

But I had to comment on how obnoxious this website is with my NextDNS mistakingly disabled. What have we done to the Internet! 3 popups to sign up for paid, newsletter and web alerts. scroll down to see auto playing videos, ridiculous full-banner ads.

wow
by secondcoming | 2025-09-15 19:13:01+00:00
Nice. I think most people have tried doing something like this in C++ at some point.

One issue that I had is that printing floating-point values really needs the ability for the user to specify the precision and format. It's actually absurd that `std::to_string(double)` does not allow this.

Also, I believe `std::to_chars(double)` uses a fast algorithm and allows writing directly into a buffer.
by thomas8787 | 2025-09-15 19:13:14+00:00
The winter months and parts of the fall months are hardest due to a lack of sunshine. Without an EV, from March until late September a 5kWh battery is enough for me to keep my daily grid power consumption close to 0. A 5kWh plug-in battery now costs around 1299EUR. Pays back itself in a handful of years.

Batteries are similar to solar panels in this regard. With solar, the first couple of kilowatt-peak delivers the biggest savings. With batteries, it's the same with the first couple of kWh of storage capacity.
by famouswaffles | 2025-09-15 19:13:15+00:00
>However people are definitely using it, as Android doesn't do Python, neither does ChromeOS.

That's not really a reason to think people are using it for that when things like onnxruntime and executorch exist. In fact, they are very likely not using it for that, if only because the torch runtime is too heavy for distribution on the edge anyway (plus android can run python).

Regardless, that's just inference of existing models (which yes I'm sure happens in other languages), not research and/or development of new models (what /u/airza was concerned about), which is probably 99% in python.
by layman51 | 2025-09-15 19:13:17+00:00
Do you have any other small examples of stuff I could try out to test-drive the Gemini integration for Google Sheets? My colleague tried it out to get it to make a chart, but it ended up failing at the task. It was hard for me to evaluate it though because it seems like when you use Gemini inside of Sheets, there's no way to share the conversation. That's horrifying, especially if it is responding back with delusions of grandeur.
by ndriscoll | 2025-09-15 19:13:53+00:00
You missed these requirements for developers

> (b) (1) A developer shall request a signal with respect to a particular user from an operating system provider or a covered application store when the application is downloaded and launched.

> (b) If an application last updated with updates on or after January 1, 2026, was downloaded to a device before January 1, 2027, and the developer has not requested a signal with respect to the user of the device on which the application was downloaded, the developer shall request a signal from a covered application store with respect to that user before July 1, 2027.

Application developers are required to request an age signal from the operating system.

> (c) “Application” means a software application that may be run or directed by a user on a computer, a mobile device, or any other general purpose computing device that can access a covered application store or download an application.

So applications are any program that runs on any computer with the capability to install software from an online source. Ergo, a program like `sort` must request an age signal when it runs.

The bill is clearly thinking in terms of the two big phone monopolists while ignoring computers that are meant to act as useful tools (which contain thousands of programs from tens of thousands of authors and which have no business caring about what "store" they came from or what date they were installed on or anything about the user running them), but it explicitly says it applies to general purpose computers.

A massive improvement would be to say this only applies when there is an actual commercial store involved, and only place requirements on developers to do something if they would have some other requirement they need to comply with. And also realize that lots of applications are not meant to have the user there the whole time. How are batch jobs or interpreters like `python ` that you might leave running overnight on a job supposed to deal with the time limit? This bill is entirely focused on toys at the expense of computers. It should just place requirements on the actual companies that are causing the issues (social media/adtech, porn, gambling games, etc.)

Your store doesn't distribute social media apps, gambling, porn, etc. and just has things like text editors, music players, PDF readers, etc? No requirements should be needed. You develop a workout tracker? No requirement should be needed.
by hdNLouie | 2025-09-15 19:14:08+00:00
An air-gapped 386, ASUS eee 900hd 901.. are my primary boxen, distained `netbooks' running SUSE 11.1 2008. I've idle 20 ARM rpi's, other 486's. My stack is emacs perl 5.0, gcc, TeX, pari/GP, maxima, and beautiful gpm transporter among tty terminals.

One 386 netbook runs xbuntu w/ firefox to waste hours in the dangerous wild except for HN. It's all a happy arrested-development `Smell of Teen Spirit' nook I continue growing in.
by visarga | 2025-09-15 19:14:22+00:00
You have no idea how much personal work went behind it. You just suspect it was worded with a LLM.

I have been using embeddings for almost a decade and am well versed with their intricacies. I think this article has merit. The direction of the investigation and the conclusion are interesting, good to have people thinking about how many distinct concepts can be packed in our usual embedding dimension. Wondering how small can you make embedding before a model becomes noticeably worse, given constant parameter count.
by BizarroLand | 2025-09-15 19:14:58+00:00
Use heat and pressure and electricity and you can convert CO2 and Hydrogen into Methane.

Methane when burned releases the CO2 back into the atmosphere, but if you're mining the CO2 from the atmosphere to begin with it pretty close to carbon neutral fuel.

https://news.osu.edu/turning-carbon-emissions-into-methane-f...
by 12_throw_away | 2025-09-15 19:15:03+00:00
I swear I don't usually complain about UI styling updates, because it's usually not a big deal - but this looks really, really bad [1]. It's less functional with bizarre transparency choices destroying legibility, and big rounded corners taking up more dead space. And stylistically, the layouts just look unbalanced and amateurish (It reminds me of what happens when I attempt to do CSS layouts). Most Linux desktops unironically look better than this.

https://arstechnica.com/gadgets/2025/09/macos-26-tahoe-the-a...
by 827a | 2025-09-15 19:15:05+00:00
My suspicion is that genpop is not going to like it, broadly, mostly because the only people who seem to think that operating systems should have "personality" are techies. People just don't think like that; most people view these systems as means to an end, and anything that isn't in service to that is, at best, simply an interesting diversion for the first few days.

One thing I dislike the most about liquid glass is the new bottom tab bar that's been inserted into every first-party app. Apple Music got it the worst. There's now an additional click required to "move" between the Search interface and the remaining four tabs (Home, New, Radio, Library). When you click on Search, you need to click the the Search Box again to get a keyboard. All of these interactions have extremely sophisticated and slow animations; e.g. when on Home, clicking on Library slides a bubble across the tab bar that blows up beyond the tab bar itself, reflecting the intermediate tabs and underlying content, in a way that is tremendously distracting and serves no purpose. Neither Reduce Transparency nor Reduce Motion have any impact on these animations, on the latest release.

In fact, many of Apple's first party apps appear to have forgotten that Reduce Transparency and Reduce Motion even exist as accessibility options, or at best have half-assed their implementation. For example, with Reduce Motion enabled, clicking on an album in Apple Music deploys a much more subtle animation (good); clicking the back button uses that same subtle animation (good); but swiping back from the left uses the flowery, unnecessary animation that you'd get with Reduce Motion off. Apple Podcasts has the same problem. iMessage, as far as I can tell, totally disregards the Reduce Motion setting and does nothing different, and implements the Reduce Transparency setting not by softening the transparency as other apps do, but instead underlaying a #000000 black background on every item that did have transparency. There's dozens of examples all across iOS, and we're quite literally days from release; dropdowns such as the Apple Notes or Apple News hamburger [...] menu should animate less under Reduce Motion, but don't; when buttons are disabled on the keyboard, such as Apple News -> Search -> empty search box, the Enter button is greyed out in the wrong, barely legible color, only when Reduce Transparency is enabled, the list goes on.
by dang | 2025-09-15 19:15:22+00:00
What I define as perpetuating flamewars is posting comments that add to a flamewar and thereby provoke other people into continuing the flamewar.

Here is a random sample of you posting abusively to HN:

> There is certainly a racist piece of shit in this conversation but you may wish to look closer to home.

> I suspect you’re very young and not good at arguing

> if you’re not going to read when I respond to you there’s no point having this conversation.

> I think maybe we should stay and you should go.

Worse you've continued to post in this style after I asked you to stop: https://news.ycombinator.com/item?id=45252836.

Moreover, your account has been using HN primarily for political and ideological battle for quite some time. As you know (or ought to), that's another line at which we ban accounts: https://hn.algolia.com/?sort=byDate&dateRange=all&type=comme...

If you want to keep posting to HN, we need you to stop doing these things—that is, stop perpetuating flamewars, stop posting abusively, and stop using the site primarily for political battle. You're already over the line, and I'm cutting you slack because you've been around here such a long time. But if we're going to ban other people for abusing the site, it's hardly fair to keep giving an account behaving like yours has been a pass.
by jrowen | 2025-09-15 19:15:37+00:00
With each generation things change, the goalposts get moved. What was cutting edge for us is the default state of the world for them. And things are definitely moving faster than ever before.

But human nature does not move that fast. It's arguable that we are largely the same as pre-tech humans. I guarantee that the biological property of human curiosity did not materially shift between our generation and the next. Every generation expresses the sentiment that some form of technology has ruined today's kids because we had it so much harder, we had to do X, whatever. Our parents were saying the same about us. And every time the kids find a way to innovate. I am so so weary of any claim that somehow this time the cycle has been broken.

Occam's razor says no, that's just how you feel when you get older. We already know this. To me it's the height of hubris and folly to actually believe "well they really broke the mold with us and now we're doomed."
by AfterHIA | 2025-09-15 19:16:24+00:00
I always keep a few bucks on the PayPal card to forget about until the next time I don't have my card and I'm like, "oh shit I have enough for a beer on this bastard" and it's like a mini-Christmas.

The thing that gets me is the 40% cash back on Walmart purchases up to 500$. It's such an incredible incentive it has to be shady af. Are the Rand oligarchs trying to buy out the poor? We'll never know because poor people don't have PayPal accounts.

"A something-or-another big enough to give you everything you want is a something-or-another big enough to take from you everything you have." -Voltaire
by xp84 | 2025-09-15 19:16:56+00:00
I plan to retire in the next 10-15 years and then 'grudgingly' accept very large checks to teach noobs to be competent enough to replace the recently-retired seniors, since companies are and will continue to, foolishly not hire and develop junior engineers anymore. It seems to me like most firms have almost involuntarily placed an enormous unhedged bet on LLMs being able to do the job of senior and staff software engineers by 2030-2035, which I'd say is certainly a possibility but boy howdy is it going to be an expensive bet to lose if they're wrong.
by nwienert | 2025-09-15 19:17:43+00:00
Maybe 5 years ago this was a true, they accelerated development and their standards support is pretty good now, better than FF. Again, not counting Chrome's "EEE" non-standard API's, they largely move fast and implement most modern ones. Some PWA stuff is missing which is valid, while Chrome is behind on a few nice design-focused standards Safari has.

Go here:

https://caniuse.com/?compare=chrome+143,safari+26.0&compareC...

Note the non-supported Safari API's, the vast majority are not web standards.
by apsurd | 2025-09-15 19:18:49+00:00
Yep, I've found blocking at at the dns level more convenient since I'd otherwise have to install script blockers per web-browser. I'm very happy with nextdns

I wanted to add that every time I use the internet without a blocker, it's so depressing to realize this is how a lot of people, mostly older, experience the Internet. Very sad as someone in the industry.
by vusaldev | 2025-09-15 19:19:32+00:00
i kept signing up for free trials (netflix, spotify, random apps) and totally forgetting to cancel. every month i’d see charges on my card and get annoyed at myself.

so i built a simple subscription tracker that shows all your recurring payments in one place. it helps me see what i’m actually paying for, and reminds me to cancel stuff i don’t need.

here’s a short video demo of how it works: subtrack.space
by other8026 | 2025-09-15 19:19:32+00:00
I'm one of GrapheneOS's moderators and just saw this.

What I see here is someone who wants a feature, a feature that many people want, but it hasn't been added for reasons listed in the GrapheneOS issue tracker. No one was rude or anything there in that link you shared that I can see.

> the lead developer responds makes it look like there are some serious unresolved mental issues

To say something like this is extremely out of line.

> Louis Rossmann’s video

What you fail to mention here is incredibly important context, but leaving that out conveniently supports the narrative that Daniel is crazy. Biggest fact there is that he had just been swatted multiple times. Louis commented on another harassment video and Daniel was understandably upset. By the way, the swatter had been in contact and even told GrapheneOS project members that they were a fan of the YouTuber who made the first video. So, attempted murder by some other person, a "friend" was supporting harassment content making him out to be "crazy" and comments on that video showing support for it, then, knowing that, Louis records a video of a private conversation in real time. The video itself was filled with lies and misrepresentations. Even the title was a lie because Rossmann continued to use GrapheneOS for long after that video was released.

Not to mention the fact that targeted updates aren't even possible on GrapheneOS considering how updates work and the infrastructure. Louis may not understand these things, but even though we and others have pointed this fact out multiple times, the video remains up. The video is clearly meant to do one thing: damage or destroy GrapheneOS.