Live data from Hacker News

Pkl, a Programming Language for Configuration

pkl-lang.org

61–70 of 598 posts

Re: Pkl, a Programming Language for Configuration

#61

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…

WebKit? FoundationDB?

Re: Pkl, a Programming Language for Configuration

#62

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…

[deleted]

Re: Pkl, a Programming Language for Configuration

#63
post #21

Earlier quoted context omitted.

Python isn't oriented around defining and validating data. For example, something like: "this number is be between 1 and 10" means you have to come up with a novel way to add validation, because it isn't built into the language. Also, Pkl is meant to be usable everywhere. General purpose languages tend to be tied to their own ecosystem--imagine telling a Go developer that they need to install Python, set up virtualen…

> For example, something like: "this number is be between 1 and 10" means you have to come up with a novel way to add validation, because it isn't built into the language. No need for a novel mechanism - there are plenty of available solutions to add validation to python > imagine telling a Go developer that they need to install Python Pkl doesn't come preinstalled on machines - so you'll have to install it as well >…

> This is the real friction point, but is it a bigger friction point than having to adopt yet another DSL?

Yesterday, I created a virtualenv, then ran `pip install`, only to see it fail. I found out that even `pip --version` was failing. I discovered that running `python -m ensurepip --upgrade` would fix pip. It did fix pip, but `pip install` still didn't work properly. I figured out that pip was reporting a different version of python than the one virtualenv is using. Running `python -m pip install --upgrade pip` upgraded pip, which should have been accomplished with the previous ensurepip command. Finally, everything was working properly.

I experienced these problems after years of experience in python. To answer the question. Yes, it's worth adopting yet another DSL than using python.

Re: Pkl, a Programming Language for Configuration

#64
post #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.

And WebKit, which is the rendering engine in Chrome. (Though Google now maintains their own fork).

Re: Pkl, a Programming Language for Configuration

#65

Types on the fields is interesting. The examples suggest said types are lost when you serialise to json or xml, though it seems like at least some types should be expressible as schemas. Language reference doesn't mention schemas either https://pkl-lang.org/main/current/language-reference/index.h...

You are looking for templates: https://pkl-lang.org/main/current/language-tutorial/02_filli... There’s another repo, the Pkl Pantry, that provides a couple of ready made templates (Schemas) that you can try out: https://github.com/apple/pkl-pantry

I was looking for a translation from a pkl template into an xml schema. It would probably be lossy - I think pkl can express more invariants than xml or json schema can - but still gives some invariants on the data for use downstream of the pkl tooling.

Re: Pkl, a Programming Language for Configuration

#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 if LSP support is planned at all?

Re: Pkl, a Programming Language for Configuration

#67

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…

In your example, how is this different than incorrectly creating the data structure in any format ?

I'll be looking into cue, but how does it solve that problem ?

Re: Pkl, a Programming Language for Configuration

#69

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…

Sounds like a job for JSON Schema

https://json-schema.org

Re: Pkl, a Programming Language for Configuration

#70

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…

WebKit? FoundationDB?

I didn't include webkit since it's a forked KHTML, which wasn't theirs.
Post reply on HN