← Back to context

Comment by josephg

12 hours ago

Some of us still know how to write software like that. And enjoy doing it.

I made a little conference schedule app a few weeks ago for a conference I was at. I used my own rust UI toolkit, which calls in to cocoa to make use of native UI components. The resulting binary is about 500kb and it uses a couple megs of ram while running. It looks and feels like a totally native iOS app. As far as the OS is concerned, it is.

Even 500kb feels too big for what it is. I’m rewriting the core at the moment, and I think it’ll be more efficient as a result. But I’m still pretty happy with it.

AI writes code like that, but people get pretty upset hearing it.

The program that I use to manage my small business, basically a GUI wrapper on an sql DB is a total delight to use, because everything happens instantly. Even opening it is instantaneous.

Modern software is such a bloated mess that you kind of get used to a 20 second start-up and a .25-1 second delay on every action. Then you use something that isn't bloated junk and it feels like actual magic.

  • >> AI writes code like that, but people get pretty upset hearing it.

    To this day I never saw an AI write anything less than a 3Mb binary. Do you have specific examples in mind, and if so, can you share them?

    • AI currently writes median-good code which is by definition better than the worst developers' code.

      In order to push beyond that (e.g. architecture, size, performance), the human has to bring the constraints. There's only so much AI can/should default assume from "write code for me" (which I expect a lot of bad / non-HN developers are doing).

      It is exciting that there's an opportunity for global improvement though! After the general model improvement pace slows, expect there will be a lot of room for code gen AI optimization, and if "write code for me" can be made to generate more efficient code... suddenly all AI-generated code (read: most code) will improve.

      Shit code is out in the wild because the company decided to optimize for programmer labor cost instead of code efficiency. If instead apples:apples because AI code gen is being used both ways, everyone wins.

      Feels like what I imagine were the early days of optimizing compilers, when I'm sure there were a large number of really bad assembly programmers out there.

  • What happens if you keep asking AI to rewrite it to use less and less resources?

  • > AI writes code like that, but people get pretty upset hearing it.

    Yeah, people get upset when you spew out total bullshit.

    I work as a performance specialist and "AI writes code like that" is utter nonsense. AI writes the same terrible performing code that was the mediocre developer standard on Stackexchange and other codebases it ate.

    You still need a lot of vigilance and time to make well performing software and most software engineers just don't give a damn if we don't outright block their PRs/feature launches before passing performance tests.

    • LLM coding assistants have a bias towards writing standalone implementations instead of pulling in libraries to do a job, which does tend to sidestep probably the most common cause of bloated software: pulling in too many layers of abstraction. Most software can be pretty damn fast (at least as far as users are going to notice) without needing too much of a focus on optimization, but just by not accidentally screwing it up.

      1 reply →

Is your UI kit open source? I do think calling into the native OS toolkits is the way to go, when they exist.

I'm curious if you use winit for windowing, or something lower level that's just mac specific.

  • I ported the leptos rust web framework to run on native platforms. Currently it works on ios, macos and linux (GTK). Eventually want to also add support for windows and TUI as well. It uses taffy for layout - which gives you the same flexbox and grid layout engines that web browsers use. Components are all fully native for the platform, via their corresponding binding crates (objc, gtk4, etc).

    UI library is here: https://github.com/josephg/leptos-native

    And here's the schedule viewer app I made with it. It runs silky smooth on device: https://github.com/josephg/dweb-sched

    The whole project is currently experimental & vibe coded. It's missing a lot of components, and it has bugs. I'm currently rewriting it by hand to do it properly.

    • SwiftUI’s diffing is such a mess that I wouldn’t be surprised if fine-grained reactivity of a toolkit binding UIKit like this worked better. Do you have decent support for long lists via UITableView yet? Edit: it seems so!

      1 reply →

Yeah, hence why for one kind of like the way RAM prices are going, maybe it forces the industry to re-learn best practices and "bio-programming" instead of "fast-food programming".