Skip to content
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

WIP: Reflection #104

Merged
merged 12 commits into from Feb 5, 2019
Merged

WIP: Reflection #104

merged 12 commits into from Feb 5, 2019

Conversation

aykevl
Copy link
Member

@aykevl aykevl commented Dec 12, 2018

No description provided.

@deadprogram
Copy link
Member

Seems like this branch is possibly complete enough to merge in. It does have its own tests, and it passes the other tests.

It needs another update to bring it in line with the current master but after that, perhaps it should be landed.

This should also be accompanied with some documentation somewhere about the state of the reflection feature, and what is still missing.

@aykevl what do you think?

@aykevl
Copy link
Member Author

aykevl commented Jan 16, 2019

Yeah I think this could be merged. I've intentionally kept it so that it can be merged at each point.
Of course, it's far from complete, and some parts of it might need to be redesigned. For example, there is no support for structs or named types, which are perhaps the most useful feature of reflection.

EDIT: rebased on top of current master.

Some instructions emitted by LLVM (like movaps) expect 16-byte
alignment, while the allocator assumed that 8-byte alignment is good
enough.

TODO: this issue came to light with LLVM optimizing a complex128 store
to the movaps instruction, which must be aligned. It looks like this
means that the <2 x double> IR type is actually 16-byte aligned instead
of 8-byte like a double. If this is the case, the alignment of complex
numbers needs to be updated in the whole compiler.
This commit makes sure all Go types can be encoded in the interface type
code, so that Type.Kind() always returns a proper type kind for any
non-nil interface.
@aykevl aykevl force-pushed the reflect branch 2 times, most recently from d0cb8be to 81ef4c4 Compare January 20, 2019 22:21
@deadprogram
Copy link
Member

Now merging into dev branch for integration. Great work on this @aykevl

@deadprogram deadprogram merged commit d7d60af into dev Feb 5, 2019
@deadprogram deadprogram deleted the reflect branch February 5, 2019 16:05
@deadprogram deadprogram restored the reflect branch February 5, 2019 16:05
@han2015
Copy link

han2015 commented Jul 1, 2019

HI @aykevl

Many packages, especially in the standard library, rely on reflection to work.

This branch have been merged, that means we can use more standard libraries now?
about doc, It's more friendly if add the supported packages list in doc.

@aykevl
Copy link
Member Author

aykevl commented Jul 1, 2019

This branch have been merged, that means we can use more standard libraries now?

Yes. For example, this was necessary to support the fmt package.

about doc, It's more friendly if add the supported packages list in doc.

That's indeed on the todo list. It should be autogenerated so it can easily be updated.

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.

None yet

3 participants