Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mschwaig
Copy link
Member

@mschwaig mschwaig commented Jun 28, 2025

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:

  • Going through the manual and qualifying every instance of the term nix Nix with something like Language or Package Manager.
  • Naming some of these things something else.

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@@ -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
Copy link
Member

@edolstra edolstra Jun 30, 2025

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.

Copy link
Member Author

@mschwaig mschwaig Jun 30, 2025

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!

Copy link
Member Author

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.

Copy link
Member

@edolstra edolstra Jul 1, 2025

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).

@edolstra
Copy link
Member

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.

@roberth roberth changed the title clarify that the Nix language is not called "Nix epxressions" clarify that the Nix language is not called "Nix expressions" Jul 2, 2025
@@ -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
Copy link
Member

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.

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

Successfully merging this pull request may close these issues.

3 participants