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)
- Test environment report
- How to use setupHook/shellHook in the new cli (nix shell) HOT 2
- Under release notes, add more info on which releases are stable and unstable.
- fetchTarball fails after downloading proton-ge HOT 1
- Nix install fails after migration assistant HOT 2
- Cannot remove /nix HOT 1
- Build capability interface HOT 1
- `NIX_REMOTE` appears to be a URL, but does not unescape the path HOT 1
- `fchmodat2` seccomp filter breaks sandboxed builds with glibc 2.38 HOT 13
- Building docker image with nixos/nix fails with error: Package ‘tinycc-musl-unstable-2023-07-10-compiler’ in «unknown-file» is not available on the requested hostPlatform
- Docker tag nixos/nix:2.22.0 does not include arm64 arch HOT 2
- Nix segfaults on Liquorix HOT 3
- Incorrect lastModified value
- `nix hash to-sri` could infer hash type from hash length HOT 3
- cancelling nix-collect-garbage will cause it to report incorrect statistics
- nix-store --add doesn't update refrences properly
- C API: `nix_init_path_string` unclear
- How to "deploy" projects organized with nix for interpreted languages, e.g. R HOT 2
- nix develop shell incomplete PATH contents HOT 1
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.