frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Vancouver PD website features Quick Escape button that wipes itself from history

https://vpd.ca/
75•LookAtThatBacon•1h ago•29 comments

TS-2026-009: Insecure argument handling in Tailscale SSH permitted root access

https://tailscale.com/security-bulletins
31•jervant•51m ago•7 comments

Bonsai 27B: A 27B-Class model that runs on a phone

https://prismml.com/news/bonsai-27b
438•xenova•8h ago•163 comments

Dependabot version updates introduce default package cooldown

https://github.blog/changelog/2026-07-14-dependabot-version-updates-introduce-default-package-coo...
99•woodruffw•4h ago•62 comments

The Tower Keeps Rising

https://lucumr.pocoo.org/2026/7/13/the-tower-keeps-rising/
343•cdrnsf•9h ago•165 comments

Financing the AI boom: from cash flows to debt [pdf]

https://www.bis.org/publ/bisbull120.pdf
88•1vuio0pswjnm7•4h ago•35 comments

Solving 20 Erdős Problems with 20 Codex Accounts Running in Parallel

https://www.starfleetmath.com/
20•colin7snyder•1h ago•4 comments

Cursor 0day: When Full Disclosure Becomes the Only Protection Left

https://mindgard.ai/blog/cursor-0day-when-full-disclosure-becomes-the-only-protection-left
252•Synthetic7346•8h ago•107 comments

C++20 Improved the For-Loop Syntax

https://lzon.ca/posts/tips/cpp-for-range-init/
25•jpmitchell•3d ago•29 comments

How I use HTMX with Go

https://www.alexedwards.net/blog/how-i-use-htmx-with-go
116•gnabgib•6h ago•27 comments

Your 'app' could have been a webpage (so I fixed it for you)

https://danq.me/2026/07/09/your-app-could-have-been-a-webpage/
722•MrVandemar•3d ago•444 comments

LeMario: Training a JEPA World Model on Super Mario Bros

https://www.benjamin-bai.com/projects/lemario
49•kevinjosethomas•3h ago•5 comments

An unusual way for your DHCP server to run out of dynamic IPs

https://utcc.utoronto.ca/~cks/space/blog/sysadmin/DHCPServerAndScreamingHost
19•speckx•4d ago•1 comments

Data centers have hiked electricity prices on the public by $23B

https://fortune.com/2026/07/14/data-centers-23-billion-electricity-bills/
47•measurablefunc•1h ago•11 comments

Mathematical texts from a Maya site in Guatemala identify an ancient astronomer

https://www.nature.com/articles/d41586-026-02170-8
38•homarp•14h ago•8 comments

Unlocking the PSP's Dual Core Setup

https://wololo.net/2026/06/16/unlocking-the-psps-dual-core-setup/
41•msephton•4d ago•4 comments

How to stop Claude from saying load-bearing

https://jola.dev/posts/how-to-stop-claude-from-saying-load-bearing
435•shintoist•14h ago•500 comments

The largest available Minecraft world, totalling 15 TB

https://2b2t.place/1million
165•_____k•3d ago•55 comments

The Estranged Worlds of J. G. Ballard

https://lareviewofbooks.org/article/jg-ballard-illuminated-man-christopher-priest-nina-allan/
38•Caiero•1d ago•6 comments

I'm a USB-C Maximalist

https://shkspr.mobi/blog/2026/07/im-a-usb-c-maximalist/
167•speckx•10h ago•272 comments

Microsoft Patches a Record 570 Security Flaws

https://krebsonsecurity.com/2026/07/microsoft-patches-a-record-570-security-flaws/
28•robin_reala•4h ago•19 comments

Guardian Angels: LLM Personalization for Productivity and Security

https://gwern.net/guardian-angel
58•andsoitis•13h ago•7 comments

The kids with phones are alright

https://heatherburns.tech/2026/07/08/the-kids-with-phones-are-alright/
128•JumpCrisscross•3d ago•90 comments

Kontigo (YC S24) Is Hiring (Head of Security)

