Back

Lightpanda migrate DOM implementation to Zig

199 points26 dayslightpanda.io
barishnamazov26 days ago

This reminds me of the Servo project's journey. Always impressed to see another implementation of the WHATWG specs.

It's interesting to see Zig being chosen here over Rust for a browser engine component. Rust has kind of become the default answer for "safe browser components" (e.g., Servo, Firefox's oxidation), primarily because the borrow checker maps so well to the ownership model of a DOM tree in theory. But in practice, DOM nodes often need shared mutable state (parent pointers, child pointers, event listeners), which forces you into Rc<RefCell<T>> hell in Rust.

Zig's manual memory management might actually be more ergonomic for a DOM implementation specifically because you can model the graph relationships more directly without fighting the compiler, provided you have a robust strategy for the arena allocation. Excited to learn from Lightpanda's implementation when it's out.

fbouvier26 days ago

Hi, I am Francis, founder of Lightpanda. We wrote a full article explaining why we choose Zig over Rust or C++, if you are interested: https://lightpanda.io/blog/posts/why-we-built-lightpanda-in-...

Our goal is to build a headless browser, rather than a general purpose browser like Servo or Chrome. It's already available if you would like to try it: https://lightpanda.io/docs/open-source/installation

nicoburns26 days ago

I see you're using html5ever for HTML parsing, and like it's trait/callback based API (me too). It looks like style/layout is not in scope at the moment, but if you're ever looking at adding style/layout capabilities to lightpanda, then you may find it useful to know that Stylo [0] (CSS / style system) and Taffy [1] (box-level layout) are both avaiable with a similar style of API (also Parley [2] which has a slightly different API style but can be combined with Taffy to implement inline/text layout).

[0]: https://github.com/servo/stylo

[1]: https://github.com/DioxusLabs/taffy

[2]: https://github.com/linebender/parley

---

Also, if you're interested in contributing C bindings for html5ever upstream then let me know / maybe open a github issue.

parhamn26 days ago

Off topic note: I read the website and a few pages of the docs and it's unclear to me for what I can use LightPanda safely. Like say I wanted to swap my it as my engine on playwright, what are the tradeoffs? What things are implemented, what isnt?

fbouvier26 days ago

Thanks for the feedback, we will try to make this clearer on the website. Lightpanda works with Playwright, and we have some docs[1] and examples[2] available.

Web APIs and CDP specifications are huge, so this is still a work in progess. Many websites and scripts already work, while others do not, it really depends on the case. For example, on the CDP side, we are currently working on adding an Accessibility tree implentation.

[1] https://lightpanda.io/docs/quickstart/build-your-first-extra...

[2] https://github.com/lightpanda-io/demo/tree/main/playwright

infogulch26 days ago

Maybe you should recommend a recipe for configuring playwright with both chromium and lightpanda backends so a given project can compare and evaluate whether lightpanda could work given their existing test cases.

epolanski26 days ago

I was actually interested into using lightpanda for E2Es to be honest, because halving the feedback cycle would be very valuable to me.

h33t-l4x0r26 days ago

I think it's really more of an alternative to JSDom than it is an alternative to Chromium. It's not going to fool any websites that care about bots into thinking it's a real browser in other words.

nwienert25 days ago

Would be helpful to compare Lightpanda to Webkit, Playwright has a driver for example and its far faster and less resource hungry than Chrome.

When I read your site copy it struck me as either naive to that, or a somewhat misleading comparison, my feedback would be just to address it directly alongside Chrome.

barishnamazov26 days ago

Thanks Francis, appreciate the nice & honest write-up with the thought process (while keeping it brief).

aatd8625 days ago

Would be great if it could be used as a wasm library... Just saying... Is it? I would actually need and use this.

Jweb_Guru26 days ago

Respectfully, for browser-based work, simplicity is absolutely not a good enough reason to use a memory-unsafe language. Your claim that Zig is in some way safer than Rust for something like this is flat out untrue.

dnautics25 days ago

