-
Notifications
You must be signed in to change notification settings - Fork 26
Write all of the runtime in Dart. #310
Comments
Started experimenting in branch passthrough-js-interop. |
yeah, the methods that take rest arguments are a problem. @jacob314 @vsmenon any thoughts on how we can encode it in such a way DDC understands? Other than that, do we need anything other than the existing "JS" builtin? dart2js implements the SDK with it, so it should be pretty powerful. edit: and we also have Jacob's interop which allows "direct" calls to JS members. So we might be able to use that as well. |
oh, we also need a way to get DDC to stop emitting type assertions around JS builtin expressions. Either fixing how we parse the type strings, or just trusting them and allow it to be assigned to any type. |
Regarding rest params, seems like an ad-hoc annotation such as Note that That is, for instance, Regarding what to start with:
(side-note: |
@ochafik -- do you mind moving your checklist into the first message, or do you mind if I do it? GitHub has some special UI magic for checklists, but it only seems to kick in if they're in the initial bug report comment :) |
Some support for rest parameters would be very helpful for JS interop in general. This is one of the of edge cases we have to hack around today. |
@jacob314 I'm toying with a |
I'm open to adding '''@VarArgs''' to package:js with the other js interop specific annotations. |
@jacob314 Cool! Filed dart-lang/sdk#24623 to track :-) |
Prepare for writing all the runtime in Dart: - Move js runtime files to lib/runtime/dart (dart_runtime.js -> dart/_runtime.js), - Use rest params instead of arguments slicing in a couple of places. BUG=#310 [email protected] Review URL: https://codereview.chromium.org/1413683006 .
Note: need new package:js release before merging this in (dart-lang/sdk#24623). Maybe it's time to think again about sneaking JsName + JsPeerInterface into it? (#135) BUG=#310 [email protected] Review URL: https://codereview.chromium.org/1424133007 .
To match Dart style: https://www.dartlang.org/effective-dart/style/#do-use-curly-braces-for-all-flow-control-structures (also, that's the style we use in our .js runtime files, so that will help with diffs of the js->dart runtime migration from #310) BUG= [email protected] Review URL: https://codereview.chromium.org/1524843002 .
The following part files were ported from the original .js (lib/runtime/dart/_foo.js -> input_sdk/private/foo.dart): - input_sdk/private/rtti.dart - input_sdk/private/types.dart - input_sdk/private/classes.dart - input_sdk/private/errors.dart - input_sdk/private/generators.dart - input_sdk/private/operations.dart - input_sdk/private/runtime.dart Notes: - Introduced genericTypeConstructor intrinsic: `JS('', '#(type)', genericTypeConstructor(List))` generates `core.List$(type)` - Used new JS quasiquotes everywhere - Depends on new internal `@JSExportName` annotation to alias symbols like dart.{as, is, const, assert, export, implements, throw, async, dynamic, void} (see https://codereview.chromium.org/1580413002/) BUG= [email protected] Review URL: https://codereview.chromium.org/1530563003 .
🎉 |
Prepare for writing all the runtime in Dart: - Move js runtime files to lib/runtime/dart (dart_runtime.js -> dart/_runtime.js), - Use rest params instead of arguments slicing in a couple of places. BUG=dart-archive/dev_compiler#310 [email protected] Review URL: https://codereview.chromium.org/1413683006 .
Note: need new package:js release before merging this in (#24623). Maybe it's time to think again about sneaking JsName + JsPeerInterface into it? (dart-archive/dev_compiler#135) BUG=dart-archive/dev_compiler#310 [email protected] Review URL: https://codereview.chromium.org/1424133007 .
To match Dart style: https://www.dartlang.org/effective-dart/style/#do-use-curly-braces-for-all-flow-control-structures (also, that's the style we use in our .js runtime files, so that will help with diffs of the js->dart runtime migration from dart-archive/dev_compiler#310) BUG= [email protected] Review URL: https://codereview.chromium.org/1524843002 .
The following part files were ported from the original .js (lib/runtime/dart/_foo.js -> input_sdk/private/foo.dart): - input_sdk/private/rtti.dart - input_sdk/private/types.dart - input_sdk/private/classes.dart - input_sdk/private/errors.dart - input_sdk/private/generators.dart - input_sdk/private/operations.dart - input_sdk/private/runtime.dart Notes: - Introduced genericTypeConstructor intrinsic: `JS('', '#(type)', genericTypeConstructor(List))` generates `core.List$(type)` - Used new JS quasiquotes everywhere - Depends on new internal `@JSExportName` annotation to alias symbols like dart.{as, is, const, assert, export, implements, throw, async, dynamic, void} (see https://codereview.chromium.org/1580413002/) BUG= [email protected] Review URL: https://codereview.chromium.org/1530563003 .
This would help with:
Note that this would imply changing the signature of a couple of vararg functions (
dart.mixin
,dart.fn
...).There are a couple of files that need translation as they produce modules:
The following helper file needs to be converted to a module:
dart_utils.js
(d91add0)Then the following file is used to support the current module system, so we might not want to translate them:
The text was updated successfully, but these errors were encountered: