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

Improve file structure and crate name #165

Closed
webmaster128 opened this issue Mar 18, 2020 · 3 comments · Fixed by #182
Closed

Improve file structure and crate name #165

webmaster128 opened this issue Mar 18, 2020 · 3 comments · Fixed by #182
Assignees

Comments

@webmaster128
Copy link
Member

Right now we have two main crates cosmwasm and cosmwasm_vm with cosmwasm_vm depends on cosmwasm. However, the file structure does not reflect that very well, since cosmwasm_vm is in a subfolder ./lib/vm of cosmwasm (which is in .), which suggests the VM is part of cosmwasm.

Also the name cosmwasm does not specify what the crate actually does. It is somewhat everywhere but I find it hard to reason about what belongs in there.

To improve this situation, I suggest 2 changes:

  1. Separate the workspace root Cargo.toml from the cosmwasm crate's Cargo.toml by moving the package into ./lib/std, next to the VM.
  2. Rename the crate cosmwasm to cosmwasm_std, as it is the standard library that is available for development inside of contracts. This should make clear that everything that is not required for contract development does not belong here.

The first step can be considered compatible I guess. The second one could be scheduled for 0.8.

@ethanfrey
Copy link
Member

Sounds good.

Yes, please do (1) on master, keeping same release name, so there are less merge issues with 0.8.

Then you can start a 0.8 branch and do (2)

@webmaster128
Copy link
Member Author

I was thinking of using cosmwasm_std and cosmwasm_vm instead of the hyphen separated variant, as it would give us the same spelling in the crate name as well as the import. Unfortunately it is not possible to rename the existing cosmwasm_vm to cosmwasm-vm on crates.io.

I guess we stick with hyphens consistently as long as the renameing is not supported.

@ethanfrey
Copy link
Member

The standard in rust is to prefer foo-bar in the crate names while publishing.
This is auto-converted to foo_bar in imports.

I'd stick with this as it fits with the aesthetics of the rust community.

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 a pull request may close this issue.

2 participants