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

Add primitive types to molecule for syntax = 2 #62

Closed

Conversation

eval-exec
Copy link
Collaborator

@eval-exec eval-exec commented Jan 11, 2023

This PR want to add uint{8,16,32,64},int{8,16,32,64} and bool as primitive types for syntax = 2.

This PR want to close #57 , and commit changes are based on syntax version feature #64

Implementation detail:

  1. add a new crate: molecule-std, it's build.rs will generate a primitive_types.rs file from primitive_types.mol
  2. molecule-std provide a with-primmitive-types feature (default is disabled ). When with-primitive-types feature is disabled, molecule-std act as same as molecule, because molecule-std has same module tree structure as molecule, when with-primitive-types feature is enabled, it will load primitive_types.rs, then user will import Uint64/Int32 from molecule-std

Todo:

  • Implement codegen to expand primitive types when syntax = 2
  • Add tests

@yangby-cryptape yangby-cryptape self-assigned this Jan 11, 2023
@yangby-cryptape

This comment was marked as resolved.

@eval-exec

This comment was marked as resolved.

@yangby-cryptape

This comment was marked as resolved.

@eval-exec

This comment was marked as resolved.

@eval-exec eval-exec force-pushed the feat/primitive-types branch 2 times, most recently from e4b0d25 to 9f09b51 Compare January 11, 2023 11:04
@eval-exec

This comment was marked as resolved.

@eval-exec eval-exec force-pushed the feat/primitive-types branch 5 times, most recently from 6c4c247 to 6feff57 Compare January 11, 2023 13:22
@eval-exec

This comment was marked as resolved.

@yangby-cryptape

This comment was marked as resolved.

@eval-exec

This comment was marked as resolved.

@yangby-cryptape

This comment was marked as resolved.

@yangby-cryptape

This comment was marked as off-topic.

@eval-exec eval-exec force-pushed the feat/primitive-types branch 5 times, most recently from a58bf91 to a08682a Compare January 12, 2023 05:55
std/primitive_types.mol Outdated Show resolved Hide resolved
tools/codegen/src/ast/verified/mod.rs Outdated Show resolved Hide resolved
@eval-exec eval-exec force-pushed the feat/primitive-types branch 6 times, most recently from 0eb7f74 to a0bdf01 Compare January 12, 2023 11:34
@eval-exec

This comment was marked as resolved.

@yangby-cryptape

This comment was marked as resolved.

@eval-exec eval-exec force-pushed the feat/primitive-types branch 2 times, most recently from a980a89 to ac0aeb8 Compare January 16, 2023 02:00
@yangby-cryptape
Copy link
Collaborator

yangby-cryptape commented Jan 16, 2023

LGTM! I haven't found any obvious issues.

So, Could you mark this PR to "ready for review" state?

It seems that if it is a draft, I have to approve it for running tests every time after you push updates.
But I couldn't do that on time every time.

If all tests are passed, I will approve it.


TODOs before released a new version, after this PR merged:

This PR requires two types of tests:

  • With primitive types.
  • Without primitive types.

You can reference the tests for no-std and std features.

@eval-exec eval-exec marked this pull request as ready for review January 16, 2023 02:25
@eval-exec eval-exec closed this Jan 16, 2023
@eval-exec eval-exec reopened this Jan 16, 2023
@eval-exec
Copy link
Collaborator Author

Update: This PR should be rebased on #64 (syntax version feature)

@eval-exec eval-exec changed the title [Draft] An attempt to add primitive types to molecule Add primitive types to molecule for syntax_version = 2 Mar 22, 2023
@eval-exec eval-exec changed the title Add primitive types to molecule for syntax_version = 2 Add primitive types to molecule for syntax = 2 Mar 22, 2023
@eval-exec
Copy link
Collaborator Author

eval-exec commented Mar 22, 2023

Todo:

  • Implement codegen to expand primitive types when syntax = 2
  • Add tests

@eval-exec eval-exec marked this pull request as draft March 22, 2023 05:23
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.

Support Primitive Integer Types in Molecule
2 participants