Moving Clarity to its own repo #3875
Replies: 5 comments 7 replies
-
Thanks Cyle! I agree, this would be very helpful for development and testing of Clarity. |
Beta Was this translation helpful? Give feedback.
-
I think Clarity should stay in the |
Beta Was this translation helpful? Give feedback.
-
In my opinion, repository choice primarily impacts the following:
Notice, I don't think that it really impacts code architecture. I know that all of the components in the Thinking through the above, though, I don't think item 1 is really relevant -- a new clarity repo would presumably be in Now, for items 2-4, there may be something worth thinking about. Clarity and the rest of the stacks-blockchain do not obviously need to share a CI. Today, this isn't really much of an issue, because like the workspace member discussion, there really isn't a practical limit to how independently clarity can be tested with the same top-level github action workflows as the rest of the stacks-blockchain. Release management and branch protection may have more benefits, though. Thinking about release management, clarity already produces an independent library on crates.io, but that seems kind of painful in the current repo setup (https://crates.io/crates/clarity-vm) -- maybe folks who have worked with getting those releases built can speak more to that (@obycode). But, it does seem at least doable for releases on crates.io to work even in the current setup (and could probably be made easier even with clarity remaining this repo). Where releases really just cannot be done is through github releases -- clarity cannot have its own releases there in a way that makes sense. I'm kind of ambivalent about this because I'm not sure how much that matters. Branch protection is maybe the most important issue here: for the stacks-blockchain repo, there's a pretty heavy PR process, and for good reason. Development for clarity on its own does not necessarily need to share this review process. The stacks-blockchain repo would apply its review process to clarity changes with a PR that updated its linked clarity version. Honestly, I'm conflicted here. Clarity is really fundamental to the stacks-blockchain in a way that no other dependency could be -- an update to the clarity version is super impactful to the stacks-blockchain, and waiting until the last moment to initiate a heavy review process would likely mean that the review process would be unsatisfactory. But on the other hand, maybe that just means that the review process in Clarity development should be rigorous enough to make that less of a burden in the end. Anyways, this got kind of long and rambley, but I think my point is that a new repo probably won't make much of a difference in any event -- it would probably just be a lot of work to set up a new set of github actions, top-level files, etc., and the actual benefit of cleaning up interfaces could just be done in the current setup instead. Improvements to release management would probably be worthwhile, but I think they can also work within a single repo. If you're concerned that you want to maintain a clarity "mainline" independent of the |
Beta Was this translation helpful? Give feedback.
-
So, in general @jcnelson I do agree with you that modularity "for the sake of", or "premature modularization" usually entails more complexity than it's worth. However, in this case, I do see a clear domain boundary between blockchain and Clarity, though as you guys have been in on it's not as clear code-wise today as it could be. The monorepo vs. multi-repo has been debated in hundreds of articles over the years and in the end comes down to preference. I personally (having come originally from svn+monorepo) have learned to embrace smaller, module-oriented repos primarily from a versioning+CI/CD perspective, but also from an access control perspective, which @kantai brought up above. Clarity today has external projects dependent on its crate (e.g. Clarinet, which uses a newer version than stacks blockchain), which is something that "speaks to me" that it should be its own repo, with its own CI, releases and dependents can pin to the version they feel comfortable with. I don't see why the review process for Clarity would need to be any less rigorous than that of the blockchain core, or performed by different people - it's the same code, just in a different place, so it doesn't require all that much more effort. I am as OP of course in-favor of working towards Clarity living in its own repo (under stacks-network of course). If we were only talking about one project then I probably wouldn't have the same view, but as we're looking at multiple crates being introduced it would feel better if these were in a clarity-centric repo vs. "on-the-side". Note that here I'm advocating for a clarity-monorepo ;) |
Beta Was this translation helpful? Give feedback.
-
Having read @kantai's reply, I'm even more inclined to keep Clarity as a crate within
Be that as it may, the "true" version of Clarity is always the one that ships with Stacks. If Clarinet's fork of Clarity (or any fork for that matter) behaves differently than Clarity-in-Stacks, then it's treated as a bug in the fork. This would be true regardless of where Clarity lived.
May I ask what specific problem you are trying to solve by doing so, which cannot be solved by continuing to allow Clarity to live in the |
Beta Was this translation helpful? Give feedback.
-
While implementing WASM for clarity it has become relatively clear for those of us working with it that "clarity" would be best served if it were to be extracted to its own repository to clearly separate the development of the clarity language/parsers/runtimes from that of the stacks blockchain itself.
This suggestion entails creating a new
clarity
repository within thestacks-blockchain
org containing the following crates:clarity
crate, in other words, with some subsets of code extracted to separate modular crates as listed below.Such a move would allow the blockchain to maintain a pinned version of clarity + parser + runtime while the development of Clarity and related continues, while also allowing smaller improvements in individual crates to be adopted by the blockchain/clarinet individually.
Not to mention testing which would become more isolated and to-the-point.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions