Skip to content
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

WIP: init seqWithCallPos #12715

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

WIP: init seqWithCallPos #12715

wants to merge 1 commit into from

Conversation

hsjobeki
Copy link
Contributor

@hsjobeki hsjobeki commented Mar 21, 2025

Provide internal information to a function.
Since the return value of the function is completely ignored It can be considered safe.

This pattern could help to improve traces by providing access to internal state of the evaluator in a safe manner.

Motivation

Context

Designed and implemented together with @roberth


Add 👍 to pull requests you find important.

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

Provide internal information to a function.
Since the return value of the function is completely ignored
It can be considered safe.

This pattern could help to improve traces by providing access to internal state of the evaluator in a safe manner.
builtins.seq a builtins.trace msg null
) (a: a);
in
tracePos 42
Copy link
Member

Choose a reason for hiding this comment

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

Needs to be converted to a test, but we should probably get some feedback from the Nix team first.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. This file was mainly to show what would be possible. Before i go ahead and clean this up it should be discussed in the team if this is wanted at all.

Copy link
Member

Choose a reason for hiding this comment

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

Some more examples how this can be useful, would be probably helpful to motivate.

});


/* Determine whether the argument is an integer. */
Copy link
Member

Choose a reason for hiding this comment

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

Wrong description?

auto [rows,cols] = getWindowSize();
auto vCols = state.allocValue();
vCols->mkInt(cols);
intro_args.insert(state.symbols.create("terminalWidth"), vCols , noPos);
Copy link
Member

Choose a reason for hiding this comment

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

We discussed this builtin in the PR and propose to leave out the terminalWidth for the first iteration.

@roberth roberth added the idea approved The given proposal has been discussed and approved by the Nix team. An implementation is welcome. label Mar 24, 2025
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2025-03-24-nix-team-meeting-minutes-221/62113/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea approved The given proposal has been discussed and approved by the Nix team. An implementation is welcome.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants