3 ms·
To put it in a C context: it’s a function with a single argument ‘pkgs’, which returns a struct with one field ‘deps’, which is an array of package structs.
by bspammer 5y ago
To put it in a C context: it’s a function with a single argument ‘pkgs’, which returns a struct with one field ‘deps’, which is an array of package structs.
- IshKebab 5y agoSo why did they chose such unconventional syntax? Just for the hell of it? There doesn't seem to be any advantage and it definitely puts a lot of people off.
- bspammer 5y agoThe syntax is not so unconventional compared to, say, modern javascript: ({ pkgs }) => { deps: [ pkgs.cowsay ] } or python: lambda pkgs: { deps: [pkgs.cowsay] } I guess really the question is why create a new language rather than using an existing one? The language needed to be functional, lazy, and good at managing packages, and not much else. I guess they felt that no existing language fits the bill (Haskell does I guess but it's got a lot of baggage). I can't claim to know much about its history.