Discussion:
[dart-misc] iOS and Dart
kc
2015-11-02 12:34:06 UTC
Permalink
How does the Dart VM with Flutter run on iOS without JIT?

Is the Fletch VM now more focused on IoT?

K.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Günter Zöchbauer
2015-11-02 14:05:28 UTC
Permalink
looks like https://github.com/flutter/engine/issues/1576
Post by kc
How does the Dart VM with Flutter run on iOS without JIT?
Is the Fletch VM now more focused on IoT?
K.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Filipe Morgado
2015-11-02 16:53:58 UTC
Permalink
I think iOS snapshots are a compact binary form of Dart code, just like any Dart snapshot on other platforms. They're not AoT native bytecode.

The Dart VM has a builtin interpreter, which is used on iOS without JIT optimizations.

Unless there's an unannounced experiment involving some kind of AoT compilation for iOS, I don't think we can run optimized Dart code, JIT or AoT (yet).
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Kasper Lund' via Dart Misc
2015-11-03 07:33:30 UTC
Permalink
The Dart VM with Flutter runs on iOS using precompilation to native code,
and the Fletch VM is now more focused on embedded, low-footprint scenarios.

Hope that helps.

Cheers,
Kasper
Post by Filipe Morgado
I think iOS snapshots are a compact binary form of Dart code, just like
any Dart snapshot on other platforms. They're not AoT native bytecode.
The Dart VM has a builtin interpreter, which is used on iOS without JIT optimizations.
Unless there's an unannounced experiment involving some kind of AoT
compilation for iOS, I don't think we can run optimized Dart code, JIT or
AoT (yet).
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Filipe Morgado
2015-11-03 13:45:56 UTC
Permalink
Wow, great to know!

But I'm confused. Shouldn't native precompilation produce a native executable? How are snapshots loaded if they contain native code?

Also, are there benchmarks comparing AoT compilation against interpretation and JIT on a similar Android devide?
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Ivan Posva' via Dart Misc
2015-11-03 14:02:23 UTC
Permalink
Post by Filipe Morgado
Wow, great to know!
But I'm confused. Shouldn't native precompilation produce a native executable? How are snapshots loaded if they contain native code?
Precompilation produces two outputs: A conventional snapshot and a .S
file which is then assembled and linked into the resulting binary. The
VM running on iOS has then special code to connect the two together.

Hope that helps,
-Ivan
Post by Filipe Morgado
Also, are there benchmarks comparing AoT compilation against interpretation and JIT on a similar Android devide?
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Srdjan Mitrovic' via Dart Misc
2015-11-03 16:49:32 UTC
Permalink
Post by Filipe Morgado
I think iOS snapshots are a compact binary form of Dart code, just like
any Dart snapshot on other platforms. They're not AoT native bytecode.
The Dart VM has a builtin interpreter, which is used on iOS without JIT optimizations.
Dart VM does not have an interpreter. In JIT based execution, JIT initially
creates unoptimized code that is run until hot code is detected. Hot
functions are optimized, unoptimized code is replaced with optimized code.

Cheers,

- Srdjan
Post by Filipe Morgado
Unless there's an unannounced experiment involving some kind of AoT
compilation for iOS, I don't think we can run optimized Dart code, JIT or
AoT (yet).
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Filipe Morgado
2015-11-03 19:28:20 UTC
Permalink
Thanks for the explanation and the correction.

I thought I read in a Flutter thread that interpretation was used on iOS, but I could be mistaken.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Gen
2015-11-03 19:56:09 UTC
Permalink
AFAIK you are not mistaken with regard to Flutter on iOS. Fletch is an
interpreter because Apple does not allow JIT except the Javascript JIT in
the browser.
Post by Filipe Morgado
Thanks for the explanation and the correction.
I thought I read in a Flutter thread that interpretation was used on iOS,
but I could be mistaken.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Filipe Morgado
2015-11-03 21:21:36 UTC
Permalink
Flutter doesn't use Fletch, not even on iOS.

I guess it just links parts of the Dart VM within the executable (gc, event-queue, APIs, snapshot loader?).

It's probably very early, but I'm curious regarding the performance characteristics of AoT Dart.

I suspect the gains could be significant if the compiler cares about types.

But I guess it would meen a whole new specification is required.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Ivan Posva' via Dart Misc
2015-11-03 23:00:28 UTC
Permalink
There seems to have been quite a bit of a confusion on this topic. At
some point you might have heard that Flutter used an "interpreter" on
iOS, it didn't. As you probably also know we do have simulators for
the non-Intel instruction sets supported by the VM (arm, arm64 and
mips). This way we can develop and debug all of our JIT
implementations on our desktop machines.

In the initial bringup of Flutter on iOS we were running with the JIT
enabled. As we all know, on iOS we cannot execute the dynamically
generated instructions, instead we reused the existing simulator in
the VM. Some might have referred to this mode as "interpreted". We
refer to this mode as simulated. In contrast a real interpreter would
run bytecodes specifically designed for Dart execution and not ARM
instructions.

Since we now do have a precompilation step, the simulated execution on
iOS is not necessary any longer.

I hope this makes things a bit clearer.

Thanks,
-Ivan
Post by Filipe Morgado
Flutter doesn't use Fletch, not even on iOS.
I guess it just links parts of the Dart VM within the executable (gc, event-queue, APIs, snapshot loader?).
It's probably very early, but I'm curious regarding the performance characteristics of AoT Dart.
I suspect the gains could be significant if the compiler cares about types.
But I guess it would meen a whole new specification is required.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Bob Nystrom' via Dart Misc
2015-11-04 00:01:28 UTC
Permalink
On Tue, Nov 3, 2015 at 3:00 PM, 'Ivan Posva' via Dart Misc <
Post by 'Ivan Posva' via Dart Misc
There seems to have been quite a bit of a confusion on this topic. At
some point you might have heard that Flutter used an "interpreter" on
iOS, it didn't.
A while back, the team communicated that we were investigating using
*Fletch* on iOS. Fletch is an interpreter.

That's where the confusing is coming from, I think.

– bob
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Gen
2015-11-04 07:46:44 UTC
Permalink
I had watched the video Dart for Mobile
where Fletch was meant to run
Dart on iOS.
Somehow I missed the comment in this thread where Kasper clarified that
compilation to native code is used on iOS.
I still wonder how Dart allows compilation to native code; I had thought it
was impossible to run Dart code fast without JIT optimizations or at least
an interpreter.

With regard to Flutter (previously called Sky), I do not remember that it
was advertised to be implemented in Dart.
But the repository contains Dart files and Flutter is meant to be used with
Dart code which must run somehow.
Here is a picture showing the architecture of Sky:

The green color means Dart code.
Post by 'Bob Nystrom' via Dart Misc
On Tue, Nov 3, 2015 at 3:00 PM, 'Ivan Posva' via Dart Misc <
Post by 'Ivan Posva' via Dart Misc
There seems to have been quite a bit of a confusion on this topic. At
some point you might have heard that Flutter used an "interpreter" on
iOS, it didn't.
A while back, the team communicated that we were investigating using
*Fletch* on iOS. Fletch is an interpreter.
That's where the confusing is coming from, I think.
– bob
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Yegor Jbanov
2015-11-04 08:02:36 UTC
Permalink
Post by Gen
With regard to Flutter (previously called Sky), I do not remember that it
was advertised to be implemented in Dart.
But the repository contains Dart files and Flutter is meant to be used
with Dart code which must run somehow.
Check out http://flutter.io (*tl;dr* the lowest-level engine is
C++/Skia/Mojo; developer-facing SDK is Dart; developer chooses how high- or
low-level to go)
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
kc
2015-11-23 13:49:18 UTC
Permalink
How does precompilation work with compiling observed hot code which
requires runtime concrete type info and JIT (I think)?

K.
Post by 'Ivan Posva' via Dart Misc
There seems to have been quite a bit of a confusion on this topic. At
some point you might have heard that Flutter used an "interpreter" on
iOS, it didn't. As you probably also know we do have simulators for
the non-Intel instruction sets supported by the VM (arm, arm64 and
mips). This way we can develop and debug all of our JIT
implementations on our desktop machines.
In the initial bringup of Flutter on iOS we were running with the JIT
enabled. As we all know, on iOS we cannot execute the dynamically
generated instructions, instead we reused the existing simulator in
the VM. Some might have referred to this mode as "interpreted". We
refer to this mode as simulated. In contrast a real interpreter would
run bytecodes specifically designed for Dart execution and not ARM
instructions.
Since we now do have a precompilation step, the simulated execution on
iOS is not necessary any longer.
I hope this makes things a bit clearer.
Thanks,
-Ivan
Post by Filipe Morgado
Flutter doesn't use Fletch, not even on iOS.
I guess it just links parts of the Dart VM within the executable (gc,
event-queue, APIs, snapshot loader?).
Post by Filipe Morgado
It's probably very early, but I'm curious regarding the performance
characteristics of AoT Dart.
Post by Filipe Morgado
I suspect the gains could be significant if the compiler cares about
types.
Post by Filipe Morgado
But I guess it would meen a whole new specification is required.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to
http://www.dartbug.com/new
Post by Filipe Morgado
To unsubscribe from this group and stop receiving emails from it, send
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Continue reading on narkive:
Loading...