-
Notifications
You must be signed in to change notification settings - Fork 21
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
Handle nix symbolic strings on Nix side #153
base: main
Are you sure you want to change the base?
Conversation
This allows us to shortcut usage of NixString in many places. We could probably get rid of NixString entirely as well, but it needs more consideration. Part of #58.
I don't think we want to get rid of the contract, but we can reduce it to something like
And remove the |
EDIT: Never mind. It's Friday afternoon, and I'm talking nonsense. previous messageSo I found something utterly interesting while looking into this: Somehow, the
bit (or the equivalent on {
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"$__organist_type": "nixInput",
"attr_path": [
"bash"
],
"input": "nixpkgs"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
},
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
{
"fragments": [
"/bin/bash"
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}
],
"prefix": "nix",
"tag": "SymbolicString"
}, Changing that to
leads to the generated json to be 20x smaller, and the shell to open ~10x faster |
Directly using Nickel's encoding for symbolic strings is as powerful, and simpler since it means that `nix-s%"blah"%` is a valid Nix string, while we previously had to explicitly apply the `NixString` contract.
60f7e4f
to
78e972e
Compare
This is somehow making the Nix evaluation quite slower (roughly 30%). Which is mildly weird because the Nickel output is actually slightly simpler. |
It looks like on CI evaluation for HaskellStack times out or something:
so I would guess this change somehow made Nickel evaluation way longer... |
It seems to be making that specific one loop indeed 🤔 The weird thing is that it doesn't do that when running |
Ahah, so it is a problem of double-application of a contract (same as tweag/nickel#1630 ?). Evaluating the equivalent of the
|
I've tried with a Nickel version including tweag/nickel#1631 to see whether that would fix the issue, but ran into tweag/nickel#1664. One thing I noticed is that the reason it shows up with |
This allows us to shortcut usage of NixString in many places.
We could probably get rid of NixString entirely as well, but it needs more consideration.
Part of #58.