Skip to content

About

Octoscript DSL rendered to native Android widgets from Rust — the Android peer of Octoscript-OH

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Octoscript-Android

English | 简体中文

Building an OctoSense app? You do not need this repository: it renders OctoScript to native Android widgets as a research renderer, a separate path from OctoSense script apps and the App Hub. Start from the OctoSense organization profile's reading order: OctoScript-App-Design-Flow AGENTS.md → flows/README.md → docs/QUICKSTART.md.

Shared Octoscript-Makepad runtime

native-runtime.lock.json selects one Octoscript-Makepad release. Its runtime.json owns the exact Makepad and Octoscript revisions, shared with the OctoSense shells, the App Hub's card-host, Mail and the other OctoSense applications.

Before building, run python3 tools/setup-native.py (Python 3.9+). The framework repositories are siblings of this app: ../octoscript-makepad, ../makepad and ../octoscript. Local changes are preserved; --update only updates clean checkouts. CI verifies the selected release and rejects duplicate Makepad sources. Use python3 tools/setup-native.py --check --cargo-manifest catalog/rust/Cargo.toml to check the local dependency graph. Existing platform rendering backends remain part of their applications; the framework controls the shared VM and UI sources.

Runtime lock (fixed #4, 2026-09-26): the lock and the matching Cargo revs now select Octoscript-Makepad 6cf2d90a, a commit on its main (makepad d653bc44, Octoscript 2e37d9e6: the same framework sources as the other OctoSense consumers). The previous pin, b1596d9c, was the pre-history-rewrite hash of main's f4acc6c; nothing was lost in the move.

Octoscript DSL rendered to native Android widgets from Rust — the Android peer of Octoscript-OH, which does the same against OpenHarmony's ArkUI.

probe/      the feasibility probe   — octoscript-render -> android.widget.*, framework widgets only
catalog/    the Material catalog    — 42 screens of Octoscript DSL -> com.google.android.material.*

Both run on device (OnePlus 6T, Android 11 / SDK 30).

The shape

.octoscript  ──►  makepad-script VM  ──►  node tree  ──►  flat buffer  ──►  Java builder  ──►  Views
              (via octoscript-render;        (Rust)      ONE JNI call      (owns every View)
               no makepad renderer)

Java owns every View; Rust owns integer ids and the card state. No jobject is ever held in Rust, so ART's 512-local-reference abort and the FindClass classloader trap are structurally unreachable.

There is no makepad renderer in the process — no makepad-platform, no makepad-draw, no makepad-widgets, no GL surface. The only makepad code linked in is makepad-script, the language VM, whose own dependencies are error_log, math, live_id, script-derive, smallvec, regex, html.

Why Android is not a port of Octoscript-OH

OpenHarmony ships arkui/native_node.h — a C NDK for widget construction. Android has no equivalent: 62 headers in the NDK's android/ directory, none of them a widget API. Every android.widget.* object must be constructed through JNI into ART, and unlike ArkUI there is no native tier beneath the managed object. So Octoscript-OH's 2.5–3× construction win does not transfer, and the design goal here is minimising boundary crossings, not avoiding managed-language objects.

The full analysis (OCTOSCRIPT-ANDROID-NATIVE-WIDGETS.md) is in octos-one, which is not a public repository.

catalog/

A reproduction of material-components-android's catalog: 42 screens, every one authored in the Octoscript DSL and evaluated on device. Includes real MaterialAlertDialogBuilder / Snackbar / MaterialDatePicker / MaterialTimePicker / BottomSheetDialog / SideSheetDialog / PopupMenu / DrawerLayout, a real Carousel, and live Material motion (MaterialContainerTransform, MaterialSharedAxis, MaterialFadeThrough).

It also carries octos-one's own makepad widgets ported to Android views — WeatherIconView, NavMapView, GlassPanelView — the ones previously written off as having no android.widget equivalent.

See catalog/README.md.

Build

Both need the Android NDK and a JDK. The catalog uses Gradle (which is what makes androidx and Material available at all); the probe builds an APK by hand with aapt2/javac/d8.

# catalog
cd catalog/rust && cargo build --release --target aarch64-linux-android
cp target/aarch64-linux-android/release/liboctoscript_catalog.so ../app/src/main/jniLibs/arm64-v8a/
cd .. && gradle assembleDebug && adb install -r app/build/outputs/apk/debug/app-debug.apk

# probe
cd probe && ./build.sh

catalog/rust also has a host-side check that needs no device:

cd catalog/rust && cargo run --release --example probe   # evaluates all 42 routes

Status

  • ✅ feasibility probe — framework widgets, real IME, full accessibility tree
  • ✅ Material catalog — 42 screens, 0 placeholders, 0 exceptions on device
  • ✅ octos-one widget ports — WeatherIcon (8 conditions), MapView (3 nav modes), glass panels
  • ⏳ the UiNode delta/event contract — construction is done; incremental updates are not
  • ⏳ octoscript-render upstreaming: a Native/Custom node kind, a key attribute for reconciliation, and Serialize derives

Licence

Apache-2.0 (see LICENSE and NOTICE). Drawables taken from the material-components-android catalog keep their original Android Open Source Project copyright headers (also Apache-2.0).

About

Octoscript DSL rendered to native Android widgets from Rust — the Android peer of Octoscript-OH

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages