Skip navigation
The host in Effect | TypeScript for the AI Era UI is clean enough that standard Html.component views…
0:00 / 0:32

The host in Effect | TypeScript for the AI Era UI is clean enough that standard Html.component views…

Nathan Walker

@wwwalkerrun4K followers

Visit on X
194 likesDownloadOriginal post

12,185 views

The host in Effect | TypeScript for the AI Era UI is clean enough that standard Html.component views can mount directly onto native iOS, Android, macOS, Windows and Linux views. Put together @nstudio/nativescript-effect-ui with NativeScript + MasonKit to explore it.

18 Comments

Comments from the original post on X (Twitter)

  • Michael Arnaldi's profile picture

    @MichaelArnaldi

    @EffectTS_ @NativeScript Would love to upstream this! Cc @thefubhy @tim_smart @devinjameson

    30 likes

  • Nathan Walker's profile picture

    @wwwalkerrun

    @NativeScript Source and examples

    11 likes

  • Gjin's profile picture

    @unwindstack

    @EffectTS_ @NativeScript Does focus and tab order work on the mac side

    2 likes

  • Nathan Walker's profile picture

    @wwwalkerrun

    @EffectTS_ @NativeScript it does. you can see how that's wired in the macoshost here:

    5 likes

  • Gjin's profile picture

    @unwindstack

    @EffectTS_ @NativeScript Oh nice, thats usually the first thing that breaks

    2 likes

  • Nathan Walker's profile picture

    @wwwalkerrun

    @EffectTS_ @NativeScript indeed always critical! key reason why I’ve always preferred platform api route first class in TS anything

    2 likes

  • Gjin's profile picture

    @unwindstack

    @EffectTS_ @NativeScript Makes sense, the platform already solved it

  • Sebastian Lorenz's profile picture

    @thefubhy

    @EffectTS_ @NativeScript Nice! Are you on our Discord?

    1 like

  • Nathan Walker's profile picture

    @wwwalkerrun

    @EffectTS_ @NativeScript i believe so, will ping there

  • Siebe Burgerhout's profile picture

    @siebixweb

    @EffectTS_ @NativeScript @jonahkalkman

  • Remus's profile picture

    @remusrisnov

    @EffectTS_ @NativeScript Does it compile down to the primitives of each platform? Say you write the code in effect UI then point it at native iOS will it convert it into swift?

  • Nathan Walker's profile picture

    @wwwalkerrun

    @EffectTS_ @NativeScript You could choose either way. Release with any JS engine (V8, quickjs, Hermes, etc) or could compile to swift & kotlin

    2 likes

  • Michael Arnaldi's profile picture

    @MichaelArnaldi

    @remusrisnov @EffectTS_ @NativeScript How do you compile general purpose JS to Swift ?

    2 likes

  • Nathan Walker's profile picture

    @wwwalkerrun

    perhaps the most interesting question with this. we don't compile arbitrary JS to Swift. we compile closed-world TypeScript with explicit boundaries. - closed-world graph + refuse constructs that truly require a JS VM (eval, with, Proxy) instead of silently diverging - gradual soundness (typed fast path + tiny dynamic kit). only where untyped boundaries appear (any, JSON.parse, Function.dual, dynamic keys) do we drop to a small Swift runtime kit (JSDynamic, JSExpando, JSFunction cells) with explicit null/undefined tracking - given NativeScript already models the entire platform SDKs 1:1 in TypeScript, so UI, layout, and plugins compile straight into direct Swift/Kotlin calls naturally

    1 like

  • Michael Arnaldi's profile picture

    @MichaelArnaldi

    @remusrisnov @EffectTS_ @NativeScript How does that work with Effect that does use Proxy for example

    1 like

  • Nathan Walker's profile picture

    @wwwalkerrun

    looking through the source, none of the 5 Proxy sites (Data.taggedEnum, Equal.byReference, AtomRef.collection, Layer.mock, cluster/Sharding) are referenced by @effect/ui, @effect/ui-kit, or core Effect runtime (Effect, Fiber, Context, Layer, Stream, Schema, Queue, Subscription), so it shouldn't present any blocker. in rare event usage depended on it, the compiler enforces a strict compile-time refusal for any reachable Proxy, if reached, it stops with a clear [proxy] diagnostic naming the file, line, and why Proxy is excluded, allowing one to opt for different solution.

    1 like

  • Michael Arnaldi's profile picture

    @MichaelArnaldi

    @remusrisnov @EffectTS_ @NativeScript Schema will most likely start using Proxy more heavily soon

    1 like

  • Remus's profile picture

    @remusrisnov

    Slightly off topic, but could EffectUI be optimized so that when used in a dom/web environment it could be as fast if not faster than something like SolidJS? Or given that it’s an alpha one should expect performance to improve? Is there any limitations to why performance couldn’t improve in principle?