Live data from Hacker News

Pkl, a Programming Language for Configuration

pkl-lang.org

71–80 of 598 posts

Re: Pkl, a Programming Language for Configuration

#71

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…

“Popular” doesn’t mean “fitting every purpose”.

All the listed languages are compiled and statically typed. Python is neither. Neither is JavaScript, another popular programming language which is also not listed.

Re: Pkl, a Programming Language for Configuration

#72

So like cue [0] but more primitive, less principled and in java? [0] https://cuelang.org

Looks like it might fix three big issues I had with Cue:

1. The only way to use it is to run their Go CLI app to convert the Cue into JSON and then load that. That sucks. I want native support. Jsonnet does this a lot better (https://jsonnet.org/ref/bindings.html), and PKL at least supports 4 languages. Cue only supports Go directly. Not good.

2. Cue has a super fancy type system, but as far as I could figure out there's no way to actually take advantage of this in an IDE, which is like 60% of the benefits of fancy type systems. In a Cue document you can't say "this is the schema". XML had that decades ago (and it has awesome IDE integration with Red Hat's XML extension for VSCode). Even JSON can sort of do it via `$schema`. The docs are a bit scant but it looks like this supports it too. The fact that Cue doesn't sucks.

3. Cue is pretty much only a fancy type system. It's a really elegant and nice type system, but that's it. It doesn't even have functions. So it isn't going to help with a lot of the things that Jsonnet and PKL help with.

This is not really in the same area as Cue. It's a way more direct competitor to Jsonnet and looks better, based on my brief skim.

My only concern with these sorts of things is that they're basically a whole new programming language, but without many of the features you'd want from a real programming language. It's in an uncanny valley.

Does look nice though.

Re: Pkl, a Programming Language for Configuration

#73

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…

> Because the developers of Pkl are Python haters

Look at the languages that they do support - Go, Swift, Kotlin, Java. These are all robust languages for writing production grade software. That's probably why - the people at Apple using this don't need it for their hacky Python scripts.

Re: Pkl, a Programming Language for Configuration

#74
post #66

> We offer plugins and extensions for IntelliJ, Visual Studio Code and Neovim, with Language Server Protocol support coming soon. Why? Why would they not have just done the language server first (or only)? All of those have built-in support for it, so separate implementations wouldn't have been necessary; that's the point . I just don't understand why you'd make that decision on a greenfield project today, especially…

Why assume it's a greenfield project? I would think most open source software that comes out of companies have lived internally for a while before going public?

Re: Pkl, a Programming Language for Configuration

#75
Does this support fancy symbols in bare identifiers? Even the huge reference page is blank on that, and the only working links to grammar are to the ANTLR website, but even if they did work, the grammar is also blank as it simply references an internal grammar function

And there doesn't seem to be any online playground to test

Re: Pkl, a Programming Language for Configuration

#76
post #8

Serious question - why not just use python?

Python would be a terrible choice for this.

* It's been dragged into static typing kicking and screaming.

* You import the whole Python infrastructure/packaging catastrophe.

* It's not sandboxed.

If you wanted something Python-like you would you Starlark.

Re: Pkl, a Programming Language for Configuration

#77
post #66

> We offer plugins and extensions for IntelliJ, Visual Studio Code and Neovim, with Language Server Protocol support coming soon. Why? Why would they not have just done the language server first (or only)? All of those have built-in support for it, so separate implementations wouldn't have been necessary; that's the point . I just don't understand why you'd make that decision on a greenfield project today, especially…

I can imagine the answer if I were in their shoes. Say I already have something working as a plugin (or know how to make plugins vs. learning from scratch about implementing LSP), I'd rather have this out there as soon as possible and add more tooling/language support in subsequent releases.

Re: Pkl, a Programming Language for Configuration

#78
post #66

> We offer plugins and extensions for IntelliJ, Visual Studio Code and Neovim, with Language Server Protocol support coming soon. Why? Why would they not have just done the language server first (or only)? All of those have built-in support for it, so separate implementations wouldn't have been necessary; that's the point . I just don't understand why you'd make that decision on a greenfield project today, especially…

>I just don't understand why you'd make that decision on a greenfield project today, especially if LSP support is planned at all?

How about if the LSP doesn't cut it for the kind of they IDE support they want to offer?

Re: Pkl, a Programming Language for Configuration

#79
Pkl was built using the GraalVM Truffle framework. So it supports runtime compilation using Futamura Projections. We have been working with Apple on this for a while, and I am quite happy that we can finally read the sources!

https://github.com/oracle/graal/tree/master/truffle

Disclaimer: graalvm dev here.

Edit: typo

Re: Pkl, a Programming Language for Configuration

#80

So like cue [0] but more primitive, less principled and in java? [0] https://cuelang.org

That’s what I’m seeing as well. Curious to try it out to see how its expressiveness compares to Cue. Looks like it’s Turing-complete as opposed to Cue, which is a plus… but that comes with downsides. One thing I like to see is the direction of “declare types and validations in a single place, integrate with any language”. My daily codebase atm has types declarations in typescript, cue, pydantic and for our database……

What advantages does Turing-completeness provide for a configuration language?
Post reply on HN