frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Postgres LISTEN/NOTIFY does not scale

https://www.recall.ai/blog/postgres-listen-notify-does-not-scale
266•davidgu•3d ago•91 comments

Show HN: Open source alternative to Perplexity Comet

https://www.browseros.com/
141•felarof•7h ago•40 comments

Bret Victor on why current trend of AIs is at odds with his work

https://dynamicland.org/2024/FAQ/#What_is_Realtalks_relationship_to_AI
209•prathyvsh•9h ago•64 comments

Graphical Linear Algebra

https://graphicallinearalgebra.net/
166•hyperbrainer•9h ago•10 comments

Turkey bans Grok over Erdoğan insults

https://www.politico.eu/article/turkey-ban-elon-musk-grok-recep-tayyip-erdogan-insult/
47•geox•1h ago•29 comments

FOKS: Federated Open Key Service

https://foks.pub/
168•ubj•12h ago•38 comments

Flix – A powerful effect-oriented programming language

https://flix.dev/
210•freilanzer•11h ago•88 comments

Measuring the impact of AI on experienced open-source developer productivity

https://metr.org/blog/2025-07-10-early-2025-ai-experienced-os-dev-study/
493•dheerajvs•8h ago•314 comments

Yamlfmt: An extensible command line tool or library to format YAML files

https://github.com/google/yamlfmt
21•zdw•3d ago•7 comments

Launch HN: Leaping (YC W25) – Self-Improving Voice AI

48•akyshnik•7h ago•25 comments

Red Hat Technical Writing Style Guide

https://stylepedia.net/style/
153•jumpocelot•10h ago•63 comments

eBPF: Connecting with Container Runtimes

https://h0x0er.github.io/blog/2025/06/29/ebpf-connecting-with-container-runtimes/
30•forxtrot•6h ago•0 comments

Show HN: Cactus – Ollama for Smartphones

102•HenryNdubuaku•5h ago•43 comments

Grok: Searching X for "From:Elonmusk (Israel or Palestine or Hamas or Gaza)"

https://simonwillison.net/2025/Jul/11/grok-musk/
31•simonw•51m ago•17 comments

How to prove false statements: Practical attacks on Fiat-Shamir

https://www.quantamagazine.org/computer-scientists-figure-out-how-to-prove-lies-20250709/
196•nsoonhui•15h ago•152 comments

Regarding Prollyferation: Followup to "People Keep Inventing Prolly Trees"

https://www.dolthub.com/blog/2025-07-03-regarding-prollyferation/
37•ingve•3d ago•0 comments

Batch Mode in the Gemini API: Process More for Less

https://developers.googleblog.com/en/scale-your-ai-workloads-batch-mode-gemini-api/
11•xnx•3d ago•0 comments

Over 2,000 senior staff set to leave NASA under agency push

https://www.politico.com/news/2025/07/09/nasa-staff-departures-00444674?cdmc=2zglpgOF21PefXUKP0PbPaLZDC0&refcode2=2zglpgOF21PefXUKP0PbPaLZDC0&refcodecdmc=2zglpgOF21PefXUKP0PbPaLZDC0
8•belter•33m ago•1 comments

Psilocybin treatment extends cellular lifespan, improves survival of aged mice

https://www.nature.com/articles/s41514-025-00244-x
11•pseudolus•24m ago•1 comments

Grok 4

https://simonwillison.net/2025/Jul/10/grok-4/
146•coloneltcb•5h ago•132 comments

Analyzing database trends through 1.8M Hacker News headlines

https://camelai.com/blog/hn-database-hype/
112•vercantez•2d ago•61 comments

Diffsitter – A Tree-sitter based AST difftool to get meaningful semantic diffs

https://github.com/afnanenayet/diffsitter
85•mihau•12h ago•26 comments

Not So Fast: AI Coding Tools Can Reduce Productivity

https://secondthoughts.ai/p/ai-coding-slowdown
34•gk1•1h ago•11 comments

Is Gemini 2.5 good at bounding boxes?

https://simedw.com/2025/07/10/gemini-bounding-boxes/
256•simedw•12h ago•56 comments

Matt Trout has died

https://www.shadowcat.co.uk/2025/07/09/ripples-they-cause-in-the-world/
128•todsacerdoti•17h ago•41 comments

Final report on Alaska Airlines Flight 1282 in-flight exit door plug separation

https://www.ntsb.gov:443/investigations/Pages/DCA24MA063.aspx
119•starkparker•4h ago•131 comments

The ChompSaw: A Benchtop Power Tool That's Safe for Kids to Use

