Exadra37
Elixir Desktop - Can it be used to write SDKs for Android and iOS?
I want to write an SDK for Android and iOS where the core will be written once in a programming language that can be then wrapped by Swift and Kotlin.
I know I can do it in C, and I think it’s possible to do it in Rust, but wondering if Elixir desktop can do it?
Most Liked
dominicletz
This option is tricky but possible on Android, but it’s impossible on iOS. There is no such thing as stdin/stdout communication on iOS. You can’t in fact ship more than one executable. Everything has to be one big statically linked object file. You can checkout the port of the beam, but in short the system() and spawn_port() commands are not supported on iOS. This is an iOS limitation and intended by apple.
For that reason I went with JSON communication via sockets. But it’s all running in the same iOS process. With some more native plumbing the socket could be replaced with in-process communication with memory buffers which would be more efficient, but I didn’t have enough time for that.
derek-zhou
Exadra37
Ping to @dominicletz (the author).
For example the Mozilla foundation uses UniFFI to help with the generation of the bindings to include Rust in their SDKs for Android, iOS and others:
UniFFI is a tool that automatically generates foreign-language bindings targeting Rust libraries.
It fits in the practice of consolidating business logic in a single Rust library while targeting multiple platforms, making it simpler to develop and maintain a cross-platform codebase.
Note that this tool will not help you ship a Rust library to these platforms, but simply not have to write bindings code by hand
I still need to find resources on how to compile to iOS and Android.
Popular in Questions
Other popular topics
Latest in /Elixir Desktop
Latest on Elixir Forum
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









