Live data from Hacker News

Pkl, a Programming Language for Configuration

pkl-lang.org

21–30 of 598 posts

Re: Pkl, a Programming Language for Configuration

#21
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…

> 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.

No need for a novel mechanism - there are plenty of available solutions to add validation to python

> imagine telling a Go developer that they need to install Python

Pkl doesn't come preinstalled on machines - so you'll have to install it as well

> set up virtualenv, and run pip install so they can configure their application

This is the real friction point, but is it a bigger friction point than having to adopt yet another DSL?

Re: Pkl, a Programming Language for Configuration

#22

Earlier quoted context omitted.

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.

High or not, you're 100% correct.

Have a look at PEP 20 – The Zen of Python.

Python is actually horrible at following it, Go doing a much better job.

Re: Pkl, a Programming Language for Configuration

#25
> Pkl — pronounced Pickle — is an embeddable configuration language which provides rich support for data templating and validation. It can be used from the command line, integrated in a build pipeline, or embedded in a program. Pkl scales from small to large, simple to complex, ad-hoc to repetitive configuration tasks.

I do like the sound of that. It's always quite tedious to manage configuration in full-stack applications with mixed languages/ecosystems. It seems they already have Pkl plugins for IntelliJ, vscode and neovim and a language server is "coming soon".

Post reply on HN