-
Notifications
You must be signed in to change notification settings - Fork 192
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
compiler
dependency does not give access to compiler
#1166
Comments
Related to #1163 |
Should we treat it as a some sort of "special" package? As far as I can tell is defined as: {
"name": "compiler",
"alias": "nim"
}, Without knowing much about nimble, all I can say is either we expand the definition or we treat |
Nimble is translating that to the Which when using either Being able to access the "compiler" as a source itself should really only be necessary if you need a version separate from the compiler you are using. Since imports can reference the compiler with We could either package the compiler source as a standalone repo that would be importable with
But the current But if we change it to version = "0.1.0"
author = "Daylin Morgan"
description = "A new awesome nimble package"
license = "MIT"
srcDir = "src"
bin = @["dummy"]
requires "nim >= 2.0.2"
requires "https://github.com/daylinmorgan/nim?subdir=compiler#compiler-nimble-fix"
import compiler/ast
when isMainModule:
echo("Hello, World!") So if we make a PR to |
preferably no - the majority of the code therein can be reasoned about as if it were a package like any other.
there's no particular reason to treat the majority of code in the compiler in any special way. iff the compiler needs to have a version constraint on the standard library for whatever reason, it should express that constraint in its declaration of requirements, and those parts should ideally be separated into their own package (nim-lang-core or whatever). It is not a given that I want the same version of compiler as the source code is being compiled with - ie if I want to access the source code parser of the compiler as it worked in nim 1.6, I should (ideally) be able to access that version regardless of which nim version I'm using to compile my application. The This follows from a much broader point: the code in the compiler is / can be treated as a "library" and follow the rules of any other library (and just like some libraries come with "supporting binaries", so can the The same applies to the standard library: it is just one more nim library and large parts of it need no special version of the language (broadly this is also true because most of the standard library is unmaintained / obsolete / stable and doesn't change from nim version to version). Where this leads, in terms of long-term planning:
With the above long-term picture in mind, where this leads, in terms of this bug report in particular:
That limited feature set is compatible with the more modern approach from above and already brings benefits. |
What about adding a |
that's what I would expect nimble to do when I say |
I mean, right now {
"name": "compiler",
"alias": "nim"
}, Im referring to expand the nimble functionality so when defined like so: {
"name": "compiler",
"alias": "nim"
"paths": ["./compiler"]
}
it will expand it in the |
oh - didn't know about that, no idea - intuitively feels like a hack that might bridge the gap until a proper solution is found (that treats the compiler as a separate package on its own - notably, this might require more .. surgery) |
.nimble:
nimble.paths:
notably, compiler path is missing (
compiler/
is not part ofnim
standard paths)The text was updated successfully, but these errors were encountered: