Live data from Hacker News

Pkl, a Programming Language for Configuration

pkl-lang.org

511–520 of 598 posts

Re: Pkl, a Programming Language for Configuration

#511
post #504

25 years ago pretty much every program had a GUI to do the configuration. With help texts. On Windows, programs then either saved stuff into an ini file or the windows registry, both you could also edit manually. Today we have a programming language coming as a 87 MB binary to create config files. And to run that programming language you need to manually crate a ... config file. So what we are missing now is a 500GB…

> So what we are missing now is a 500GB framework that can write the config file for the programming language that is writing a config file for the actual program I wish to use. That exists since 1960. It's called LISP. The e.g. https://guix.gnu.org/ uses with great success, the Guile Scheme dialect of LISP, to be precise. And FYI the "framework" is: $ ls --human-readable --size $(readlink $(which guile)) 16K /gnu/st…

Guix/Nix can use dynamic linking without risk since they know the exact dependency closure. It's not fair to compare a statically linked executable to a dynamic one.

Re: Pkl, a Programming Language for Configuration

#512

25 years ago pretty much every program had a GUI to do the configuration. With help texts. On Windows, programs then either saved stuff into an ini file or the windows registry, both you could also edit manually. Today we have a programming language coming as a 87 MB binary to create config files. And to run that programming language you need to manually crate a ... config file. So what we are missing now is a 500GB…

40 years ago I wrote Assembly that ran directly on the CPU. You could modify the registers directly. Then these crazy people came along and made a compiled language? And it outputs... Assembly?

I'm sorry, but a huge chunk of todays "developers" really are in the business of creating problems.

Re: Pkl, a Programming Language for Configuration

#513
post #183
post #167

Earlier quoted context omitted.

I have been looking into alternatives to YAML templating, the Helm abomination, etc. and was utterly surprised how no one ever apparently has thought to create a configuration/templating system that's basically a fancy library on top of Scheme. I truly believe every company is still reinventing the wheel because of a lack of serious foundational knowledge in most engineers, so they are doomed to recreate subpar, shit…

Yeah was thinking about that a lot, too. I guess there’s zero overlap between schemers/lispers and people doing yaml configs.

There are dozens of us!

More seriously, I don’t understand how anyone tolerates 5k line yaml files but I haven’t found any support for moving away from it at $bigcorp. Right now we use an undocumented shim layer between Helm and Argo for maximum inscrutable templating. It’s an endless footgun with the impact spread so thin it’s invisible to the business.

Re: Pkl, a Programming Language for Configuration

#514
post #429
post #428

Earlier quoted context omitted.

If your configurations are simple, you don’t need this. If they are not, you might. Because you have not run into the problems this has addressed in your career, does not mean that you know better than Apple how to solve them. In fact, it means like you are uniquely unqualified to solve them. Acting like you are in a severely condescending dismissal of the engineers who worked on this makes for boring conversation.

Maybe give us an example? It's an interesting question - just how complex are our biggest configuration problems today?

I just run a count, on the infrastructure configuration for a relatively small, but already public company. 13k lines of YAML alone. Some of it is generated (from "YAML with macros") by AWS CDK parody I invented before CDK became a thing (and being an old school Unix pervert I did it with awk and m4). There's also 1400 lines of written or generated JSON that still needs to be managed. And that's a successful, but single-product company. I also worked for a company which had a single product but ran it for their clients heavily (very heavily) customized, you can easily 10x the numbers above and you still have to do that with a single team and go back to your family every night and not riding an ambulance to the nearest mental facility. YAML is like the object code, it's not a configuration language. (and that's why I prefer JSON, it's less error prone and easier to generate). Writing YAML manually is like programming in machine code back in the 80s. Possible, but why?

Re: Pkl, a Programming Language for Configuration

#515
Let us review the progress we've had so far in this area

* XML has the advantage of being almost perfect except its too verbose and isn't JSON

* JSON has the advantage of being JSON, but is strangely broken at even basic stuff (i.e. comments, no trailing commas)

* TOML has the advantage of being "better JSON", for people who like rust, but it is still too limited for a lot of scenarios

* YAML is not as limited, but it has the advantage of giving bad people promotions and good people PTSD

* HOCON has the advantage of being the goldilocks child of JSON and YAML, but nobody read the documentation

* has the advantage of being able to do anything and this is a disadvantage

* Etc... for various reasons

In all seriousness, I welcome Pkl! Configuration seems simple and I think another configuration language opens up a lot of pent-up frustration, but I am legitimately very happy to see some fresh ideas in this space.

Incorporating a collection of typed records with a modicum of behavior and logic might be the secret recipe needed to crack the code. The fact that it can produce equivalent JS tells you that they've chosen a very intelligent subset of functionality of programming language features.

My best wishes to the team!

Re: Pkl, a Programming Language for Configuration

#516
post #488

Earlier quoted context omitted.

I appreciate you having good intentions. I don't mean to be disrespectful. This however does not change my position that we have more than enough scripting languages focused on string operations, and don't need another language. And especially not a bloated one that itself depends on huge frameworks. If the same task can be solved using a 76KB standard Unix tool, creating a custom language with a huge bloated runtime…

> And my position also stands that it would make far more sense to finally agree on a config file standard format It would also make far more sense for humans to agree on most things and work towards a common goal that benefitted us all, but that’s just as much of a pipe dream. Proposing something that will never happen is not a practical solution. https://xkcd.com/927/

communism immediately comes to mind. beautiful idea, but also the idea with the largest body count in the human history.

Re: Pkl, a Programming Language for Configuration

#518
post #496

Earlier quoted context omitted.

I believe the term comes from this paper: https://www.cs.ox.ac.uk/jeremy.gibbons/publications/fast+loo... . See section 5 which defines “moral equality”.

That is indeed the only reference I could find (and maybe Cue is inspired by this paper?), but they don't seem to explain why they use such language. They talk about "unjustified reasoning" and laws, but the connection to ethics seems questionable. But I've not read the whole paper.

A moral equivalence class is an axiomatic equivalence class that when quotienting some mathematical structure the model in question might lose some of its soundness or adequacy properties, but one that nevertheless might be useful for other meta-mathematic reason.

This use of the word is so common in certain math/category theory/compsci communities that I was not aware it was unconventional in any way. It has nothing to do with ethics.

I guess the moral of the story is that the moral of the story can be lost if people don't understand the story.

Re: Pkl, a Programming Language for Configuration

#519

Earlier quoted context omitted.

Was about to ask if you had k8s api models available internally, and that someone should create some tool to generate that from the spec. But turns out it already exists in the open! https://github.com/apple/pkl-k8s-examples

Coming from yaml+kustomize, all those curly braces are a tough sell. It looks like they roughly double the number of lines in the file.

Curly braces are great at ensuring correctness though, as goto fail; has shown.

Re: Pkl, a Programming Language for Configuration

#520
post #518

Earlier quoted context omitted.

That is indeed the only reference I could find (and maybe Cue is inspired by this paper?), but they don't seem to explain why they use such language. They talk about "unjustified reasoning" and laws, but the connection to ethics seems questionable. But I've not read the whole paper.

A moral equivalence class is an axiomatic equivalence class that when quotienting some mathematical structure the model in question might lose some of its soundness or adequacy properties, but one that nevertheless might be useful for other meta-mathematic reason. This use of the word is so common in certain math/category theory/compsci communities that I was not aware it was unconventional in any way. It has nothing…

The word choice is peculiar, but I found this [1] explanation helpful.

[1] https://eugeniacheng.com/wp-content/uploads/2017/02/cheng-mo...

Post reply on HN