Skip to content

Add initial support for Go 1.5. #249

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
wants to merge 1 commit into from
Closed

Add initial support for Go 1.5. #249

wants to merge 1 commit into from

Conversation

dmitshur
Copy link
Member

@dmitshur dmitshur commented Jul 9, 2015

  • Add time.loadLocation to natives.
  • Add runtime.Version to natives.
  • Add pprof.StartTrace, pprof.StopTrace to natives.

These are changes I had to make to GopherJS to get it to be able to compile a few simple and medium sized Go packages, using Go version go1.5beta1.

I'm not very familiar with how natives works, and why it seems some funcs are provided while others are missing (I'd love to learn more about it), so this may not be entirely correct, but I hope it's helpful as an initial start. After making these changes, everything seemed to work great so far.

This should not be merged into master branch until Go 1.5 final version is officially released. Making this PR for visibility, to run CI, and because I can't make a PR into a non-existing branch (master is the only choice).

Add time.loadLocation to natives.

Add runtime.Version to natives.

Add pprof.StartTrace, pprof.StopTrace to natives.
@dmitshur
Copy link
Member Author

dmitshur commented Jul 9, 2015

Despite it working okay on the packages I've tested (no errors, things worked), there are quite a few failing tests in CI.

They seem to be related primarily to:

  • Error: Native function not implemented: os.runtime_beforeExit
  • Error: Native function not implemented: reflect.typedmemmove

@cryptix
Copy link

cryptix commented Jul 9, 2015

Very nice!

Wouldn't it be super crazy awesome if we could hook up the tracing into web developer tools that support similar tracing? Not sure if there are browser APIs for this, just typing out loud.

@dmitshur
Copy link
Member Author

dmitshur commented Jul 9, 2015

Wouldn't it be super crazy awesome if we could hook up the tracing into web developer tools that support similar tracing? Not sure if there are browser APIs for this, just typing out loud.

Yes! I think that might fall out of scope of this PR (depending on if it's trivial to do, or needs some investigation and work), but it can be a followup enhancement.

Note that GopherJS already taps into the JavaScript debugger for its implementation of runtime.Breadkpoint, so this is definitely in the realm of doable and a good idea.

@dmitshur
Copy link
Member Author

Closing this PR as it has been merged onto go1.5 branch in this repository, which is where Go 1.5 support will continue to be worked on.

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

Successfully merging this pull request may close these issues.

2 participants