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

Comments that do not survive deploy; or, pre-processor scripts #1041

Closed
MarvinJanssen opened this issue Jun 8, 2023 · 2 comments
Closed
Assignees
Milestone

Comments

@MarvinJanssen
Copy link

Some of us have been sparse in adding comments in the sBTC contracts because of a "worry" that heavily commenting the code will in the end lead to increased read_count costs. (I know, premature optimisation.) Still, it got us talking about types of comments that would not survive a deploy. If something like that existed then we could be a lot more generous with comments and take a more "literate programming" approach to describing the intent of routines that are useful during development but not once deployed.

We thought about some ways, for example comments that are prefixed by thee semi-colons ;;; could be filtered out. Although that could probably affect existing code bases, so perhaps a different suggestion would be needed.

;; This comment will be part of deployment
;;; This comment won't be.

Thoughts? Does it make sense to have a feature such as this in Clarinet? Or would it be possible to run a pre-deployment TS script in which we can filter such comments?

@hugocaillard
Copy link
Collaborator

I think we could make it part of this SIP stacksgov/sips#32
Which is definitely something we want to work on in the clarinet team.

And the SIP could be something like "Special comments in Clarity" (idk if there's a technical term for that). Including:

  • contract documentation comments
  • filtered out comment

We have to be careful with the syntax. I was thinking it would make sense to have the ;;; for the "documentation comments (just like JSDoc uses /**).

@MarvinJanssen Does it make sense to you to include it in the SIP? Could you add a comment over there and we'll close this PR?

Thanks!

(Note: and even if the SIP is not approved or definitive in the next quarters, clarinet could still benefit from this proposals)

Could you add a comment here

@hugocaillard hugocaillard moved this from 🆕 New to 🏗 In progress in DevTools Jun 21, 2023
@smcclellan smcclellan added this to the Q2-2023 milestone Jun 21, 2023
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in DevTools Jun 27, 2023
@hugocaillard
Copy link
Collaborator

Hey @MarvinJanssen , have you seen my previous comment?
I'll close this one, feel free to add a comment on stacksgov/sips#32 or re-open this on if you think it's more relevant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants