Why We Built Lightpanda in Zig

23 points by krig


krig

I posted this mainly to make this comment:

Each page load gets its own arena. When the page is done, we throw away the entire memory chunk. No tracking individual allocations, no reference counting overhead, no garbage collection pauses. (Though we’re learning that single pages can grow large in memory, so we’re also exploring mid-lifecycle cleanup strategies).

The parenthesis here feels like a smell. I suspect that there are other lifetimes at play here where a separate arena or temp allocator would resolve the memory usage of the page. "mid-lifecycle cleanup" seems to indicate that there are temporary allocations with a shorter lifespan. Adding some kind of garbage collection to the page allocator seems like the wrong approach to me.

justinhj

Glad to see how many Zig stories are showing up here and on Hacker News.

drs

Less about zig and specific to Lightpanda but:

  1. Why not allow users to change the user agent string?
  2. Since they are already building on top of curl why not also allow curl-impersonate?

Anyway thankfully it's open source so at least for #1 the change is quite simple, but it would make the browser so much more useful for crawling...