What is your attack model here? Each request lives in its own arena allocator, so there is no way for any potentially malicious JavaScript to escape and read memory owned by any other request, even if there is a miscode. otherwise, VM safety is delegated to the V8 core.

Jweb_Guru23 days ago

Believe it or not, using arenas does not provide free memory safety. You need to statically bound allocations to make sure they don't escape the arena (which is exactly how arenas work in Rust, but not Zig). There are also quite a lot of ways of generating memory unsafe code that aren't just use after free or array-out-of-bounds in a language like Zig, especially in the context of stuff like DOM nodes where one frequently needs to swap out pointers between elements of one type and a different type.

hello_moto26 days ago

In that blog post, the author said safer than C not Rust.

quotemstr26 days ago

Choosing something like Zig over C++ on simplicity grounds is going to be a false economy. C++ features exist for a reason. The complexity is in the domain. You can't make a project simpler by using a simplistic language: the complexity asserts itself somehow, somewhere, and if a language can't express the concept you want, you'll end up with circumlocution "patterns" instead.

Build system complexity disappears when you set it up too. Meson and such can be as terse as your Curl example.

I mean, it's your project, so whatever. Do what you want. But choosing Zig for the stated reasons is like choosing a car for the shape of the cupholders.

Philpax26 days ago

Your Swiss Army Knife with a myriad of 97 oddly-shaped tools may be able to do any job anyone could ask of it, but my Swiss Army Knife of 10 well-designed tools that are optimal for my set of tasks will get my job done with much less frustration.

meheleventyone26 days ago

> C++ features exist for a reason.

But sometimes not good ones. Lot's of domains make tradeoffs about what features of C++ to actually make use of. It's an old language with a lot of cruft being used across a wide set of problems that don't necessarily share engineering trade offs.

hnlmorg26 days ago

That’s not fully true though. There’s different types of complexity:

- project requirements

- requirements forced upon you due to how the business is structured

- libraries available for a particular language ecosystem

- paradigms / abstractions that a language is optimised for

- team experiences

Your argument is more akin to saying “all general purpose languages are equal” which I’m sure you’d agree is false. And likewise, complexity can and will manifest itself differently depending on language, problems being solved, and developer preferences for different styles of software development.

So yes, C++ complexity exists for a reason (though I’d personally argue that “reason” was due to “design by committee”). But that doesn’t mean that reason is directly applicable to the problems the LightPanda team are concerned about solving.

vegabook26 days ago

C++ features for complexity management are not ergonomic though, with multiple conflicting ideas from different eras competing with each other. Sometimes demolition and rebuild from foundations is paradoxically simpler.

zipy12426 days ago

A lot of them only still exist for backwards compatabilities sake though. And a decent amount because adding something as a language extension rather than building the language around it has consequences.

jandrewrogers25 days ago

C++ features exist for a reason but it may not be a reason that is applicable to their use case. For example, C++ has a lot of features/complexity that are there primarily to support low-level I/O intensive code even though almost no one writes I/O intensive code.

I don't see why C++ would be materially better than Zig for this particular use case.

pron26 days ago

I don't think that a language that was meant to compete with C++ and in 10+ years hasn't captured 10% of C++'s (already diminished) market share could be said to have become "kind of the default" for anything (and certainly not when that requires generalising from n≅1).

pjmlp26 days ago

It has for Amazon, Adobe, Microsoft, Google and the Linux kernel.

It remains to be seen which big name will make Zig unavoidable.

pron26 days ago

> It has for Amazon, Adobe, Microsoft, Google and the Linux kernel.

I don't think so. I don't know about Adobe, but it's not a meaningful statement for the rest. Those companies default to writing safe code in languages other than Rust, and the Linux kernel defaults to unsafe code in C. BTW, languages favoured by those projects/companies do not reliably represent industry-wide preferences, let alone defaults. You could certainly say that of the two languages accepted so far in the Linux kernel, the only safe one is Rust, but there's hardly any "default" there.

