r/programming

The Great Android Stack Reset: Mobile System Design History
▲ 47 r/programming+3 crossposts

The Great Android Stack Reset: Mobile System Design History

Android, the last to arrive at the declarative UI party, took its time, until finally reaching a stable solution. Here's a rundown of the major changes in the Android System Design across the eras.

I was away from Android for 7 years and came home to a totally strange place. This is my attempt to make sense of what happened while I was gone - how the stack reset four times (Activities -> MVP/RxJava -> Architecture Components -> Compose) and why each lurch happened. Written for interview prep but the history stands on its own.

returnzero.dev
u/Super-Performance-86 — 22 hours ago
▲ 5 r/programming+2 crossposts

flex: 1 collapses in WKWebView but passes in Playwright's WebKit. Your Tauri tests cannot catch this bug class

I ship a PR review app built on Tauri. Last week a dialog that was green in every test shipped as a header, a clipped search input, and a footer. The body rendered at height zero.

The cause is the flex: 1 shorthand. It expands to flex-basis: 0%, and a percentage basis needs a definite parent height, which an auto-height panel capped by max-height does not have. The spec says the fallback is content. Chromium does that. WebKit keeps the zero.

The part that cost me the evening: Playwright's WebKit is their own recent build, not the WKWebView you actually ship in, and neither engine in my harness reproduced it. Screenshot tests, all green, app broken.

Wrote up the mechanics, the spec citation, and what I changed about testing: https://nodreview.com/blog/wkwebview-flex-collapse/

Fix is flex: 1 1 auto. Curious if anyone has found a CI-friendly way to test against the real system webview, because Playwright clearly is not it.

nodreview.com
u/HolidayChard9706 — 2 days ago
▲ 40 r/programming+1 crossposts

For all of you who are writing your own fractal renderers: A simple DoubleDouble type has 2x the precision of a plain double at a reasonable cost

marekfiser.com
u/NightElfik — 2 days ago
▲ 29 r/programming+2 crossposts

Caí en el rabbit hole del debugging

Resolví un bug: era porque 7.5 % 2 da 1.5 en JavaScript y 1 en PHP. Y me quedé pensando: ¿cuántas diferencias más habrá de este tipo? Así no me vuelven a agarrar desprevenido.

Como no encontré una lista con las divergencias que estaba buscando, hice lo que haría cualquier persona razonable: puse ocho IAs a laburar en el tema.

Hasta el momento, encontraron 143 divergencias semánticas… solamente en los tipos de datos que maneja JSON: números, strings, arrays, maps, booleanos.

Por ejemplo:

  • Math.round(-2.5): -2 en JS y Python… -3 en PHP
  • Math.round(2.5): 3 en JS y PHP… 2 en Python
  • "😀".length: 2 en JS (UTF-16)… 1 en Python… 4 en PHP (bytes)
  • "10" < "9" → true en JS y Python… false en PHP (compara numéricamente)
  • sort(): [1, 10, 2] en JS (ordena alfabéticamente)… [1, 2, 10] en Python
  • split(""): ["a","b","c"] en JS y PHP… ValueError en Python
  • "a" || "b": "a" en JS y Python… true en PHP

Y eso sin mencionar nuestro querido 0.1 + 0.2 = 0.30000000000000004 en todos los lenguajes con float de 64 bits.

La lista completa está acá (es como un video recopilación de accidentes de tránsito): https://github.com/sbustelo/JSOL/blob/main/docs/10_dev/EXTENDING-SEMANTIC-PARITY.md

Y si quieren, dénse una vuelta por el resto del repo. Es como JSON, pero para lógica de negocio. Ya se compila a sí mismo en JS y PHP, ya irán saliendo otros.
Demo: https://jsol.bustelo.com.ar/

Quizás les parezca una aberración, quizás les parezca útil… ya me dirán :)

u/santiagobustelo — 3 days ago