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

deserialize_meta won't union properly #34

kanghyojun opened this Issue Sep 17, 2016 · 1 comment


None yet
3 participants

This comment has been minimized.


dahlia commented Sep 18, 2016

@admire93 Although PR #35 fixed it to work, we need to refactor the generated code to be conciser and more efficient than now.

  • The compiler should generate __nirum_type__ = 'union' # or 'record'/'tag'/'enum'/'boxed' so that the runtime can determine what Nirum type the given Python class is generated from.
  • Also, the compiler should generate __nirum_tag_classes__ = {Tag.tag_name: TagName, ...} so that the runtime can lookup the corresponding Python class by the given tag name in O(1). The current implementation loops over cls.__subclasses__() which is O(n).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment