Comments (4)
I'm not sure that it's a problem in this case, as the implementation doesn't allocate
The issue with this statement is that this is an implementation detail. It's not guaranteed to be the case over alternative Nix implementations, or even changes to the existing implementation, which is what the C API is designed to avoid.
(Tbh, re #10499, having a distinction between thunked and non-thunked feels a bit iffy to me as well, because this is harder to abstract over in other languages; it'd feel more comfortable personally to have the entire API re-thunked instead of adding more bits and pieces on top. It's unstable for a reason :))
from nix.
The issue with this statement is that this is an implementation detail.
That's fair, but I'm having trouble to imagine an implementation that would allocate in an initialization routine. I suppose this would involve some serious "adapter" logic to bridge a significant mismatch between the memory model of an alternate implementation and a memory model that's close to what the C API suggests.
Out of curiosity (as I agree), do you have a concrete situation like that in mind, or are we just managing the risk?
alternative Nix implementations
This is not an explicit goal, though I would like for this to work as well as it can.
Tbh, re #10499,
I'm ok to discuss here, but might be more effective to comment there.
By "re-thunked", do I understand correctly that you agree with the goal of having more lazy behavior, and also wish to remove the functions or behaviors that are unnecessarily strict?
from nix.
That's fair, but I'm having trouble to imagine an implementation that would allocate in an initialization routine
I'd counter that "applying an argument to a lambda/callable" is, in fact, not strongly an "initialization routine", and doesn't nix_init_string
allocate as well?
alternative Nix implementations
This is not an explicit goal, though I would like for this to work as well as it can.
As I said, "or even changes to the existing implementation." - there's no guarantee this may change in the future with a better interpreter.
By "re-thunked", do I understand correctly that you agree with the goal of having more lazy behavior, and also wish to remove the functions or behaviors that are unnecessarily strict?
Having one set of functions that are all lazy, rather than a set that is lazy and a set that is strict, is my preference; but I can see reasons for wanting both.
from nix.
The purpose was to initialize an already allocated value to be a thunk. Laziness requires that that's a simple operation, but non-strictness does not. I suppose an evaluator might want to be more eager in some cases? I don't think a requirement to have both the simple and eager behavior would be a burden on evaluators, but I'll cut it short here because I already agreed, and I think we've found a potential concrete reason - even better.
Thank you for the discussion and clarification!
from nix.
Related Issues (20)
- the copy/download status when fetching flake lock archives is misleading/wrong
- "lock file contains unlocked input" when using (dirty) git+file:// input HOT 1
- File does not exist error improvement HOT 2
- NixOS Gnome Graphical Installer - Does not set keyboard layout inside installer HOT 1
- Support hard links within tar files being used as flake inputs type=tarball HOT 1
- No relevant error in `nix run` when CA SSL certs are misconfigured
- Make derivation building work on windows
- Functional tests that work on both Windows and Unix
- NUL bytes in JSON input are not handled correctly HOT 3
- nix install on old mac os HOT 2
- Installables with empty outputsToInstall are installed, and do not use default output
- nix-channel --add url suffix contained @, nix-channel --update failed. error: store path 'xxx-xx@xx' contains illegal character '@'
- Remove `comparator.hh` and use new C++ comparison operator defaulting HOT 1
- Changelog links aren't checked in CI since 00704008
- fetchFromGitHub not validating hashes HOT 3
- Using __structuredAttrs ignores top-level reference checks HOT 2
- nix3-build should release memory acquired for evaluation before building the derivation HOT 7
- Accidentally Did A "sudo apt install nix-bin" Before Curl Command Install Of Nix HOT 3
- Feature request HOT 1
- Re-enable setuid i686-linux test
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nix.