https://www.ycombinator.com/companies/kontigo/jobs/uNttrlv-head-of-security
1•jecastillof•8h ago

The zero-cost fallacy: open-source software in the agentic era

https://www.thoughtworks.com/insights/blog/open-source/zero-cost-fallacy-open-source-agentic-era
108•backlit4034•4d ago•84 comments

Are we offloading too much of our thinking to AI?

https://www.artfish.ai/p/offloading-thinking-to-ai
381•yenniejun111•10h ago•384 comments

Show HN: Opening lines of famous literary works

https://www.verbaprima.com/
144•plicerin•10h ago•82 comments

Launch HN: Agnost AI (YC S26) – Extract user feedback from agent conversations

https://agnost.ai
46•laalshaitaan•9h ago•33 comments

Probably check on your smart appliances

https://xeiaso.net/notes/2026/check-your-smart-tv/
19•xena•3h ago•6 comments

Show HN: Juggler – an open-source GUI coding agent, by the creator of JUCE

https://github.com/juggler-ai/juggler
180•julesrms•2d ago•80 comments
Open in hackernews

C++20 Improved the For-Loop Syntax

https://lzon.ca/posts/tips/cpp-for-range-init/
25•jpmitchell•3d ago

Comments

HarHarVeryFunny•3d ago
C++20 also has an enumerate() generator, so if you like the python syntax you can just do:

for (auto [i,v] : std::views::enumerate(vec)) std::cout << i << ": " << v << std::endl;

FWIW C++23 also has a python-like print and println:

std::println("{}: {}", i, v);

BigTTYGothGF•23m ago
The enumerate is a better solution than the one in the blog post.
arikrahman•13m ago
This is the way I've been doing it and with less hiccups.
Maxatar•10m ago
std::views::enumerate is a C++23 feature, not C++20.
WCSTombs•3d ago
The C++20 version is still clearly inferior to the Python and Lua examples because you still have to manually increment the counter in the loop body. IMO the sibling comment by HarHarVeryFunny has a much better C++ equivalent for this idiom, even if it's slightly more verbose.
Gualdrapo•1h ago
> you still have to manually increment the counter in the loop body

It doesn't look like that to me, the ++i thing seems to be just to start printing the array from 1 (I don't know how things are in Python nowadays but I know in Lua arrays start at 1, so there's no need for something like this in there), the value of i is still increasing without telling it explicitly to do so

sheept•1h ago
Python is 0-indexed. In OP's example, the start parameter makes i start at 1.

Their C++17 example prints starting from 0. Probably a mistake.

If you look at the linked page for C++20[0], other types can be put in the initializer statement, so it's unlikely the loop auto-increments.

[0]: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p06...

kbenson•58m ago
So, it's just a while loop in a for loop's clothing? That's not going to be confusing for people at all...
comex•40m ago
No, it's a for loop that happens to include an unrelated variable declaration.
moron4hire•1h ago
No, the increment is necessary to keep the counter going. The choice of pre-increment versus post-increment handles the "start at 1" issue you mentioned, but it isn't auto incrementing.
fourseventy•1h ago
Just what C++ needs, more bloat lol.
petilon•1h ago
C++ is probably the only language that needs a strong style guide, to define a subset you are allowed to use in the project.

Linus Torwalds famously said that subset is zero. You're not allowed to use C++ in Linux, a wise move.

Here's Google's: https://google.github.io/styleguide/cppguide.html Search for "do not use" and you'll find plenty of hits.

tcfhgj•45m ago
> C++ is probably the only language that needs a strong style guide,

here you go: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines

zeroq•15m ago
Good Lord.

Reminds me of Good Parts, Bad Parts meme of JS.

Gualdrapo•1h ago
The way this website shows the programming languages is odd. They're blue and slanted and if you hover your mouse cursor over them they have a color transition, so you'd think they are links - and yet you click on them and nothing happens
adityamwagh•47m ago
> It seems to me that the C++ Standards Committee is doing a decent job maintaining the language, and introducing useful features when it makes sense to do so.

This can’t be further from truth. C++ is essentially Frankenstein’s monster.

