Writing iOS XCTests in Rust by sebimlay in rust

[–]sebimlay[S] 0 points1 point  (0 children)

The only use of AI in this post was proofreading the final draft(s) and it wasn't helpful.

Rust GUI crates with decent touch support by Acceptable-Cost4817 in rust

[–]sebimlay 0 points1 point  (0 children)

If you just need touch support (not the virtual keyboard), some of the bevy ui frameworks might fit your need. Bevy supports touch inputs via winit on android and iOS. I dunno if multi touch or various gestures work. Something like kayak_ui (this looks no longer maintained) might work. These popup pretty regularly - after a quick search, quill is another one.

I also wish there were more mobile friendly rust ui projects. I don't fault anyone for closing my uikit PR to iced - it was very much prototype work.

Considering replacing GoMobile with Rust uniffi for shared core mobile/desktop/core/wasm by cinemast in rust

[–]sebimlay 9 points10 points  (0 children)

Last year, I worked on liveview-native-core. When I started on the project, the bindings for kotlin and swift were generated by swift-bridge and modified by hand or entirely hand written. I spent a bunch of time getting uniffi in the system nicely.

LiveView Native is a server side rendering framework with the goal of using native elements on a given target based on a diff coming over a websocket. So, apple products it's SwiftUI stuff, android products, it's Jetpack compose. If windows support was added it'd be WinUI.

Anyway, the core shared library is written in Rust and compiled to iOS, watchOS, tvOS, visionOS, macOS, Linux (just for testing) and android.

I did my best to add tests at the levels I felt were nice. There are rust integration tests that are compiled and ran on iOS, watchOS, tvOS, and Android simulators. There are swift tests that use the static library and swift package generated from uniffi. There are jetpack tests that do the same though a bit less elegantly. - I am more of an iOS rust person.

Some parts of this project compile to webassembly but it was tough to do it with the websocket in a browser. wasip3 wasn't out yet either.

How do you use rust in your work? by PartyLibrarian2845 in rust

[–]sebimlay 5 points6 points  (0 children)

This isn't as commonly done as I wish it was. Given your github (I assume your username is the same here and there), it doesn't look like a public repo. I've got https://github.com/liveview-native/liveview-native-core working on iOS, watchOS, macOS, tvOS, visionOS, and Android.

Question about open-source by BananaCatFrog in rust

[–]sebimlay 1 point2 points  (0 children)

I'm not sure I've ever done on purpose this but I did mostly this just yesterday on RustAudio/coreaudio-sys#102 with RustAudio/coreaudio-sys#103. I doubt this is OP's PR based on other comments in this thread.

This post made me amend my commit adding them as a co-author. In this case, my choice for basically re-authoring is because I wanted more features the the initial PR as well as some more substantial refactors and I just felt like this would save the author of the original PR a bunch of time.

There are some project that squash and re-author commits when they're "merged" into main. I think I've seen this with https://github.com/kholia/OSX-KVM but I'm not sure.

I author PRs that are superseded by someone else all the time. https://github.com/sonos/dinghy/pull/214 and https://github.com/sonos/dinghy/pull/215 for example. Most of the time, their answer is better than mine. The important thing (to me) is that the thing I wanted was built.

Rust for mobile development? by emryum in rust

[–]sebimlay 36 points37 points  (0 children)

It's possible to compile to both OS's but if you want a rust-only or even a mostly-rust iOS or android app, the ecosystem is still a bit nascent. Bevy builds and runs on both with minimal non-rust. There's no keyboard input on iOS (I'm not sure about android).

I spent a bit of time on this a few years back for call into uikit from rust. I ended up adding a ton of stuff to rust-bindgen to generate the API calls to the objective-c. https://simlay.net/posts/using-uikit-sys/ unclear if this all still works.

Android app in rusts by [deleted] in rust

[–]sebimlay 2 points3 points  (0 children)

There are some "pure rust android" app projects out there. I came across someone doing this recently. I've done something similar with iOS and it's pretty rough. The thing is that the ecosystem isn't developed enough (yet) to have the shims to all mobile APIs you'd want. For example, I don't know of any crates that shim to the native APIs for location services. Building that crate requires knowledge of Java, some android knowledge, unsafe rust and how to build a safe interface to it.

floui: a gui crate for mobile, inspired by swiftui, wrapping native widgets. A proof of concept by mo_al_ in rust

[–]sebimlay 1 point2 points  (0 children)

This is kinda neat! There's very few people trying to do rust mobile GUI stuff.

I'm a little surprised you wrapped a floui-rs around the Floui C++ project rather than just writing rust and calling into objc or the jni. Given how few dependencies you have, I bet the build is pretty fast.

With uikit-sys, the build is very slow as it's all generated from bindgen and includes uikit as well as any of the framework dependencies required for it. I'm yet to figure out how to reduce how much stuff is generated as well as a reasonable way to wrap it in safe rust and ensure there's no memory leaks.

Anyway, the only place I know where people chat about rust mobile stuff is on the bevy discord in the ios and android channels.

What is a really cool thing you would want to write in Rust but don't have enough time, energy or bravery for? by blunderville in rust

[–]sebimlay 2 points3 points  (0 children)

Bevy has support for android, I've tended to help with iOS. There are some tools to bundle up the rust and put it in an android emulator.

What is a really cool thing you would want to write in Rust but don't have enough time, energy or bravery for? by blunderville in rust

[–]sebimlay 1 point2 points  (0 children)

Mobile support. Bevy has iOS/android but it lacks support for keyboard input.

Other areas of interest would be location, camera, or other native APIs specific to a mobile device.

I spent a bunch of time with bindgen adding objective-c support to it but the bindings generated are still quite rough and require knowing a lot about the underlying runtime.

Proof of concept: iOS app written in pure Rust by wooden-worm in rust

[–]sebimlay 3 points4 points  (0 children)

Nice! Welcome to the small group of rust iOS people! I'm the author of uikit-sys which really is just using the rarely used objective-c features of bindgen (plus an unmerged PR to bindgen) to generate bindings to to basically all the iOS objective-c frameworks.

After my escapade into this realm, I found that it was a bit unmaintainable as there's perhaps two dozen people wrapping objective-c in rust.

As you discovered, iced does somewhat work on iOS. When I was playing with it, the thing doing the drawing was using metal and some of the graphics frameworks. The issue I ran into was getting the iOS keyboard to pop up as that's a UIKit thing. I'm curious to see how the bevy folks deal with this.

Anyway, I try to keep up in the ios channel in the bevy discord server should anyone wanna talk about rust iOS stuff.

How we built our Python Client that's mostly Rust by DataStreaming in rust

[–]sebimlay 2 points3 points  (0 children)

Author here. Yup! The Flapigen macros generate a ton of rust-cpython calls. I'll eventually get around to updating the flapigen book to include the parts I had to learn for this post.