Live data from Hacker News

Pkl, a Programming Language for Configuration

pkl-lang.org

51–60 of 598 posts

Re: Pkl, a Programming Language for Configuration

#52

Anything development related from Apple is inherently disinteresting unless it's aimed at Apple, is for Apple and you're building for Apple. Apple has done nothing cross platform or open source or community oriented so if they come out with something that's intended to be more general is has no base, no users, no audience of non-Apple developers to land on. I'm not anti Apple - I love MacOS and Apple is my main machi…

I think they funded development of Clang and LLVM.

Re: Pkl, a Programming Language for Configuration

#53
post #32

JSONSchema covers a lot of various schema needs and YAML is something a lot of developers are comfortable with. I know both of those technologies are not popular here in HN but YAML type-checked and editor-autocomplete-enabled using JSONSchema is a solid choice for configurations in my opinion.

true, but as name suggests jsonschema wasn't meant for yaml it's only because yaml is superset of JSON. the issue is that when you want or need to use something that is outside of JSON spec, like tags all your validation falls apart. also JSON schea validation is really basic, and while designing configuration format can often mitigate that, it's not very versatile.

another common thing is that sometimes you have to define multiple very similar sections in configuration that cannot be handled with yaml archors, eg I have repeated definition dozen times that changes only in 2 numbers that are deeply in structure and name string, and I need to repeat everything because of that and it's pita to modify all other parameters that need to be kept in sync

therefore I think this format looks really nice, although I'm concerned by loops that can be used there, is there possible to create simple config that takes ages to parse or consume very large amounts of memory?

Re: Pkl, a Programming Language for Configuration

#54

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… and it’s driving me bonkers seeing as most types are already declared in Cue to start with. I played a little with packages meant to translate them i.e. Cue -> TS, but nothing worth the effort.

IMO it would be a big upside for Cue to handle these as first class language features.

Re: Pkl, a Programming Language for Configuration

#55

Anything development related from Apple is inherently disinteresting unless it's aimed at Apple, is for Apple and you're building for Apple. Apple has done nothing cross platform or open source or community oriented so if they come out with something that's intended to be more general is has no base, no users, no audience of non-Apple developers to land on. I'm not anti Apple - I love MacOS and Apple is my main machi…

At first glance, this is interesting in that it’s the least Apple-ish open source project I can remember seeing. I can definitely see uses for it right now in non-Apple-ecosystem projects where you’re not already invested in a different tool.

Re: Pkl, a Programming Language for Configuration

#56

In what sense is this programmable? Can I write a loop in this? If? Elvis operator? A simple map lookup?

> Can I write a loop in this?

https://pkl-lang.org/main/current/language-reference/index.h...

> If?

https://pkl-lang.org/main/current/language-reference/index.h...

> Elvis operator?

https://pkl-lang.org/main/current/language-reference/index.h...

> A simple map lookup?

https://pkl-lang.org/main/current/language-reference/index.h...

Re: Pkl, a Programming Language for Configuration

#57

I'm sorry, can someone explain why one would want to translate from one data description language to another (Pkl -> JSON, or whatever)? Why not just write JSON (or whatever) to begin with?

Because there are a thousand ways to describe the same thing in JSON. This:

    city = {
        "id": 3,
        "name": "Foo",
        "lat": 3.555,
        "long": 4.11,
    }
Is the same as:

    city = {
        "id": "3",
        "name": "Foo",
        "coordinates": [3.555, 4.11]
    }
But you want to normalize that.

Something like Cuelang will:

- Define the schema that will let you know what you should put inside.

- Allow you to inflate that schema into a full file, providing only the values.

- Will generate always a correct file, with no typo, or format error.

- Will check that the data is correct and tell you if there are any errors.

- Is note theoretically tied to a particular run time or stack.

Re: Pkl, a Programming Language for Configuration

#58

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

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 work, but for cue, I am happy with steady improvements meeting the needs of a wide community once I can figure out a good IDE integration.

Re: Pkl, a Programming Language for Configuration

#59

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

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.

Re: Pkl, a Programming Language for Configuration

#60

Anything development related from Apple is inherently disinteresting unless it's aimed at Apple, is for Apple and you're building for Apple. Apple has done nothing cross platform or open source or community oriented so if they come out with something that's intended to be more general is has no base, no users, no audience of non-Apple developers to land on. I'm not anti Apple - I love MacOS and Apple is my main machi…

> 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 or something else though rather than doing their NIH as usual.

Post reply on HN