https://www.core77.com/posts/137602/The-ChompSaw-A-Benchtop-Power-Tool-Thats-Safe-for-Kids-to-Use
73•surprisetalk•3d ago•60 comments

Show HN: Typeform was too expensive so I built my own forms

https://www.ikiform.com/
166•preetsuthar17•16h ago•85 comments

Radiocarbon dating reveals Rapa Nui not as isolated as previously thought

https://phys.org/news/2025-06-radiocarbon-dating-reveals-rapa-nui.html
14•pseudolus•3d ago•2 comments

Retail cyber attacks: NCA arrest four for attacks on M&S, Co-op and Harrods

https://www.nationalcrimeagency.gov.uk/news/retail-cyber-attacks-nca-arrest-four-for-attacks-on-m-s-co-op-and-harrods
66•sandwichsphinx•7h ago•51 comments
Open in hackernews

Cheating the Reaper in Go

https://mcyoung.xyz/2025/04/21/go-arenas/
188•ingve•2mo ago

Comments

silisili•2mo ago
I've been doing some performance tuning in Go lately to really squeak performance, and ended up with a very similar arena design except using byte slices for buf and chunks instead of unsafe pointers. I think I tried that too and it wasn't any faster and a whole lot uglier, but I'll have to double check before saying that with 100% confidence.

A couple other easy wins -

if you start with a small slice and find some payloads append large amounts, write your own append that preemptively is more aggressive in cap bumping before calling the builtin append.

unsafe.String is rather new and great for passing strings out of byte slices without allocating. Just read the warnings carefully and understand what you're doing.

PaulKeeble•2mo ago
The append(slice,slice2...) code is all well and good but its going to hit into the expansion quite often. When you know the second append is going to be large its often faster to allocate a new slice with the right size and no elements and then append both slices to it, then there is no expansion costs the values just get copied in and it also produces less garbage to be collected.

I have done a few other things in the past where I had sliceLike's which took two slices and point to one and then the other and a function mapped to the indices as if they were appended, costs a bit on access but saves on the initial allocation if you don't intend to iterate through the entire thing or only do so once.

The base library in go does not do much for optimising this sort of thing, its not a dominate operation in most applications so I can see why we don't have more advanced data structures and algorithms. You have to be quite heavily into needing different performance characteristics to outperform the built ins with custom code or a library. All parts of Go's simplicity push that seems to assume people don't need anything else other than Array Lists and hash maps.

mischief6•2mo ago
> All parts of Go's simplicity push that seems to assume people don't need anything else other than Array Lists and hash maps.

you can see some of this in the work of the progenitors of Go.

quoth pike style, from rob pike:

Rule 4. Fancy algorithms are buggier than simple ones, and they're much harder to implement. Use simple algorithms as well as simple data structures.

      The following data structures are a complete list for almost all practical programs:
array linked list hash table binary tree

Of course, you must also be prepared to collect these into compound data structures. For instance, a symbol table might be implemented as a hash table containing linked lists of arrays of characters.

https://doc.cat-v.org/bell_labs/pikestyle

jerf•2mo ago
I think the way to look at it is that there's a lot of programs that don't need more than slices, maps, and combinations of said.

We know this is true, because dynamic scripting languages lean even more heavily into that, plus they do it with generally worse performance, and there are still many programs that those languages are perfectly suited for. Not every language has to have all the highest performance features pushed to the n'th degree.

If you sit down with a set of needs that needs that high performance stuff, that intensely needs custom data structures beyond those, and then you choose Go, the mistake isn't that Go doesn't have every last high-performance option, the mistake is, you shouldn't have chosen Go, anymore than you should sit down with those requirements and choose Perl. Though you may be able to get farther with Go, it was still the wrong choice on your part. I certainly look a bit askance at everyone who says "I'm going to write a high performance database to compete in the commercial database market!" and chooses Go... which is a surprisingly large group. That's not where this article comes from but it's where a lot of the other articles about super-optimizing Go comes from... but the real answer is, they probably shouldn't have chosen Go.

On the other hand, there's definitely always been a contingent of people out there who sit down to write a website that will get several dozen hits an hour and think they need to grab Rust and start banging out high performance async code without any framework assistance (can't afford the slowdown of abstraction, you know) with custom data structures and custom database code and "should I use mmap to access the file I'm storing all the data or should I use io_uring?" when in fact a pure-Python Django website backed to a conventional database that they forgot to even index properly would have humanly-indistinguishable performance. Engineers screw up their performance requirements analysis all over the place. It's probably one of the bigger and more consequential mistakes made by engineers that we rarely talk about here.

