Hacker News new | ask | show | jobs
by deepsun 1731 days ago
The point is that Flutter compiles back to Javascript.
1 comments

It doesn't. To clarify, you can compile dart to javascript, albeit more commonly to machine code.
https://flutter.dev/web

> Adding web support to Flutter involved implementing Flutter’s core drawing layer on top of standard browser APIs, in addition to compiling Dart to JavaScript, instead of the ARM machine code that is used for mobile applications. Using a combination of DOM, Canvas, and WebAssembly, Flutter can provide a portable, high-quality, and performant user experience across modern browsers.

It does if you target browsers with your flutter app.
I believe it actually targets WASM and renders as a canvas element.
No. Where did you get that from? Compiling dart into WASM is a highly requested, but unimplemented feature (it's not really necessary for most cases you'd think). https://github.com/dart-lang/sdk/issues/32894
The CanvasKit renderer, which at the time of this GitHub comment [0] was experimental but is now the default one (the other being a HTML renderer rather than a canvas renderer, but that had some problems and was not as fast as the canvas implementation, so it was overridden by canvas), uses WASM and WebGL.

[0] https://github.com/flutter/flutter/issues/41062#issuecomment...

[1] https://flutter.dev/docs/development/tools/web-renderers