> It remains to be seen which big name will make Zig unavoidable.

I have no idea whether or not Zig will ever be successful, but at this point it's pretty clear that Rust's success has been less than modest at best.

+2
pjmlp26 days ago
kennykartman25 days ago

I wonder what you consider a successful language.

Rust appeared in 2012. Zig in 2016. I consider them both two successful programming languages, but given they are only 4 years apart, it's easy to compare Zig today with 4-years-back Rust and see they are very far apart, in term of maturity, progress, community size and adoption.

Rust is a very successful language so far, but expecting that in 10y it can overthrow C++ is silly. Codebases add up more than they are replaced.

surajrmal26 days ago

While certain teams within Google are using rust by default, I'm not sure rust is anywhere close in scale for new lines of code committed per week to c++.

+1
paavohtl26 days ago
anal_reactor26 days ago

The problem is that the number of browser engines is n=2.

drnick126 days ago

Interestingly, Ladybird, which aims at being the n = 3, is also written in C++.

drannex23 days ago

Ladybird is in the process of switching over to Swift, and has been for a little over a year now.

Not linking to the pedophilic nazi-site, and as Nitter is dead-ish, here is the full-text announcement archived on tildes: https://tildes.net/~comp/1j7m/ladybird_chooses_swift_as_its_...

7bit26 days ago

> without fighting the compiler

It's unfortunate that "writing safe code" is constantly being phrased in this way.

The borrow checker is a deterministic safety net. Claiming Zig is easier ignores that its lack of safety checks is what makes it feel easier; if Zig had Rust’s guarantees, the complexity would be the same. Comparing them like this is apples vs. oranges.

pron26 days ago

That's a very narrow way of looking at things. ATS has a much stronger "deterministic safety net" than Rust, yet the reason to use Rust over ATS is that "fighting the compiler" is easier in Rust than in ATS. On the other hand, if any cost is worth whatever level of safety Rust offers for any project, than Rust wouldn't exist because there are far more popular languages with equal (or better) safety. So Rust's design itself is an admission that 1. more compile-time safety is always better, even if it complicates the language (or everyone who uses Rust should use ATS), and 2. any cost is worth paying for safety (or Rust wouldn't exist in the first place).

