My opinion on Pkl (Apple's new configuration format)

preview_player
Показать описание
Apple recently released a new configuration format called Pkl (Pickle). I migrated some configuration over from TOML and so far I really enjoy it. It works really well with Kotlin and seems like a great replacement for Json and YAML.

0:00 - What is Pkl
0:24 - Why I'm interested
1:10 - Use case
1:38 - Template example
2:21 - Configuration example
2:45 - What I preferred about TOML
3:13 - Website example
3:28 - Parsing in Kotlin
3:47 - What I don't like (additional complexity)
4:16 - Final thoughts
Рекомендации по теме
Комментарии
Автор

Personally I wrote my own config library in Kotlin and I feel like if it's as powerful as pkl. You can write lambdas to validate data etc... I don't really see the need to bring in another language here but I like the idea

giuliopimenoff
Автор

It's also valuable to me. Right now in a project I have to deal with a weird configuration whereas I have a JSON that needs to respect a common base JSON so that identical sub configurations don't cause redundant JSON. JSON itself is incapable to do this natively. Things had to get done, so I simply wrote a JSON merge routine at runtime that I will carry down specific things from the base. This sucks and pkl would've solved it. I will try to move my configuration over to have it compile a finished JSON without the need of any base JSON or runtime merge logic. pkl seems to be the perfect tool for that.

_modiX
Автор

Nix, Nickel, Dhall, CUE, Jsonnet and HCL already exist

egorandreevich