Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Holy Grail of Isomorphism: Packaging Elixir for Desktop Apps

Evadne Wu
September 03, 2020

The Holy Grail of Isomorphism: Packaging Elixir for Desktop Apps

Evadne Wu

September 03, 2020
Tweet

More Decks by Evadne Wu

Other Decks in Technology

Transcript

  1. The Holy Grail of Isomorphism:
    Packaging Elixir for Desktop Apps
    Evadne Wu
    Elixir Enthusiast
    [email protected]
    twitter.com/evadne

    View Slide

  2. Myself
    Aspiring Bodgemaster
    Elixir Programmer (etso, packmatic, shun, etc.)
    Cocoa/Touch Programmer (DayFlow, LiveFrost, etc.)
    Inquiries: [email protected]
    Arguments: twitter.com/evadne

    View Slide

  3. 1
    The Problem

    View Slide

  4. View Slide

  5. The number of
    technologies we have
    to learn is too damn
    high.

    View Slide

  6. View Slide

  7. 2
    The Environment

    View Slide

  8. View Slide

  9. View Slide

  10. View Slide

  11. 3
    The Accident

    View Slide

  12. View Slide

  13. View Slide

  14. View Slide

  15. View Slide

  16. View Slide

  17. y

    View Slide

  18. View Slide

  19. View Slide

  20. View Slide

  21. View Slide

  22. 4
    The Stuffing

    View Slide

  23. Electron (Simplified)
    Chrome
    Mac App
    Node.js
    Server

    View Slide

  24. How about this?
    Web View
    Mac App
    Erlang
    Server

    View Slide

  25. Prior Art: Nerves
    WebEngine Kiosk
    https://github.com/nerves-web-kiosk/webengine_kiosk

    View Slide

  26. View Slide

  27. Prior Art: iErl

    View Slide

  28. Prior Art: iErl
    iErl
    https://github.com/couchbase/iErl
    An embeddable, statically-linked BEAM
    No NIFs
    No JIT

    View Slide

  29. Optimisations & Tradeoffs
    Non-Native, Web-Based UI, but normalised after a
    decade of Web 2.0 development
    Non-Standard Tooling, but with a much smaller
    conceptual space and customisability
    Non-Specialised BEAM VM, but with rock-solid,
    predictable performance and stability

    View Slide

  30. Today’s Approach
    Create an Elixir Project with Phoenix, in the normal way, with
    some Endpoint customisation for port-finding and self-
    termination
    Create an Xcode Project for macOS, with a WKWebView and a
    Task that starts the Server
    Create an Elixir Release and have Xcode copy it into the
    Application Bundle

    View Slide

  31. Miscellaneous
    Storing data locally: Either use sqlite3 / sqlitex from
    Elixir side or use Local Storage from JavaScript side.
    Synchronising with the server: Use whatever existing
    APIs you have — as you are running a full BEAM node.

    View Slide