Avatar
Justin Moon
11b9a89404dbf3034e7e1886ba9dc4c6d376f239a118271bd2ec567a889850ce

Damus is good for threads, but it's ios-only so you can't share it with a non-nostr user ...

It's not easy. These clients really such.

Because SQLite is so stable and well-supported. Should I look into redb? Does anything use it in production? Last time I looked it was only Casey Rodarmor using it lol.

Rust process the actions and writes state to DB and UI reacts to notifications of these db changes

Do any web clients handle threads well? I want to share a thread I just wrote but primal can't do threads well ...

So you like the effectless core? That never made sense to me.

For any kind of real application I would need to make sure they all had traits for any IO they do. Then I would need to implement these traits based on the "capabilies" they offer. But they don't support SQLite so I would need to implement that in Swift and Kotlin? Now I'm writing database codee in Swift and Kotlin -- exactly what I don't want to do. Why?

I would much rather just write a normal rust program.

I looked into it a few times in the past, but it always seemed way too complex and opinionated for me. And they never had any working apps. Have you tried it?

I am writing a UI framework instead of learning Zig 😅

You write your UI in platform-native options like SwiftUI or Jetpack Compose. You could also write it in React Native or Flutter. But honestly I don't think they are worth it. When the UI is a pure function you can vibe-code it. Your application is written and tested in Rust.

The UI above was a Cursor one-shot based on this TLDraw diagram. Notice how it put the "choose mint" screen in the wrong place. History screen was also broken so commented it out.

Forget React Native and Flutter!

This is how the database changes are propogated to Swift. sqlite-watcher listens for changes to database tables in Rust, and sends notifications to Swift via Updater::send_update

SwiftUI re-renders reactively based on changes in this view model, which just receives notifications of any relevant changes to the SQLite database

Yes, you heard that correctly. The router state is written to SQLite by Rust.

I'm copying a pattern used by Facebook Messenger where all UI state is stored in SQLite and the UI is a thin, pure function render:

- https://engineering.fb.com/data-infrastructure/messenger/

- https://www.droidcon.com/2019/10/25/the-light-way-2/

In the demo I can kill the app and re-open it in exactly the same place because the router state is stored in SQLite.

I'm cooking up a Rust port of Kotlin Multiplatform.

Making a little cashu wallet to start.

https://m.primal.net/PYLY.mov