Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Rust meets Mobile
Search
Keith Smiley
November 07, 2022
Programming
470
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Rust meets Mobile
2022 BazelCon talk about using bazel to build rust libraries for iOS and Android
Keith Smiley
November 07, 2022
More Decks by Keith Smiley
See All by Keith Smiley
Lyft iOS tooling infrastructure summary 2022
smileykeith
0
500
Postmortem for switching Lyft's iOS app to Bazel
smileykeith
4
1.7k
Lyft iOS tooling infrastructure summary 2019
smileykeith
2
1.6k
An alternative approach to building & shipping Swift apps
smileykeith
5
1.4k
Embrace Immutability
smileykeith
0
9.6k
Tales of a rewrite
smileykeith
0
800
Swift Thinking
smileykeith
0
12k
Other Decks in Programming
See All in Programming
sbt 2.0: takeoff
eed3si9n
0
160
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
290
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
430
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
170
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
740
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
140
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
1k
残高管理から台帳サービスへの進化
artoy
1
200
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
6.6k
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
500
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
120
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
940
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Visualization
eitanlees
153
17k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Un-Boring Meetings
codingconduct
0
460
GitHub's CSS Performance
jonrohan
1033
470k
Facilitating Awesome Meetings
lara
57
7.2k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
800
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
570
Utilizing Notion as your number one productivity tool
mfonobong
4
620
Scaling GitHub
holman
464
140k
Claude Code のすすめ
schroneko
67
230k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
820
Transcript
Rust meets Mobile Keith Smiley (he/him) Principal Engineer, Lyft @SmileyKeith
Sharing code on mobile
Why rust?
Rust + bazel
rust_library( name = "foo", srcs = ["foo.rs"], ) swift_library( name
= "main", srcs = ["main.swift"], deps = [":foo"], ) ios_application(...) Shouldn't this work?
--platforms=//:ios_arm64
bazel#7260
platform_mappings
flags: --cpu=arm64-v8a --crosstool_top=//external:android/crosstool //:android_aarch64 --cpu=ios_arm64 --apple_platform_type=ios //:ios_arm64 ...
Undefined symbols for architecture arm64: "___rust_alloc", referenced from: ... "___rust_alloc_error_handler",
referenced from: ... ... rules_rust#1238 / rust#73632
Who does the linking?
How do I use it?
#[no_mangle] pub extern fn print_something_from_rust() { println!("Ferris says hello!"); }
#[no_mangle] pub extern fn get_a_value_from_rust() -> i32 { 42 } extern void print_something_from_rust(void); extern int32_t get_a_value_from_rust(void);
#[no_mangle] pub extern "system" fn Java_com_example_androidapp_JniShim_getValue() -> i32 { get_a_value_from_rust()
} package com.example.androidapp; public class JniShim { public static native int getValue(); }
dtolnay/cxx rust-lang/rust-bindgen
Future areas of improvement
Developer Experience
Future rust mobile support
Was it worth it?
keith/bazel-rust-mobile-demo
- bazel#11454 - bazel#15041 - bazel#15248 - bazel#15462 - bazel#7260
- cargo-raze#484 - cargo-raze#489 - rules_rust#1186 - rules_rust#1238 - rules_rust#1259 - rules_rust#1271 - rules_rust#1276 - rules_rust#1290 - rules_rust#1304 - rules_rust#1362 - rules_rust#1372 - rules_rust#1401 - rules_rust#1462 - rules_rust#1541 - rules_rust#1545 - rules_rust#1546 - rules_rust#1573 - rules_rust#1576 - rust#73632
Thank you! twitter.com/SmileyKeith