Open piux2 opened 1 year ago
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: https://github.com/gnolang/hackerspace/issues/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.
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. https://github.com/gnolang/gno/blob/7464b9493d78e737f368f07a43e4fb960a267aa8/gnovm/pkg/gnolang/precompile.go#L22 https://github.com/gnolang/gno/blob/7464b9493d78e737f368f07a43e4fb960a267aa8/gnovm/pkg/gnolang/precompile.go#L31
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:
Open for suggestions and comments.