!RRerllqmbATpmbJgCn:nixos.org

Nix / NixOS

3852 Members
Nix/NixOS user help channel | Latest NixOS: 24.05 (Uakari) | Ask your question here or on https://discourse.nixos.org | All NixOS rooms are moderated! Ask for help in #moderation:nixos.org660 Servers

Load older messages


SenderMessageTime
21 Oct 2024
@emilazy:matrix.orgemily
In reply to @kfears:matrix.org
I'm pretty sure map or mapAttrs wasn't always in builtins, it was only in NixLang, but it got added later so now we have builtins.map and lib.map and it's the same thing but different perf
no??
22:04:53
@emilazy:matrix.orgemily

lib just re-exports stuff from builtins

22:05:10
@kfears:matrix.orgKFears (tragedy arc)Oh, that makes sense22:05:41
@mjm:midna.devmjmyeah lib.map should be identical to builtins.map22:05:43
@kfears:matrix.orgKFears (tragedy arc)Yeah basically that's why stdlib is confusing22:06:08
@mjm:midna.devmjmwhat is confusing about it22:06:59
@emilazy:matrix.orgemilyyou usually should not have to think about builtins at all22:08:41
@emilazy:matrix.orgemilyjust use lib22:08:45
@judson:matrix.orgJudsonAnyone have an idea about why myYarnPackage would fail on missing executables that should be provided by the package.json devDependencies?22:08:46
@emilazy:matrix.orgemilywhat is implemented as a primitive should be of no concern22:09:00
@mjm:midna.devmjm
In reply to @emilazy:matrix.org
just use lib
this is the way
22:09:02
@kfears:matrix.orgKFears (tragedy arc)
In reply to @mjm:midna.dev
what is confusing about it
Two namespaces that are grouped based on history and performance rather than some logical grouping
22:09:25
@kfears:matrix.orgKFears (tragedy arc)
In reply to @emilazy:matrix.org
just use lib
Also I was always using builtins when possible :/
22:09:55
@kfears:matrix.orgKFears (tragedy arc)Even when operating entirely in the scope of Nixpkgs22:10:04
@mjm:midna.devmjmlib literally re-exports everything in builtins I think22:10:02
@kfears:matrix.orgKFears (tragedy arc)The more you learn, I guess22:10:14
@mjm:midna.devmjmso you don’t actually need to care22:10:22
@emilazy:matrix.orgemilyit's more like builtins is an implementation detail22:10:36
@emilazy:matrix.orgemily
In reply to @mjm:midna.dev
lib literally re-exports everything in builtins I think
maybe not stuff like unsafeGetAttrPos? or maybe it does
22:10:58
@emilazy:matrix.orgemilybut the stuff it doesn't re-export is precisely the stuff you shouldn't use normally22:11:16
@emilazy:matrix.orgemilyif it exists22:11:18
@mjm:midna.devmjm
In reply to @emilazy:matrix.org
maybe not stuff like unsafeGetAttrPos? or maybe it does
yeah not 100% sure. Certainly nothing I’ve tried to actually use in practice
22:12:27
@kfears:matrix.orgKFears (tragedy arc)
In reply to @emilazy:matrix.org
it's more like builtins is an implementation detail
Maybe that's a good way to think about it
22:16:26
@kfears:matrix.orgKFears (tragedy arc)I've been bamboozled one too many times to believe I can use Nix without thinking of what is implementation detail and what's not and what the detail is22:17:02
@kfears:matrix.orgKFears (tragedy arc)And in this case I'm probably actually wrong22:17:13
@kfears:matrix.orgKFears (tragedy arc) So thanks for the tip, I'll use lib a lot more liberally now 22:17:21
@sliedes:hacklab.fiSami Liedes
In reply to @kfears:matrix.org
And in this case I'm probably actually wrong
How often have you thought this way and been bitten by having been wrong about having been wrong?
22:24:57
@kfears:matrix.orgKFears (tragedy arc)In the case of Nix, I think that's around the 3rd time in total? Not quite sure22:26:44
@kfears:matrix.orgKFears (tragedy arc)Usually, I've been thinking "this sounds pretty complex" and the details about how complex it actually is made me despair :/22:30:09
@sliedes:hacklab.fiSami LiedesTBH I think it's hard to count how many times you've been wrong if you've first thought something, then thought you're wrong and then realize you weren't after all. I think there's some way to hide Gödel there.22:30:24

Show newer messages


Back to Room ListRoom Version: 10