Giter Site home page Giter Site logo

gnoland/gnovm: purify `p/` even more about gno HOT 5 OPEN

moul avatar moul commented on June 18, 2024 1
gnoland/gnovm: purify `p/` even more

from gno.

Comments (5)

leohhhn avatar leohhhn commented on June 18, 2024 1

On top of this, we should disable direct calls to Gno stdlibs via maketx call (refrence comment).

@moul, I think its okay that p/ has top-level variables such as constants, since these can be useful. This is currently possible - read about it in this issue.

Closing #2224 in favor of this.

from gno.

ltzmaxwell avatar ltzmaxwell commented on June 18, 2024

@moul, I think its okay that p/ has top-level variables such as constants, since these can be useful. This is currently possible - read about it in #1538.

I think that p/ should be OK to contain package-level variables.

While the following is off-topic:

It's peculiar that you need to constantly remember that this is a p/ and that the variable isn't meant to be persisted, similar to how you must be mindful that it will be persisted when working within a Realm (comment in packages in r/). All these rules are implicit, which can be confusing.

from gno.

moul avatar moul commented on June 18, 2024

For p/, package-level constants are allowed, but variables/state that can change are not. The Go linter should prohibit this.

Do you have examples of package-level variables that would make sense?

from gno.

ltzmaxwell avatar ltzmaxwell commented on June 18, 2024

I mean something like this:

errXXX := errors.New("a common error shares within packages").

var ErrLimit = errors.New("flowrate: flow rate limit exceeded")

but of course, we actually don't want to modify it.

from gno.

leohhhn avatar leohhhn commented on June 18, 2024

Prohibit the use of maketx call with a p/ entrypoint.

Completed in #2242. We could make the error a bit more informative: invalid package path

from gno.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.