Skip to content

Consider embedding Go standard library into GopherJS binary. #672

Closed
@dmitshur

Description

@dmitshur

This issue is to discuss a potential idea and figure out if it's good or not.

Right now, GopherJS relies on the user's installed copy of Go to access the Go standard library and tests.

Another property of GopherJS is that it supports exactly one version of Go at a time - the current version. It doesn't work with a newer version, because there's no support for changes. It doesn't work with older versions, because certain things it needs may be missing there.

We could consider embedding the entire Go standard library to make gopherjs binary more independent.

This has the following tradeoffs.

Current Approach

  • Nothing to do to stay as is. Less implementation time/effort.
  • Smaller GopherJS binary, faster compilation of the gopherjs binary.
  • Probably easier development of GopherJS, less overhead.
  • Consistent results/behavior with the native Go compiler, because the versions are guaranteed to be in sync.
  • TODO: List the rest.

Alternative Approach

  • Costs implementation time/effort.
  • A working copy of gopherjs binary no longer stops working when user updates to newer version of Go.
  • Larger binary, slower compilation of gopherjs binary.
  • Potentially more control over standard library files.
  • TODO: List the rest.

At this point, I don't know if it's worth doing this. First step is to keep adding to advantages/disadvantages above until we have a complete picture, then we can make a more informed decision.

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