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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
810
Swift Thinking
smileykeith
0
12k
Other Decks in Programming
See All in Programming
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
200
golang-bob.pdf
iwatsukayura
0
140
PyConTW 2026 - AI Coding 不只是工具升級, 區域醫院醫療資訊系統協作開發與資訊團隊轉型實踐
cclai999
0
200
オーケストレーション記述言語 Katari
yukikurage
0
200
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
280
Vue.jsで作る空間解析アプリとCapacitorプラグインのData Bridge
hal_spidernight
1
110
パスワード再設定メールのURLについて知っておこう
uyuki234
0
190
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.4k
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
1.2k
dotNET_vulnclicker_intro.pdf
deka_morita
0
150
Coding with AI: How to trust the storyteller (AWS Community Day Adria, Ljubljana 2026)
slobodan
0
120
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
11
9.3k
Featured
See All Featured
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Agile that works and the tools we love
rasmusluckow
331
22k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
550
Exploring anti-patterns in Rails
aemeredith
4
540
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Git: the NoSQL Database
bkeepers
PRO
433
67k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
610
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Raft: Consensus for Rubyists
vanstee
143
7.8k
Faster Mobile Websites
deanohume
310
32k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
290
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