Safety has some value that isn't infinite, and a cost that isn't zero. There are also different kinds of safety with different value and different costs. For example, spatial memory safety appears to have more value than temporal safety (https://cwe.mitre.org/top25/archive/2025/2025_cwe_top25.html) and Zig offers spatial safety. The question is always what you're paying and what you're getting in return. There doesn't appear to be a universal right answer. For some projects it may be worth it to pay for more safety, and for other it may be better to pay for something else.

7bit26 days ago

You’re changing the argument. The point wasn’t whether more safety is “worth it”, but that comparing ease while ignoring which invariants are enforced is misleading. Zig can feel simpler because it encodes fewer guarantees. I’m not saying one approach is better, only that this comparison shifts the goalposts.

+1
pron25 days ago
tcfhgj25 days ago

Imo "safety" in safe Rust is higher than it is in more popular languages.

Data races, type state pattern, lack of nulls, ...

pron25 days ago

This is comparing what Rust has and other languages don't without also doing the opposite. For example, Java doesn't enforce data-race freedom, but its data races are safe, which means you can write algorithms with benign races safely (which are very useful in concurrent programming [1]), while in Rust that requires unsafe. Rust's protection against memory leaks that can cause a panic is also weaker, as is Rust's ability to recover from panics in general. Java is now in the process of eliminating the unsafe escape hatch altogether except for FFI. Rust is nowhere near that. I.e. sometimes safe Rust has guarantees that mean that programs need to rely on unsafe code more so than in other languages, which allows saying that safe Rust is "safer" while it also means that fewer programs are actually written purely in safe Rust. The real challenge is increasing safety without also increasing the number of programs that need to circumvent it or increasing the complexity of the language further.

[1]: A benging race is when multiple tasks/threads can concurrently write to the same address, but you know they will all write the same value.

Ygg226 days ago

> 1. more compile-time safety is always better, even if it complicates the language (or everyone who uses Rust should use ATS), and 2. any cost is worth paying for safety (or Rust wouldn't exist in the first place).

You keep repeating this. It's not true. If what you said was true, Rust would have adopted HKT, and God knows whatever type astronomy Haskell & Scala cooked up.

There is a balancing act, and Rust decided to plant a flag in memory safety without GC. The fact that Zig, didn't expand on this, but went backwards is more of an indictment of programmers unwilling to adapt and perfect what came before, but to reinvent it in their own worse way.

> There are also different kinds of safety with different value and different costs. For example, spatial memory safety appears to have more value than temporal safety (https://cwe.mitre.org/top25/archive/2025/2025_cwe_top25.html)

How did you derive this from the top 25 of CWEs? Let's say you completely remove the spatial memory issues. You still get temporal memory issues at #6.

+1
pron26 days ago
senko26 days ago

The fact that Zig doesn't have Rust's guarantees doesn't mean Zig does not have safety checks. The safety checks that Zig does have are different, and are different in a way that's uniquely useful for this particular project.

Zig's check absolutely don't go to the extent that Rust's do, which is kind of the point here. If you do need to go beyond safe code in Rust, Zig is safer than unsafe code in Rust.

Saying Zig lacks safety checks is unfortunate, although I wouldn't presume you meant it literally and just wanted to highlight the difference.

pjmlp26 days ago

Thing is, those safety checks are also available in C and C++, provided that one uses the right tools like PVS and PurifyPlus (just to quote two examples), and now ongoing AI based tooling efforts for verification, thus the question is why a language like Zig in the 21st century, other than "I don't like either C++ or Rust".

7bit26 days ago

I never said Zig has no safety features. What I said is true, though. If it would have Rusts guarantees (as in: The same) it would be more complex.

senko25 days ago

I mean if we're going to nitpick:

>>> its lack of safety checks

>> Saying Zig lacks safety checks is unfortunate,

> I never said Zig has no safety features.

You did. Or, alternatively, if you don't equate "checks" with "features", then I never said you said that so what are you complaining about?

> If it would have Rusts guarantees (as in: The same) it would be more complex.

Which is true (if tautological), and is basically what the GP said:

> Zig's manual memory management might actually be more ergonomic for a DOM implementation specifically because you can model the graph relationships more directly without fighting the compiler, provided you have a robust strategy for the arena allocation

Both you and the GP agree that Rust is more complex.

You objected to this with:

> It's unfortunate that "writing safe code" is constantly being phrased in this way.

Upon which I commented that Zig does have safety features, even if they're not covering you as well as Rust's ones. Which is, again, inline with "provided you have a robust strategy for the arena allocation."

Now, if you think I'm going overboard with this, I agree with you -- and this is the exact feeling I have when I look at Rust :)

pjmlp26 days ago

And use-after-free, when that arena's memory goes away.

pron26 days ago

But arenas have substantial benefits. They may be one of the few remaining reasons to use a low-level (or "systems programming") language in the first place. Most things are tradeoffs, and the question isn't what you're giving up, but whether you're getting the most for what you're paying.

pjmlp26 days ago

Arenas are also available in languages with automatic memory management, e.g. D, C# and Swift, to use only modern languages as example.

Thus I don't consider that a reason good enough for using Zig, while throwing away the safety from modern languages.

+2
pron26 days ago
+1
defen26 days ago
dnautics25 days ago

Yeah that's certainly possible but leaking a pointer like this seems like it would be really easy to spot?

dwattttt25 days ago

It's harder than you'd expect. Depending on what kind of bucketing an arena does (by size or by type), a stale reference may end up pointing to another piece of memory of the correct type, which is still wrong, but more subtly than a crash.

+1
dnautics25 days ago
galangalalgol26 days ago

Too late now, but is the requirement for shared mutable state inherent in the problem space? Or is it just because we still thought OOP was cool when we started on the DOM design?

pornel25 days ago

Yes. It is required for W3C's DOM APIs, which give access to parent nodes and allow all kinds of mutations whenever you want.

Event handlers + closures also create potentially complex situations you can't control, and you'll need a cycle-breaking GC to avoid leaking like IE6 did.

You can make a more restricted tree if you design your own APIs with immutability/ownership/locking, but that won't work for existing JS codebases.

IshKebab26 days ago

I don't think it's really that bad in Rust. If you're happy with an arena in Zig you can do exactly the same thing in Rust. There are a ton of options listed here: https://donsz.nl/blog/arenas/

Some of them even prevent use after free (the "ABA mitigation" column).

mijoharas26 days ago

I'm not super experienced with zig, but I always think that in the same way that rust forces you to think about ownership (by having the borrow checker - note: I think of this as a good thing personally) zig makes you think upfront about your allocation (by making everything that can allocate take an allocator argument.).

It makes everything very explicit, and you can always _see_ where your allocations are happening in a way that you can't (as easily, or as obviously - imo) in rust.

It seems like something I quite like. I'm looking forward to rust getting an effects system/allocator api to help a little more with that side of things.

silon4226 days ago

The problem is deallocation... unless you tie the allocated object to an arena allocator with a lifetime somehow (Rust can model that).

mijoharas26 days ago

Yep, rust forces you to think about lifetimes. Zig only suggests it (because you're forced to think about allocation, which makes you naturally think about the lifetime usually) but does not help you with it/ensure correctness.

It's still nice sometimes to ensure that you have to think about allocation everywhere, and can change the allocation strategy for something that works for your usecase. (hence why I'm looking forward to the allocator api in rust to get the best of both worlds).

IshKebab26 days ago

That's true and I liked the idea of it until I started writing some Zig where I needed to work with strings. Very painful. I'm sure you typically get a bit faster string manipulation code than what you'd get with Rust but I don't think it's worth the cost (Rust is pretty fast already).

bnolsen22 days ago

Having worked with c++ strings and also string views I find zigs simple fat pointer to be fairly direct and straightforward, and a bit refreshing. Ownership is being coupled in with the type..

+1
jamiejquinn25 days ago
kryps26 days ago

No, you can't do the same thing in Rust, because Rust crates and the standard library generally use the global allocator and not any arena you want to use in your code.

IshKebab25 days ago

I mean you can store the nodes in an arena so you don't have to deal with the borrow checker getting upset with your non-tree ownership structure. That's the context. We weren't talking about arena use for speed/efficiency purposes. In that case you are right; it's much more awkward to use custom allocators in Rust.

pjmlp26 days ago

Which is hardly any different from me using PurifyPlus back in 2000.

IshKebab25 days ago

It's very different.

kristopolous26 days ago

I've been using it for months now ever since I saw their presentation at GitHub

This is a common flow for me

    lightpanda url | markitdown (microsoft) | sd (day50 streamdown) 
I even have it as a shell alias, wv(). It's way better than the crusty old lynx and links on sites that need JS.

It's solid. Definitely worth a check

Philpax26 days ago

Oh, huh, being able to convert arbitrary websites that may use JS for rendering to Markdown could be very handy indeed. Thanks for the tip!

daddykotex26 days ago

Thanks for the tip, that's very cool. I did not know about `markitdown` and `streamdown`.

lewdwig26 days ago

A language which is not 1.0, and has repeatedly changed its IO implementation in a non-backwards-compatible way is certainly a courageous choice for production code.

dnautics25 days ago

So, I'm noodling around with writing a borrow checker for zig, and you don't get to appreciate this working with zig on a day to day level, but the internals of how the zig compiler works are AMAZING. Also, the io refactor will (I think) let me implement aliasing checking (alias xor mutable).

ivanjermakov26 days ago

In my experience, migrating small-scale projects takes from minutes to single digit hours.

Standard library is changing. The core language semantics - not so much. You can update from std.ArrayListUnmanaged to std.array_list.Aligned with to greps.

bluecalm26 days ago

Right? People must really like the design choices in Zig to do that instead of choosing another language. It's very interesting just because of that.

Philpax26 days ago

It's certainly not a choice I would have made, but there's sufficient precedent for it now (TigerBeetle, Ghostty, etc) that I can understand it.

hu326 days ago

also Bun

blue_pants26 days ago

also Roc

Iridescent_26 days ago

This one is far from prod-ready however

steeve26 days ago

the upside is absolutely worth it

nicoburns26 days ago

This table is informative as to exactly what lightpanda is: https://lightpanda.io/blog/posts/what-is-a-true-headless-bro...

TL;DR: It does the following:

- Fetch HTML over the network

- Parse HTML into a DOM tree

- Fetch and execute JavaScript that manipulates the DOM

But not the following:

- Fetch and parse CSS to apply styling rules

- Calculate layout

- Fetch images and fonts for display

- Paint pixels to render the visual result

- Composite layers for smooth scrolling and animations

So it's effectively a net+DOM+script-only browser with no style/layout/paint.

---

Definitely fun for me to watch as someone who is making a lightweight browser engine with a different set of trade-offs (net+DOM+style/layout/paint-only with no script)

karel-3d26 days ago

When I was working before on something that used headless browser agents, the ability to do a screenshot (or even a recording) was really great for debugging... so I am not sure about the "no paint". But hey everything in life is a trade-off.

hobofan26 days ago

Really depends on what you want to do with the agents. Just yesterday I was looking for something like this for our web access MCP server[0]. The only thing that it needs to do is visit a website and get the content (with JS support, as it's expected that most pages today use JS), and then convert that to e.g. Markdown.

I'm not too happy with the fact that Chrome is one of our memory-hungriest parts of all the MCP servers we have in use. The only thing that exceeds that in our whole stack is the Clickhouse shard, which comes with Langfuse. Especially if you are looking to build a "deep research" feature that may access a few hundreds of webpages in a short timeframe, having a lightweight alternative like Lightpanda can make quite the difference.

[0]: https://github.com/EratoLab/web-access-mcp

karel-3d25 days ago

Well, it was "normal" crawlers that needed to work perfectly and deterministically (as best as possible), not probabilistically (AI); speed was no issue. And I wanted to debug when something went wrong. So yeah for me it was crucial to be able to record/screenshot.

So yeah, everything is a trade-off, and we needed a different trade-off; we actually decided to not use headless chromium, because they are slight differences, so we ended up using full chrome (not even chromium, again - slight differences) with xvfb. It was very, very memory hungry; but again was not an issue

(I used "agent" as in "browser agent", not "AI agent", I should be more precise I guess.)

pzo26 days ago

yeah I feel the same, I think even having a screenshot of part of rendered page or full page can be useful even for machines considering how heavy those HTML can be to parse and expensive for LLM context. Sometimes (sub)screenshot is just a better kind of compression

fbouvier26 days ago

Yes HTML is too heavy and too expensive for LLM. We are working on a text-based format more suitable for AI.

+1
httpteapot26 days ago
warpech26 days ago

> So it's effectively a net+DOM+script-only browser with no style/layout/paint.

> ---

> Definitely fun for me to watch as someone who is making a lightweight browser engine with a different set of trade-offs (net+DOM+style/layout/paint-only with no script)

Both projects (Lightpanda, DioxusLabs/blitz) sound very interesting to me. What do you think about rendering patterns that require both script+layout for rendering, e.g. virtual scrolling of large tables?

What would be a good pattern to make virtual scrolling work with Lightpanda or Blitz?

nicoburns26 days ago

So Blitz does technically have scripting, it's just Rust scripting rather than JavaScript scripting. So the plan for virtual scrolling would likely be to implement it in Rust.

If your aim is to render a UI (ala Electron/Flutter) then we have a React-style framework (Dioxus) that runs on top of Blitz, and allows you access to the low-level Rust API of the DOM for advanced use cases (although it's still a WIP and this API is a bit rough atm). I'm also hoping to eventually have a built-in `RecyclerView`-like widget for this (that can bypass the style/layout systems for much more efficient virtual scrolling).

warpech25 days ago

Thanks! But I meant JS based virtual scrolling in web pages. E.g. dynamic data tables that only render the part of the table that fits in the viewport.

krichprollsch25 days ago

For scrolling, when using Intersection Observer, we currently assume all elements are visible. So, if you register an observer, we will dispatch an entry indicating an intersection with a ratio of 1.0.

deepriverfish26 days ago

it's so tiring that every time there's a post about something being implemented in Zig or C or C++, the Rust brigade shows up trying to pick up a fight.

Klonoar26 days ago

It’s a site where programming nerds congregate to waste time arguing with each other. Where do you think you are?

This same pattern used to play out with Ruby, Lisp, and other languages in different eras of this site. It will probably never stop and calling it out seems to just fan the flames more than anything else.

hobofan26 days ago

Maybe just a reflex by people that had to hear a decade of "why not C++" whenever it was mentioned that Rust is being used?

esafak25 days ago

I don't know, man. At this point I'm liable to ask "Why are you using C++?" if you start a new project. Let them defend their language!

pjmlp26 days ago

As part of the "all software should be liable brigade", it is a matter of misplaced goals after the cybersecurity agencies started looking into the matter.

everlier26 days ago

Wow. Lightpanda is absolutely bonkers of a project. I'd pay dearly for such an option a few years back.

MrBuddyCasino26 days ago

Because We're Not Smart Enough for C++ or Rust

Very refreshing. Most engineers would rather saw their leg off.

steeve26 days ago

This looks incredible, congratulations!

fbouvier26 days ago

Thanks Steeve!

portly26 days ago

Love to see Zig winning!

tonyhart726 days ago

finally, rewrite in zig movement is coming

pulkas25 days ago

zigdom all-diy

Copenjin26 days ago

Any older project similar to this? Headless browser with js support I mean, I want to check various implementations of this idea.

neoden26 days ago

I hate to say it, but time is quickly running out for Zig(( AI might never pick it up properly and without that it will never go out of its niche

shepherdjerred26 days ago

Are you implying that programming languages are now going to be “frozen” because of AI?

I can understand the source of concern but I wouldn’t expect innovation to stop. The world isn’t going to pause because of a knowledge cutoff date.

neoden25 days ago

Innovation doesn't go for the sake of innovation itself. Innovation should serve a purpose. And the purpose of having programming languages is to overcome the limitations of human mind, of our attention span, of our ability to manipulate concepts expressed in abstractions and syntax. We don't know how long we'll need this.

I really like Zig, I wish it appeared several years earlier. But rewriting everything in Zig might just not have practical sense soon.

shepherdjerred25 days ago

I agree that programming languages will no longer need to be as accessible to humans.

However there is still a strong argument to be made for protections/safety that languages can provide.

e.g. would you expect a model (assuming it had the same expertise in each language) to make more mistakes in ASM, C, Zig, or Rust?

I imagine most would agree that ASM/C would be likely to have the most mistakes simply because fewer constraints are enforced as you go closer to the metal.

So, while we might not care about how easy it is for a human to read/write, there will still be a purpose for innovation in programming languages. But those innovations, IMO, will be more focused on how to make languages easier for AI.

+1
neoden25 days ago
hu325 days ago

In my experience LLMs are really good at following code examples and constraints (tests).

So even if they don't get to train much on some technology, all you need is some guidance docs in AGENTS.md

There's a plus in being fresh too: LLMs aren't going to be heavily trained on outdated tutorials and docs. Like React for example.

rtfeldman23 days ago

Claude Opus 4.5 is completely fluent in Zig.

I use it constantly, and it never occurred to me that someone might think there was a problem to be solved there.