Replies: 1 comment 3 replies
-
Hey @axelkar - thanks for the questions! For the first one, while you're correct about the current state of things, a final decision on this hasn't yet been made. Allowing for multiple bindings in a single I'm not sure I'm the best person to answer the second question, but I can try to explain my current understanding and others can chime in to correct me if I go wrong. Basically, Nickel takes the view that most configuration is best expressed as a "record" structure, and as such the type system is laser-focused on providing a good experience for working with records. This is less restrictive than you might first think, as - at least in our experiences - the majority of types that end up being useful in configuration are some combination of "primitive" types, record types and function types. While there is no module system per-se, you can emulate modules by writing a file which evaluates to a record containing the contracts, values & functions you want to expose. Equally you can emulate something like a Rust That being said, if you feel there's functionality that is missing & can provide good use cases for it, please open an issue for it. Finally, as for |
Beta Was this translation helpful? Give feedback.
-
Why was let..in chosen to not have multiple values?
The following is valid in Nix, but not Nickel. Why?
Why is there no special syntax for type (definitions) and modules?
The
import
function is like replacing the function call with the target file. I said that because module-level syntax likepub struct ...
orexport interface ...
isn't possible (#805). Maybe I am too used to Rust and TypeScript but I feel like strong typing with normal structs/interfaces, traits, tagged unions (solution to #781), etc. would be amazing in a configuration language such as Nickel but you are free to correct me.Contracts are regular functions in regular let..in expressions, which I get confused by but I guess if they are exported or imported it's done by regular records and regular let..in expressions. (#911, #422 ?) I also get confused with
a | Str | default "default"
anda | Str | default = "default"
; how does it even work?Beta Was this translation helpful? Give feedback.
All reactions