Skip to content

refactor compiler's runtime libs #27316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jmesserly opened this issue Sep 13, 2016 · 1 comment
Closed

refactor compiler's runtime libs #27316

jmesserly opened this issue Sep 13, 2016 · 1 comment

Comments

@jmesserly
Copy link

From @jmesserly on January 21, 2016 19:57

We inherited the runtime lib from dart2js (mostly, with some async support taken from the VM libs). Then we added some hand written JS. That unfortunately grew into a much larger set of required library code, was split up into JS "modules" and is now merged back into a single dart:_runtime library.

Things we should try and improve:
Restructure helpers libs that came from dart2js. The organization of these doesn't make sense in DDC. e.g. some libraries have very little of their original code left.

Restructure dart:_runtime. It has a somewhat tangled relationship with dart:core, as dart:core defines some important primitives (Object, Type). See #417 for one example, but looking through js_codegen, there are others.

Letting the compiler generate a single JS file for all of the transitive closure of dart:core might be a good start on the path towards sanity.

dart:_runtime is now ostensibly written in Dart, but that's a very shallow property. It doesn't use Dart for the most part. There are things like final fields that are initialized to a JS expression that makes an ES6 class. That should just be a Dart class.

Those are a few ideas to start, but I'm sure we'll find more over time.

Copied from original issue: dart-archive/dev_compiler#418

@jmesserly
Copy link
Author

A lot of things have been improved here, going to close this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant