Live data from Hacker News

Pkl, a Programming Language for Configuration

pkl-lang.org

11–20 of 598 posts

Re: Pkl, a Programming Language for Configuration

#11
post #5

I was a big believer in Helm for generating Kubernetes resources until I looked up and saw that we had created an impossible-to-validate, impossible-to-reason-about DSL in our values.yaml and that's when I realized we were at the end of our rope with Helm. We switched to Pkl for our Kubernetes resource generation -- it's delightful to maintain and reason about our deployments before execution time :)

After spending 5,000+ hours in helm charts, I still hate helm.

I've looked at cdk8s but I hate the tsconfig culture, why can't it be simple like Go?

Re: Pkl, a Programming Language for Configuration

#12
post #8

Serious question - why not just use python?

Python isn't oriented around defining and validating data. For example, something like: "this number is be between 1 and 10" means you have to come up with a novel way to add validation, because it isn't built into the language. Also, Pkl is meant to be usable everywhere. General purpose languages tend to be tied to their own ecosystem--imagine telling a Go developer that they need to install Python, set up virtualen…

This made me realize that Go actually succeeds at being more pythonic than python.

I'm also incredibly high.

Re: Pkl, a Programming Language for Configuration

#15
I thought it odd that the language bindings didn't include the most popular langage, Python. In fact, Python seems not to be mentioned at all in the linked page. So I'm wondering, is it

1) Because the developers of Pkl are Python haters

2) Because the developers of Pkl are so overawed by Python that they can't imagine Pkl contributing anything useful to the Python ecosystem

In either case, having suffered so much using Ansible and its excrable YAML scripting, I may use Pkl together with Python.

Re: Pkl, a Programming Language for Configuration

#17

I thought it odd that the language bindings didn't include the most popular langage, Python. In fact, Python seems not to be mentioned at all in the linked page. So I'm wondering, is it 1) Because the developers of Pkl are Python haters 2) Because the developers of Pkl are so overawed by Python that they can't imagine Pkl contributing anything useful to the Python ecosystem In either case, having suffered so much usi…

Probably secret option number 3 of no-one having needed it yet - because the tool is standalone, you can render the required output before running whatever needs to consume it. I’ve certainly used it from Python in that manner - bindings are only required if you want to consume the raw language programmatically from a Python context.

Re: Pkl, a Programming Language for Configuration

#18
post #17

I thought it odd that the language bindings didn't include the most popular langage, Python. In fact, Python seems not to be mentioned at all in the linked page. So I'm wondering, is it 1) Because the developers of Pkl are Python haters 2) Because the developers of Pkl are so overawed by Python that they can't imagine Pkl contributing anything useful to the Python ecosystem In either case, having suffered so much usi…

Probably secret option number 3 of no-one having needed it yet - because the tool is standalone, you can render the required output before running whatever needs to consume it. I’ve certainly used it from Python in that manner - bindings are only required if you want to consume the raw language programmatically from a Python context.

Exactly this. Pkl is most useful as a type-safe configuration language that can output to any other format (already supported, or put together by the user within Pkl). You’ll always get valid JSON, YAML, PLIST, what-have-you as output. This you can then parse in the language/system of your choice.

Certainly language bindings are useful, and if there’s demand likely someone will create them.

Re: Pkl, a Programming Language for Configuration

#20

Types on the fields is interesting. The examples suggest said types are lost when you serialise to json or xml, though it seems like at least some types should be expressible as schemas. Language reference doesn't mention schemas either https://pkl-lang.org/main/current/language-reference/index.h...

You are looking for templates: https://pkl-lang.org/main/current/language-tutorial/02_filli...

There’s another repo, the Pkl Pantry, that provides a couple of ready made templates (Schemas) that you can try out: https://github.com/apple/pkl-pantry

Post reply on HN