Skip to content

implements namedBin for the declarative parser #1365

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jmgomez
Copy link
Collaborator

@jmgomez jmgomez commented Mar 12, 2025

No description provided.

@@ -56,6 +56,24 @@ proc extractFeatures(featureNode: PNode, conf: ConfigRef, hasErrors: var bool):
extractRequires(stmt, conf, requires, hasErrors)
result.add requires

proc extractTableLiteral(n: PNode, conf: ConfigRef): Table[string, string] =
## Extracts a table literal of the form {"key": "value"} or {"key": "value"}.toTable()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that's terrible. Instead only allow:

namedBin      = {
  "features_deps": "features_deps"
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats allowed too, but not allowing toTable() would break when parsing the file with the vm

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How so? is namedBin an existing feature? Never heard of it...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the existing Nimble require the toTable? If not, don't support it and make the Nimbus people update their nimble file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's no circular dep though .

There is nimble specific code in the nim compiler no?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is nimble specific code in the nim compiler no?

there's an agreement between the two to look in some nimble folders, but I think the best thing that can happen is that this code is removed in favor of nimble declaring to nim (via nimble setup) what it should do. ie whatever is there, is fairly contained and minimal

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took a month long painstaking process to rip Nimble off the Nim compiler dependency for it used to import the Nim compiler as a library for Nimble evaluation. We won't go back to that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didnt know that but as you know the compiler is used in the new parser anyways. Right now we have the bad parts of both worlds: the evaluation happens with an arbitrary nim different than the selected which we cant control. Maybe when the declarative parser is the new default we could workaround it by first selecting nim

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the parser is a whole different story than using Nim's VM. The parser's API is stable and small, the VM's is messy and it keeps us from replacing it with a better one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants