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

RFC: move gnovm/pkg/gnolang/precompile.go out of pkg/gnolang/ #1054

Open
piux2 opened this issue Aug 16, 2023 · 1 comment
Open

RFC: move gnovm/pkg/gnolang/precompile.go out of pkg/gnolang/ #1054

piux2 opened this issue Aug 16, 2023 · 1 comment

Comments

@piux2
Copy link
Contributor

piux2 commented Aug 16, 2023

Description

we might want to move gnovm/pkg/gnolang/precompile.go out of gnovm/pkg/gnolang/

For following reasons:

  • precomplie is part of off chain tools for devs to validate the gno files by leveraging local go build tool chains before we upload files to gno.land chain. these are not part of the language specs

  • gnovm code should not depends on gno.land configurations.


    var stdlibWhitelist = []string{

  • Above const and vars do not determine gno.land chain settings, nor language specs. They merely need to match with a specific version of deployed gno.land chain either locally or remotely, so that we can accurately validate gno files against a specific chain run time.

Proposal:

  • Put precompile.go in something like gnovm/pkg/tools , move chain specific information and lib list to a config file so that people can use it as a template when they fork gno or migrate gno to other chains.
  • A feature in a separate RFC: gno.land chain publishes these settings.
  • A separate RFC: combine gno precompile and build as a validation tool to avoid confusion, since we only leverage go build tool chains to validate gno files, syntax, import paths and injected native method signatures. The binary out of precompiled gen.go and the building process serves no purpose.

Open for suggestions and comments.

@moul
Copy link
Member

moul commented Aug 17, 2023

The path gnovm/pkg/tools isn't clear in my opinion.

To make it clearer, I suggest moving it to gnovm/cmd/gno/precompile.go, gnovm/cmd/gno/internal/precompile.go, or gnovm/pkg/precompile.

Also, it's worth noting that we might use it for GnoffeeScript later. Check this: gnolang/hackerspace#22.


My opinion: I think we should move to cmd/gno/internal/precompile.go for now. We can decide where to put it for wider use later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔵 Not Needed for Launch
Development

No branches or pull requests

2 participants