kweingar•2mo ago
I learned programming from a Java 7 book in high school. When I went through the Tour of Go, I found myself shocked that anybody would want to write software in a language like this. Where is inheritance? Where is the data structures package? I couldn't even find a standard linked list. What if I have a list where I need to make lots of insertions in the middle?

My 15-year-old self would be shocked at my day-to-day as an engineer now.

silisili•2mo ago
Coming from Java or any heavy OO language is probably a bit of a shock. I've never really missed inheritance with the way it does composition. I think one of the 'mantras' of Go is having the writer know the cost of what they're doing, at the expense of a lot of helpers. The issue is it's a bit inconsistent IMO. Like, they make you iterate to copy a map, but not to copy a slice. It feels like it should lean more heavily one way or the other.

I -would- definitely like more in the standard data structures and algos realm. I used to be more active on golang-nuts, and a lot of the replies to such ideas was "it's so easy to write yourself, look at this 5 liner, why make a package for it." Initially I kinda understood, but years in, after rewriting the same things over and over, it would be nice to one line a lot of this.

Mawr•2mo ago
> Where is inheritance?

It's been widely considered as a mistake for about two decades now...

> I couldn't even find a standard linked list.

Even? If you need a linked list, then you have a 0.01% use case and shouldn't expect such a niche data structure to be easily available. That said, https://pkg.go.dev/container/list

> What if I have a list where I need to make lots of insertions in the middle?

Then you should use an array. If you're not making full use of the pointer-y nature of a linked list, you shouldn't be using it.

> Where is the data structures package?

Go only got generics in 2022 so the standard library is lacking in ergonomic data structures.

kweingar•2mo ago
Exactly right. My books (and later, college courses) emphasized linked lists and inheritance as fundamental concepts of programming, but the reality as a working engineer is totally different.

When I first encountered Go, I was still a learner and the lack of these things in the language and standard libraries shocked me. But it turns out that they were writing a language more for practical software engineering than for outdated curricula. At the end of the day, structs, slices, and maps cover 99% of what you need!

dfawcus•2mo ago
I'd suggest a lot of the reason behind choosing Go, may well be the GC by default, which can simplify a lot. Then only needing to optimise a subset of memory use cases.

Maybe an alternative would be choose D, as it also has a GC, and allows more controlled memory layout than Go, with parallel allocations both in the GC and outwith the GC.

Assuming the only other offering is Rust, I'd interpret such choices as said folks not being convinced that the pain from using Rust is worth the gain for their particular use case.

alexjplant•2mo ago
> You have to be quite heavily into needing different performance characteristics to outperform the built ins with custom code or a library. All parts of Go's simplicity push that seems to assume people don't need anything else other than Array Lists and hash maps.

Every 2000s-era Enterprise Java project I worked on was written by people that used ArrayList<T> for everything. My classmates' programs were much the same way in college. I wonder if the Golang authors observed similarly and came to this conclusion.

ignoramous•2mo ago
> ... small slice and find some payloads append large amounts, write your own append that preemptively is more aggressive in cap bumping before calling the builtin append ...

gVisor netstack (userspace TCP/IP) uses a copy-on-write, reference-counted, tiered-pool for their arena-like alloc needs: https://gvisor.dev/blog/2022/10/24/buffer-pooling/ / https://archive.vn/YzB1C

The downside of their approach is, the client code is no longer dealing with just []byte (although, both the View and the Buffer type can vend out []bytes).

mholt•2mo ago
Off topic, but I love the minimap on the side -- for pages where I might be jumping around the content (long, technical articles, to refer back to something I read earlier but forgot) -- how can I get that on my site? Way cool.
legobmw99•2mo ago
No idea how plug-n-playable it is, but the source seems to be self contained: https://github.com/mcy/mcy.github.io/blob/master/public/js/m...
hu3•2mo ago
https://github.com/lrsjng/pagemap looks viable.

But it uses a canvas and redraws.

While the post's website renders a copy of the page in a <div> and scroll it. As you can check by inspecting the div.

andrewshadura•2mo ago
Funnily enough, this isn’t a real minimap: it’s actually a copy of the main content, zoomed out to look tiny and scroll-synced.
keybored•2mo ago
The map is the (copy of the) territory?
kristianp•2mo ago
Just a quick meta note. This article is really lengthy, I don't have time to read this level of detail for the background. For example the "Mark and Sweep" section takes up more than 4 pages on my laptop screen. That section starts more than 5 pages into the article. Is this the result of having AI help to write sections, and as a result making it too comprehensive? It's easy to generate content, but the editing decisions to keep the important parts haven't been made. I just want to know the part about the Arena allocator, I don't need a tutorial on garbage collection as well.
nemothekid•2mo ago
This is an interesting comment. The author, has been consistently making lengthy posts since 2021 - there's no reason to believe he is using AI as it doesn't look like his writing style has changed.

However, the reader has changed, and readers are notoriously lazy. Now instead of a "tl;dr", the reader might incredulous assume the writer is using AI. This is an interesting side effect.

FWIW: The Mark and Sweep section is specifically about Go's internal implementation of Mark and Sweep and is relevant context for the design decisions made in his arena. It is not generic AI slop about Mark and Sweep GCs.

keybored•2mo ago
I skimmed 60% and it doesn’t look like AI (slop) to me.

I expect that from SEO spam, not something niche like this.

foundry27•2mo ago
tl;dr for anyone who may be put off by the article length:

OP built an arena allocator in Go using unsafe to speed allocator operations up, especially for cases when you're allocating a bunch of stuff that you know lives and dies together. The main issue they ran into is that Go's GC needs to know the layout of your data (specifically, where pointers are) to work correctly, and if you just allocate raw bytes with unsafe.Pointer, the GC might mistakenly free things pointed to from your arena because it can't see those pointers properly. But to make it work even with pointers (as long as they point to other stuff in the same arena), you keep the whole arena alive if any part of it is still referenced. That means (1) keeping a slice (chunks) pointing to all the big memory blocks the arena got from the system, and (2) using reflect.StructOf to create new types for these blocks that include an extra pointer field at the end (pointing back to the Arena). So if the GC finds any pointer into a chunk, it’ll also find the back-pointer, therefore mark the arena as alive, and therefore keep the chunks slice alive. Then they get into a bunch of really interesting optimizations to remove various internal checks and and write barriers using funky techniques you might not've seen before

mkhattab•2mo ago
> Go prioritizes not breaking the ecosystem; this allows to assume that Hyrum’s Law will protect certain observable behaviors of the runtime, from which we may infer what can or cannot break easily.

If this assertion is correct, then effectively Go as a language is an evolutionary dead end. Not sure if I would Go fascinating in this case.

kyrra•2mo ago
They broke the foreach loop behavior in 1.22, mainly to make it match what people expected.

https://go.dev/blog/loopvar-preview

tgv•2mo ago
Small, but significant point: you can easily avoid the new behavior. IIRC, if you had a pre-1.22 project, and didn't change anything, it still compiles as before. So if you relied on that behavior (which would be very weird, but who knows), backwards compatibility is still there for you.
kyrra•2mo ago
It defaults to the new behavior. If you want the old behavior, you had to set a flag on the compiler. But this applies to all code, so any libraries you include would also get whatever behavior you set on the flag.
asp_hornet•2mo ago
They introduced generics into the language whilst maintaining compatibility and breaking changes between language versions is painful in large code bases.
sa46•2mo ago
It's quite a leap from "certain observable behaviors of the runtime" cannot change to Go is a dead-end.

Go regularly makes runtime changes and language changes, see https://go.dev/blog/. Some highlights:

- Iterators, i.e., range-over-function

- Generics

- For loops: fixed variable capture

- Optimized execution tracing

- Changing the ABI from stack-based to register-based.

styluss•2mo ago
They also changed maps' iteration order to be random, rather than insertion order.
fmstephe•2mo ago
This article is a fun read.

If you enjoyed this, or if you need more control over some memory allocations in Go, please have a look at this package I wrote. I would love to have some feedback or have someone else use it.

https://github.com/fmstephe/memorymanager

It bypasses the GC altogether by allocating its own memory separately from the runtime. It also disallows pointer types in allocations, but replaces them with a Reference[T] type, which offers the same functionality. Freeing memory is manual though - so you can't rely on anything being garbage collected.

These custom allocators in Go tend to be arena's intended to support groups of allocations which live and die together. But the offheap package was intended to build large long-lived datastructures with zero garbage collection cost. Things like large in-memory caches or databases.

kbolino•2mo ago
Do you think the problem that is addressed by offheap could also have been addressed with a generational garbage collector?
fmstephe•2mo ago
For the problems that arena allocators solve, relatively short lived allocations which die soon, yes. A generational collector would allow for faster allocation rates (a thread local bump allocator would become easy to use).

But very long lived data structures, like caches and in memory databases still need to be marked during full heap garbage collection cycles. These are less frequent with a generational collector though.

0xCafeBabee•2mo ago
Interesting stuff! For folks building off-heap or arena-style allocators in Go—how do you usually test or benchmark memory safety and GC interactions in practice?
dpifke•2mo ago
Related: discussion around adding "memory regions" to the standard library: https://go.dev/issue/70257

(Previous arena proposal: https://go.dev/issue/51317)