gregdaniels421•18m ago
An articulate creature that hounds its creator for abandoning it?

If anything it is more of a Chimera

saghm•15m ago
And the real monster was the one who created it all along!
galkk•38m ago
Only people who saw nothing bad in passing pairs .begin(), .end() in tons of places in c++ for like 30 years can say that thing like ‘auto&&’ improves anything.
dvt•36m ago
I am so happy I haven't written a line of C++ in like 15 years. Absolutely disgusting language. Every time I look up one of their new standards, I'm like how does anyone keep all of this in their head (usually on top of stuff like boost, etc.)? No wonder LLMs are a thing.
lioeters•11m ago
C++ is a decades-long mistake that spawned other misguided directions in the entire software industry. We're still trying to undo many of the bad ideas, but I'm afraid even Rust has too much of C++ in it, not only in terms of syntax but mentality and culture. LLMs are making things worse by automatically generating code in such bloated languages, where people have less need to even look at the horrific spaghetti inside. The whole thing needs to be reconsidered from the ground up, from first principles, by actual creative thinking human beings with lessons of hindsight.

> Gall's Law: A complex system that works is invariably found to have evolved from a simple system that worked. A complex system designed from scratch never works and cannot be patched up to make it work. You have to start over with a working simple system.

WalterBright•23m ago
C++ should copy D's elegance:

    import std.stdio;

    string[9] vec = [ 
      "the", "quick", "brown", "fox", 
      "jumped", "over", "the", "lazy", "dog" 
    ];

    void main()
    {
      foreach (i, s; vec)
        writeln(i, ": ", s);
    }
WalterBright•11m ago
Although D is a strongly typed language, it is very good at type inference. The `s` is inferred as `string`, and `i` as `size_t`.
HeavyStorm•22m ago
Given both Lua and python use a enumerator, the C++ example isn't really the correct equivalent.

  for (auto [i, v] : std::views::enumerate(vec)) {
      std::cout << i << ": " << v << '\n';
  }
This is how you'd do it.
UncleOxidant•14m ago
Reading this, I really can't make much sense of it:

     for (int i=0; auto&& it: vec)
         cout << (++i) << ": " << it << endl;
It's certainly not obvious what's going on there at a glance.

This is at least a bit more pythonic:

     for (auto [i, it] : std::views::enumerate(vec)) {
        std::cout << i << ": " << it << "\n";
     }
grg0•11m ago
It's probably easier to understand if you read about the "if statement with initializer" linked from the post: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p03...
dataflow•42s ago
[delayed]
kazinator•11m ago

  1> (mapdo (op put-line `@1: @2`) '#"how now brown cow" 0)
  how: 0
  now: 1
  brown: 2
  cow: 3
  nil
mapdo: map for side effects of calling the function, not calculating a result, like map.

op: produce a lambda function out of an expression in which @1, @2, ... explicitly indicate the insertion of positional arguments, which are then implicitly bestowed onto the generated lambda.

`...`: quasistring syntax: supports @ notations for interpolating. @1, @2 of op do not require a double @@ inside a quasistring.

put-line: ordinary function to put a string to a stream (standard output by default) followed by newline.

#"...": string list literal: contents are broken on whitespace and denote a list of strings #"foo bar" -> ("foo" "bar"). Requires ' quote in front to be quoted literally, and not evaluated as a compound expression applying the argument "bar" to the operator "foo". Yes, there is a #`...` quasi string list for templating over this.

0: ordinary integer zero. But endowed with the power of being iterable. Where an iterable thing is required, 0 denotes the whole numbers 0, 1, 2, ...

These are some of the ingredients in my one-member research programme into nicer Lisp coding.

drnick1•10m ago
Give me the explicit C syntax any day over this monstrosity. I refuse to write anything other than C++98, the last version of C++ that built on C without trying to turn it into a completely different language.
hackthemack•4m ago
I guess I am officially old and no longer know what the cool "it" is any more. The C++17 example seems much more clear to me. It is more typing, but so what? It is not that much more typing, and it looks like code that people have written for 40 years.