Get all your news in one place.
100's of premium titles.
One app.
Start reading
PC Gamer
PC Gamer
Nick Evanson

'I have crawled through depths of hell': One coder's suffering is a potential joy to every web user, as their project could make sluggish browsers a thing of the past

A cropped screenshot of a Pretext demo, as created by Cheng Lou and somnai-dreams.

The vast majority of web users click and swipe away at their preferred browser, with nary a thought behind the sheer amount of work that goes on behind the scenes in today's websites. Web coders do, though, and often have to juggle performance considerations against having everything correctly rendered. But there's one inspired bit of code library that could just solve all that in one fell swoop.

It's called Pretext, and it's the creation of California-based coder Cheng Lou, who's worked for the likes of React, Meta, and Midjourney. In short, it's a system that very rapidly calculates text size and positioning for browsers, and if you want a longer breakdown of what it does, I strongly recommend you watch YouTube channel Fireship's explanation of it all.

Better still, try a couple of demos of it in action for yourself, over at Lou's dedicated page for Pretext. To my eyes, the most impressive one is 'Editorial Engine', created by somnai-dreams, where you can drag various bubbles across the screen, and the text correctly rearranges itself around the circles, as fast as you can move them about.

At the moment, Pretext isn't aimed at being an all-singing and dancing browser rendering engine; it just handles a pretty strict selection of text setups. However, just from the small collection of demos, I suspect that Lou's work will have quite a few web coders seriously interested in helping develop the system further.

Lou's project is also a good example of where AI can be genuinely useful, rather than something to avoid and curse. To check that Pretext would correctly handle text rejigging in every browser on the market, with every possible language pack, Lou used AI to create some of the logic structures required and then iteratively test them across the hundreds of thousands of browser-language combinations.

That kind of workload would simply be impossible for a single person to do, though I do wonder as to just how many tokens Lou burned through to get the task done. In their own words, Lou "crawled through the depths of hell" to give the world Pretext, but the work has certainly been well received.

"Cheng you are forever a gift to the web," said one commenter. Lou's response? "Thanks I hate the web." Well, can't argue there.

Sign up to read this article
Read news from 100's of titles, curated specifically for you.
Already a member? Sign in here
Related Stories
Top stories on inkl right now
One subscription that gives you access to news from hundreds of sites
Already a member? Sign in here
Our Picks
Fourteen days free
Download the app
One app. One membership.
100+ trusted global sources.