-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
clarify that the Nix language is not called "Nix expressions" #13409
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
base: master
Are you sure you want to change the base?
Conversation
@@ -102,8 +102,9 @@ a currently running program. | |||
|
|||
## Functional package language | |||
|
|||
Packages are built from _Nix expressions_, which is a simple | |||
functional language. A Nix expression describes everything that goes | |||
Packages are built from expressions in Nix, which is a simple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is more readable, since it immediately raises the question "what are expressions?" or "what expressions?"
Might be better to say something like
In Nix, the package build graph is described using a simple functional language. Programs in this language are called Nix expressions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so programs written in Nix are called Nix expressions. I though expression really just meant the functional programming / programming language term, expression. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will think about this a bit, because I find it a bit surprising that the programs are called expressions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason is that a .nix file is an expression at top-level. Unlike most languages there is no top-level module syntax (e.g. a list of declarations).
While I would love to get rid of the term "Nix expression" and just call it the Nix language, the CLI today does refer to "Nix expressions" everywhere. So getting rid of that terminology is a much bigger job than 2 lines in the intro. |
@@ -102,8 +102,9 @@ a currently running program. | |||
|
|||
## Functional package language | |||
|
|||
Packages are built from _Nix expressions_, which is a simple | |||
functional language. A Nix expression describes everything that goes | |||
Packages are built from expressions in Nix, which is a simple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lix's style guide calls the language "Nix language" and I see no harm in being consistent with it.
I would write this sentence as "Packages are built from expressions in the Nix language, which is a simple functional language.
The next sentence in here is also .. kind of weird. I guess it's trying to say that "a derivation is fully described by a single nix expression", but adding emphasis there is sort of confusing as well, since it makes it sound like nix expression is a glossary term. Maybe it is? I'm not familiar with the modern style guide efforts in the orig-Nix project.
Motivation
I had a student come by with a first draft of his thesis, and in it he referred to the Nix language as Nix expressions.
Context
The student showed me how he arrived at that conclusion by reading the introduction of the Nix manual.
If you're not aware of expression as an FP term and don't have prior knowledge of the fact that Nix likes to call every piece of Nix Nix, then the introduction can in fact be read like that.
IMO by relying on the term expressions so much this early the manual uses language to dance around these naming issues, which makes things actually more difficult to understand than if our docs would address that issue head on, which is what I tried to do in this PR.
Alternatives to consider:
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.