Comments (7)
This bug exists because gnovm's "compilation" unit is a file and the Go compiler's compilation unit is a package.
If the dependency graph i wrote would be used, the ast' of all files within a package must be merged and then preprocessed.
After a conversation @jaekwon , we will wait for his evaluation of the problem and reach a conclusion if the graph would be used or not.
from gno.
This bug exists because gnovm's "compilation" unit is a file and the Go compiler's compilation unit is a package.
This is not true, predefineNow
is perfectly capable of resolving dependencies on names declared in other files.
from gno.
This bug exists because gnovm's "compilation" unit is a file and the Go compiler's compilation unit is a package.
This is not true,
predefineNow
is perfectly capable of resolving dependencies on names declared in other files.
this is not what i meant.
from gno.
This bug exists because gnovm's "compilation" unit is a file and the Go compiler's compilation unit is a package.
This is not true,
predefineNow
is perfectly capable of resolving dependencies on names declared in other files.
predefineNow
might be able to do many things but it doesn't change the fact that the unit of processing is a file.
from gno.
predefineNow
might be able to do many things but it doesn't change the fact that the unit of processing is a file.
By "unit of processing is a file", what I understand is that the implementation of the language is considering the individual file rather than the package, especially when resolving dependencies for names. The obvious example of a language that does this is C, which requires you to import header files for anything else you want to import.
Go, and Gno by extension, are not like this and will support referencing names within the same package. This is a feature of both languages that exists and is implemented; albeit the Gno implementation is undoubtedly still with many more bugs.
Of course, there is one notable exception and that is that package imports are scoped within the file they are declared. For this reason, it is still important for the implementation both in Go and in Gno to keep track of individual files, as they have different imports and as such can have different sets of "global" identifiers.
The fact that the GnoVM processes the package by iterating over each file is not behaviour specific to the GnoVM, inconsistent with what there is in Go. The Go implementation still very much works on individual files deep into the compiling process. Here's an example in the type checker, here's an example in the "noder" (converter to IR)
So, no, as far as I'm concerned, the problem is not architectural as you claim, ie. us having a "file" compilation unit while Go having a "package" compilation unit.
from gno.
predefineNow
might be able to do many things but it doesn't change the fact that the unit of processing is a file.By "unit of processing is a file", what I understand is that the implementation of the language is considering the individual file rather than the package, especially when resolving dependencies for names. The obvious example of a language that does this is C, which requires you to import header files for anything else you want to import.
Go, and Gno by extension, are not like this and will support referencing names within the same package. This is a feature of both languages that exists and is implemented; albeit the Gno implementation is undoubtedly still with many more bugs.
Of course, there is one notable exception and that is that package imports are scoped within the file they are declared. For this reason, it is still important for the implementation both in Go and in Gno to keep track of individual files, as they have different imports and as such can have different sets of "global" identifiers.
The fact that the GnoVM processes the package by iterating over each file is not behaviour specific to the GnoVM, inconsistent with what there is in Go. The Go implementation still very much works on individual files deep into the compiling process. Here's an example in the type checker, here's an example in the "noder" (converter to IR)
So, no, as far as I'm concerned, the problem is not architectural as you claim, ie. us having a "file" compilation unit while Go having a "package" compilation unit.
This is unralated in 2 different ways, at least.
We are not talking about type checking or code generation and my original comment should be taken into the context of the way my PR solves the problem of the issue.
Since you opened this issue and seem to disagree with that solution, i've assigned it to you.
from gno.
predefineNow
might be able to do many things but it doesn't change the fact that the unit of processing is a file.By "unit of processing is a file", what I understand is that the implementation of the language is considering the individual file rather than the package, especially when resolving dependencies for names. The obvious example of a language that does this is C, which requires you to import header files for anything else you want to import.
Go, and Gno by extension, are not like this and will support referencing names within the same package. This is a feature of both languages that exists and is implemented; albeit the Gno implementation is undoubtedly still with many more bugs.
Of course, there is one notable exception and that is that package imports are scoped within the file they are declared. For this reason, it is still important for the implementation both in Go and in Gno to keep track of individual files, as they have different imports and as such can have different sets of "global" identifiers.
The fact that the GnoVM processes the package by iterating over each file is not behaviour specific to the GnoVM, inconsistent with what there is in Go. The Go implementation still very much works on individual files deep into the compiling process. Here's an example in the type checker, here's an example in the "noder" (converter to IR)
So, no, as far as I'm concerned, the problem is not architectural as you claim, ie. us having a "file" compilation unit while Go having a "package" compilation unit.
this is where all package level variables are collected.
// Compute the object dependency graph and initialize
// a priority queue with the list of graph nodes.
pq := nodeQueue(dependencyGraph(check.objMap))
from gno.
Related Issues (20)
- [Discussion/Request] Add a way to catch emitted events in `gno test`
- `Time.Now()` always return initial UNIX time HOT 2
- [gnokey] Make `gnokey query` more convenient HOT 1
- main README should disambiguate with gnosis project
- Oracle VRF HOT 2
- out of gas error is unclear `(VM call panic {WritePerByte})` HOT 1
- Incompatibility of `gnoland secrets init` with Read-Only mounted k8s Secrets
- [GnoVM] `TestSetRealm` not working properly in `gno test`
- contribs/gnokeykc has only tm2 features (missing thinkgs like maketx addpkg)
- RFC(gnovm): make all gno unit tests independent (and parallel)
- Validators cannot discover P2P peers when running as `StatefulSet` in k8s HOT 4
- [gnoland] Add `namespace` RPC endpoint HOT 2
- bug(gnovm): incorrect type comparison HOT 3
- Add/append balances and txs when genesis exists
- [docs] Update outdated images & gifs
- CI issue about contribs/ is only triggered after PR merges HOT 1
- Is it possible to have a dedicated CI error when it's just Codecov?
- Bug recently introduced makes `gno-js`'s `provider.evaluateExpression` timeout HOT 2
- Clarify allowed files and extensions when adding a package
- gnoclient does not show the full HTTP response HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gno.