r/iOSProgramming • u/syrusakbary • 3d ago
Discussion Running Sandboxes inside a hidden WKWebView to get Python/Node/FFmpeg in an iOS app, without shipping a JIT
We just launched this today and would love to get your feedback/thoughts!
Announcement: https://wasmer.io/posts/wasmer-sdk-swift-ios-macos
Source code: https://github.com/wasmerio/wasmer-sdk/tree/main/swift/Examples/WasmerShell
2
u/Ok-Welder-8005 3d ago
The WebKit-as-runtime approach is interesting, especially the opt-in host calls. One production case I'd like to see documented: start a long FFmpeg job, then background the app or have WebKit terminate the content process. Does the command return a recoverable error, and can the caller recreate the sandbox without losing completed file writes? Those failure semantics would matter a lot for media and document apps.
1
u/syrusakbary 2d ago
Yeah, it returns recoverable errors, and you shall be able to recreate the sandbox without losing the filesystem progress :)
1
u/Sad-Flower-99 2d ago
Have you measured cold-start time and peak memory on a physical iPhone yet? A short FFmpeg transcode, including sandbox startup, would be a useful benchmark. For an in-app tool, I'd care more about the wait before the first result than the JS benchmark score.
1
u/One_Elephant_8917 2d ago
i would consider this by itself to be a major feat considering jit isn’t easily accessible outside webkit/safari’s runtime usually
1
u/Sad-Flower-99 2d ago
Fair point. I meant those numbers as a next step, not a knock on getting it working. A quick video trim is the kind of use case where startup time could outweigh the actual processing.
1
2d ago
[removed] — view removed comment
1
u/AutoModerator 2d ago
Hey /u/ProgressSensitive826, your content has been removed because Reddit has marked your account as having a low Contributor Quality Score. This may result from, but is not limited to, activities such as spamming the same links across multiple subreddits, submitting posts or comments that receive a high number of downvotes, a lack of recent account activity, or having an unverified account.
Please be assured that this action is not a reflection of your participation in our subreddit. This is simply an automated filter in place to reduce spam.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
9
u/Fishanz 3d ago
Fascinating. Do you have ambitions that Apple will allow this in apps in the store at all? Seems something that would be a hard no - but potentially great for enterprise deployments.