4 ms·
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
by josephg 2mo 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.
- bschwindHN 2mo agoIs 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.
- josephg 2mo agoI 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 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 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.
- iknowstuff 2mo agoSwiftUI’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!
- josephg 2mo agoYeah! I added it for my ios scheduling app. I tried to learn SwiftUI a few years ago. XCode was horribly slow, and it would hang and crash all the time, even when working on small example projects. I'm excited by the thought that I can use any rust IDE to write UI code. Rust's compiler, toolchain and IDEs seem way more reliable. The view! builder macro at the moment is designed to look like JSX, since it was ported directly from leptos. But I'm considering dropping the jsx and using a fluent API. Something like this: let count = RwSignal::new(0u32); let view = vstack().padding(16.0).gap(12.0) .child(label().text(move || format!("Count: {}", count.get()))) .child( hstack().gap(8.0) .child(button() .on_click(move |_| count.update(|c| *c = 0)) .text("Clear")) .child(button() .on_click(move |_| count.update(|c| *c -= 1)) .text("-1")) .child(button() .on_click(move |_| count.update(|c| *c += 1)) .text("+1")) ); Code is a bit less readable like this, but autocomplete and cmd+click all works out of the box in your IDE.
- WarmWash 2mo agoAI 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.
- SirMaster 2mo agoWhat happens if you keep asking AI to rewrite it to use less and less resources?
- LPisGood 2mo agoIt’s actually pretty good at this if you have some very specific constraints and objective.
- josephg 2mo agoI find I get great results from explicitly asking an LLM to write tests which profile memory and cpu usage. Then ask it to optimise to improve those metrics.
- Cthulhu_ 2mo agoAnd a way for it to get actual measurable results / feedback loop, which is apparently quite tricky even for humans to get.
- Scoundreller 2mo agotbh, it probably works. I'm vibe-coding a thing and just told it to figure out why it runs so slow: put in some optimizations. It ran some tests and stopped loading an entire-something at opening because there's no value to doing that.
- api 2mo agoIt does a pretty good job being put into a loop of "try to optimize for X" then "test and audit your code" then repeat.
- pjmlp 2mo agoYeah, 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".