Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

refactor compiler's runtime libs #418

Closed
@jmesserly

Description

@jmesserly

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions