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

A History of JavaScript on Mobile

Jamie Birch
July 26, 2024
410

A History of JavaScript on Mobile

My lightning talk for Mobile Dev Japan #3.

Jamie Birch

July 26, 2024
Tweet

Transcript

  1. HitchHiker (1997) The first mobile browser to implement ECMAScript, by

    British company SNTC. Ran nearly exclusively on Sony phones with antennae.
  2. Pocket Internet Explorer v3.0 (1998) Not actually based on Internet

    Explorer. Genuine Internet Explorer 10 only landed in Windows Phone 8 (2012).
  3. NetFront v3.0(?) (2002) Deployed on just about every device, including

    TVs, Kindle (2007-2009; JavaScriptCore from 2010) and Sony PSP (2009).
  4. Post-iPhone (2007+) … And the second browser war (2004–2017) Browser

    JavaScript engine Chrome V8 Safari JavaScriptCore Firefox SpiderMonkey Internet Explorer Chakra Opera Futhark, Carakan
  5. The de facto standard on iOS: JavaScriptCore • Introduced in

    iOS 7 (2013) • Zero size (on iOS) • Battery-efficient • Used by NativeScript iOS (2014) • Used by React Native iOS & Android (2015) • What more could you want?
  6. Other options V8 • Fast (even with JIT disabled) •

    Heavy (17.6 MB for v9.7 on Android, without Internationalisation API) • Used for NativeScript on Android (2014) and iOS once JITless (2019) • Used for React Native by Expo (2019) and Microsoft (2020)
  7. Other options Hermes • React Native announced Hermes in 2019

    • Small (4.4 MB release build on iOS, as of React Native v0.73.7) • Fast (due to AoT compilation) • However, lacks ES6 support, Intl, etc.
  8. Other options Remember Node.js? • Node.js ported to mobile on

    2017 (swapping V8 for ChakraCore) • Back to V8 once it supported JITless mode (2020) • Fast, with a comprehensive SDK, but heavy • Sadly never really caught on
  9. Other options Small runtimes • Ultra-small easily-embeddable runtimes • Duktape

    (2013) and JerryScript (2014) for seriously weak devices • QuickJS (2019)
  10. Abrupt conclusion • JavaScript engines on mobile have gone from

    individual ventures to a game of Big Tech • Which engine should we use nowadays? • Size: JavaScriptCore (on iOS), Duktape, JerryScript, QuickJS, Hermes • Fast startup: Hermes • Fast execution: V8 • Features: V8, JavaScriptCore, SpiderMonkey