top | item 39240254

(no title)

havaker | 2 years ago

Built-in fetching of http resources and reading files from the filesystem[1] combined with turing-completeness are features that I wasn't expecting from a configuration language. I wonder if the complexity this brings is justified.

1: https://pkl-lang.org/main/current/language-reference/index.h...

discuss

order

p10jkle|2 years ago

For me, that's where all the power of the language comes from. It's like writing your config in Go or Python (which I think is also a great approach) except its designed from the ground up for this use case of config generation.

rockwotj|2 years ago

Ah just give me typescript, I do not need to learn a new thing for configuration languages and at the end of the day the output is compatible with JSON. Typescript has all the stuff I would want: types, first class json support, an ecosystem of libraries (if you want it, I would probably not for config generation). And the tooling is amazing. Does pkl have LSP, syntax highlighting in every editor, debugger or repl?

mikepurvis|2 years ago

Nix does this too and maintains perfect caching from top to bottom.

SAI_Peregrinus|2 years ago

Nix is a build & metaprogramming system, not (just) a configuration language.

sanderjd|2 years ago

But I have no idea how I would build a config structure for an application using Nix... It seems very powerful so I'm sure it's possible, but I just have no idea where I'd start for this specific use case.

Whereas this documentation for Pkl is entirely about that use case.

zelphirkalt|2 years ago

Sounds a bit like Mako in Python, that allows you to code Python in the template, iirc.