pai chat 2/30

2024-12-06

Oh alright. Let's talk about frameworks. Historically I've not been super fond of frameworks. Creating them, sure. Using them, not so much. But twist my arm ...

This is the second of some posts that respond to Sunil Pai's (threepointohrighthatguy) 31 "DecemberDumps" blog post series he's doing this December. Take these posts with a grain of salt, please. They're quick write-ups and a bit tongue-in-cheek like youtube vids of people watchin youtube vids. If you don't like it or my humor you can turn away now. Unless you're Sunil; then you gotta stay. Them's the rules bud.

Day 2 (Ok igore that it's the sixth). So he's saying there's three things UI frameworks are missing: Images / typography hills to die on, speech to text, and llm auto-complete.

Frontend


I'm not a frontend dev. I don't have very strong opinions on images and typography. What can I say. I use vanilla <img> tags, Verdana for sans-serif, and whatever serif and monospace give me if I want one of those.

I guess, in that line, it probably wouldn't hurt if somebody told me what's best and just roll with that. But I think Sunil was talking more about missing api's from the framework than picking one.

Although I recall Matt did a great job on Image stuff in Gatsby. And NextJS has strong guidance on images as well.

Typography, I guess not as much? I feel that's also more burdened by licenses and what not. Especially if you stray from the built-in browser happy path. There's plenty of interesting font things to dig into though. Optimizing fonts for most common characters and lazy loading additionals. Whole unicode planes. Emoji's are a whole world on their own, especially when it comes to serving them efficiently. And font files themselves also have multiple layers of compression and optimization.

So when I look at it like that Sunil is right; it's kind of surprising typography is not more top of mind to popular frameworks. Perhaps because it's a bit of a niche expertise? And maybe because it's not usually the bigger bottle neck for websites?

Computer, make me a sandwich


Off the shelf speech-to-text stuff. Aren't we already in the world where browsers expose this kind of thing so frameworks don't even need to think about it anymore? Or is that like next year thing.

I mean it makes sense to offer a sleek API to make that trivial. If browsers indeed don't offer this just yet then I think that's mostly a matter of time. Look at how they're racing to expose LLM's now. Speech to text is just another network and that hype happened a long time ago. These models are well mature nowadays.

Computer, write me a sandwich


As for LLM auto-complete... that's a double edged sword.

I agree with his idea that LLM's are reshaping our landscape. I too am using Cursor and enjoying my tab button a lot. But these LLM networks are being released at a high pace. And their usage is not exactly free. I mean, you can get free usage if you don't mind the if-its-free-youre-the-product kind of way. But training these LLM's is no cheap joke and unfortunately neither is running them.

Yes, you can run some of these models locally. But you kind of get what you pay for. Local models are limited by local consumer grade hardware. They're not able to run the cutting edge or even the reasonable par that is currently available. You can definitely run models and they can definitely answer questions in a somewhat meaningful way, though.

Also, browsers are jumping on this train too. I first read this about Opera, but Mozilla, and I recall seeing another announcement on shipping an llm api for JS by default although I can't find that reference right now. Nor one for Chrome but I can't imagine they're not cooking something up as well.

And let's not forget about webllm and webgpu efforts.

But that's what they are... they're efforts. They're work being done to get this shipped. In a world with a moving target faster than the speed of light.

I'm kind of looking forward to these kinds of api's being stable, don't get me wrong. But considering these models would need to run on the local hardware and they are still rather big for anything meaningful... I dunno, I think it's gonna take quite some time before that dust settles.

And for frontend frameworks to pick up the gauntlet and offer an opinion on this seems daunting. Do you really want to tie yourself down with one vendor or another? Tank resources into supporting that only to be outpaced by the new shiny in two months? Maybe. But I think this sort of thing is plugin land for the time being, where one plugin can easily be swapped out for another one without the whole framework having to support that sort of API until the end of time.

There's another question I'm wondering about, but that's more on the direct remark of using an LLM to auto-complete inputs/textareas in general: would that even work? In a useful sort of way? Even when backed by the A100 level llm's, how likely are you going to ship a module that can offer this auto-complete on arbitrary inputs in such a way that they are meaningful? Maybe with a custom prompt but even then that feels to jittery to me?

Then again, Claude is happily auto-completing what I'm about to write so maybe it's not that far fetched after all. I think it's after my job.