Live data from Hacker News

Pkl, a Programming Language for Configuration

pkl-lang.org

141–150 of 598 posts

Re: Pkl, a Programming Language for Configuration

#142
post #80

Earlier quoted context omitted.

What advantages does Turing-completeness provide for a configuration language?

There are three (maybe more?) ways things can be Turing-incomplete: 1. You are limited to N evaluation/reduction steps. 2. The language doesn't include primitives like recursion or loops. 3. You can have recursion or loops, but the language makes you somehow prove that your program will terminate. I think (1) would be fine, but I don't know any configuration languages that use this approach. (2) is restrictive/annoyi…

I think 2) seems incorrect. What you can’t have is unbounded loops and recursion. Bounded loops are perfectly fine and I don’t tend to need unbounded ones when programming (with exceptions being infinite loops for handling asynchronous events, which a configuration language doesn’t need to do).

Recursion is trickier. I think banning it or simply limiting stack depth seems fairly reasonable? In fact I’m pretty sure most Turing-complete languages have a stack depth limit, so unbounded recursion is not allowed for those either. I don’t see a limit being a problem, because again this is a config language.

I don’t see why HTML escaping needs Turing-completeness. It shouldn’t need any unbounded iteration (it should be limited to the size of the input string) or unbounded loops. In general, I can’t think of any typical data processing code where turning completeness is required, but could be wrong. Do you have any practical examples of transformations that need unbounded iteration?

Re: Pkl, a Programming Language for Configuration

#143

Earlier quoted context omitted.

> Apple has done nothing cross platform or open source or community oriented Cups - https://en.wikipedia.org/wiki/CUPS Swift - https://en.wikipedia.org/wiki/Swift_(programming_language) Zeroconf - https://en.wikipedia.org/wiki/Bonjour_(software) I think they're bad, opaque opensource maintainers, but they did release some popular things that have communities on other systems. I do wish they just contributed to nickel…

CUPS was done by Easy Software Products, in 1997. Apple adopted it only in 2002. Swift is a language entirely in the control of Apple, mainly targeting Apples platforms. With little to no community engagement. Bonjour is not really cross platform, and not really open source either as it has lots of strings attached to the license and terms one can use it under. (I wouldn't say that Apple has done "nothing" -- but to…

HLS -- created by Apple, just about everybody uses it for streaming on the web.

And I think CSS animations and transforms mostly came out of Apple; at any rate, they're very similar to the animations and transforms in UIKit that originally came from NeXT.

Re: Pkl, a Programming Language for Configuration

#144
post #132

sadly the Go implementation is bloated as hell: https://github.com/apple/pkl-go/blob/main/go.sum no thank you.

You should rather look at go.mod file, and it doesn't look bloated at all. They could maybe drop cobra and use something with less dependencies, they use pflag package already so maybse use only that, but uhh I've seen much, much worse worse, as a daily Go user I'd say it's fine

Re: Pkl, a Programming Language for Configuration

#145

Not to be confused with “pickle”, the Python object serialization format…

Where "format" is used in the lightest way possible. (NEVER try to unpickle anything that was not produced by pickle itself (preferably the exact same version))

Re: Pkl, a Programming Language for Configuration

#147
post #59

Earlier quoted context omitted.

Looks like it has better IDE integration. Still, I am going to stick with cue because of what you mentioned and also because it is a community project. Apple has very few actively maintained open source projects and sometimes such projects are difficult to contribute to or have wavering support for the open source side. It is great having corporate backing behind something like swift that needs a massive amount of wo…

FWIW, we (CUE) are currently working on a LSP for CUE which should improve the IDE experience.

I've been somewhat surprised that CUE bills itself as "tooling friendly" and doesn't yet have a language server- the number one bit of tooling most devs use for a particular language.

I'm assuming it's becaus CUE is still unstable?

Anyway, if others are interested in CUE's LSP work, I think https://github.com/cue-lang/cue/issues/142 is the issue to subscribe to

Re: Pkl, a Programming Language for Configuration

#148

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

Not completely related to the OP, but is Truffle going to be upstreamed as part of Project Galahad or will it remain as a library maintained by Oracle Labs?

I ask cause the Project Galahad page on openjdk.org is a bit sparse on details.

Re: Pkl, a Programming Language for Configuration

#150

In a competition with sky/starlark, I feel skylark would win here. “Safe subset of python” is what a lot of people presented with this problem want, and skylark gives them almost exactly that. OTOH, curious to see what advantages Pkl gains from not having the constraints of maintaining familiarity with another language.

Agree - one of the things we've found using Starlark at Kurtosis is even the small jump from Python to Starlark makes people think, "What's this Starlark? I don't want to learn a new language", and we have to show them how not-a-new-language it is. I can't imagine bringing a truly new language like Pkl to folks and having them enjoy it.
Post reply on HN