fzyzcjy / dart_interactive

REPL (interactive shell) for Dart, supporting 3rd party packages, hot reload, and full grammar
https://github.com/fzyzcjy/dart_interactive
MIT License
147 stars 12 forks source link

Does dart interactive work in the browser? #80

Closed jlewi closed 1 year ago

jlewi commented 1 year ago

Does dart interactive work in the browser? My naive understanding is that dart_interactive relies on the Dart VM. IUC on the web Dart compiles to JS and doesn't rely on the Dart VM docs. Is there any path to creating a dart REPL on the web?

welcome[bot] commented 1 year ago

Hi! Thanks for opening your first issue here! :smile:

fzyzcjy commented 1 year ago

Yes I think so.

As for web, I guess it may be hard. For example, even flutter does not support hot reload on web https://github.com/flutter/flutter/issues/53041 . Maybe we can wait for that issue, and if that is supported maybe we have enough infra to implement it?

jlewi commented 1 year ago

@fzyzcjy Could you explain how you think this might work on the web? I think for this discussion we can ignore flutter. IUC dart on mobile/desktop relies on JIT and a VM which allows for a REPL. However, on web I believe dart is compiled to JS and then executed. Is there someway to run the dart VM on web?

fzyzcjy commented 1 year ago

@jlewi I have not heard of any. I am not sure, maybe we need to wait for new Dart features if possible?

fzyzcjy commented 1 year ago

The reason why I say wait for flutter is that, if flutter does that successfully, then it may mean that Dart supports vm on web, or dart provides a new infra, etc, then we can utilize it.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.