TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Apple Pkl

111 pointsby fofozabout 1 year ago

13 comments

taywrobelabout 1 year ago
Previously posted by one of the authors here - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=39232976">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=39232976</a>
评论 #39474591 未加载
spazxabout 1 year ago
I want to verbally pronounce this &quot;Apple Pickle&quot;. Is that intended?
评论 #39473866 未加载
fb03about 1 year ago
Anyone has opinions on this versus &quot;Dhall&quot;?<p>Dhall seems to be explicitly total (non-turing complete) while Pkl seems to be Turing Complete, hence dangerous as you can basically compute anything
评论 #39476256 未加载
seabassabout 1 year ago
This looks promising! I like that the template file also defines constraints at compile time, and that there is codegen to make it easy to work with pkl files well-typed in a decent variety of languages.<p>The tutorial is also nicely written. Props to Apple for writing really good docs on this one! The error messages it produces also look pretty good.<p>It would be nice if they added compiled equivalents of each code snippet from the tutorial in other formats, though, since it wasn&#x27;t immediately clear how certain types (like `duration: Duration = 30.min`) would be represented in JSON.<p>If anyone at Apple is reading this, another thing that would make it much easier to evaluate and decide whether to adopt pkl would be to include an online compiler with a few built-in examples so that anyone can quickly see how the configuration is transformed without delving into the full docs.
评论 #39478377 未加载
mholtabout 1 year ago
I wrote a config adapter for Caddy so you can write your Caddy configs with Pkl: <a href="https:&#x2F;&#x2F;github.com&#x2F;caddyserver&#x2F;pkl-adapter">https:&#x2F;&#x2F;github.com&#x2F;caddyserver&#x2F;pkl-adapter</a><p>The big gotcha is it&#x27;s only implemented in Java. So any language bindings have to shell out to a subprocess to actually do any work.
评论 #39474532 未加载
评论 #39474940 未加载
CodeWriter23about 1 year ago
Will it accept input from tcl?
评论 #39474156 未加载
behnamohabout 1 year ago
Why is it posted under &quot;&#x2F;apple&#x2F;&quot; but MLX is posted under &quot;&#x2F;mlx-explore&#x2F;&quot;?
评论 #39474694 未加载
midnitewarriorabout 1 year ago
This looks like a winner to me.<p>I haven&#x27;t had a chance to use it yet, but it addresses some gaps in validation for JSON, YAML and other configuration files and I appreciate their approach to the problem. I look forward to using it the next time I have a system with JSON that&#x27;s unwieldy.
评论 #39474542 未加载
willsmith72about 1 year ago
&gt; port: Int(this &gt; 1000) = 80<p>Yeah that looks pretty useful.<p>In JavaScript land, I just do this with zod to crash the server on startup, but I can&#x27;t remember if there&#x27;s already an easy way to do it with the java&#x2F;kotlin&#x2F;gos
imbnwaabout 1 year ago
If JS had that pattern for hiding `this` and facilitating late-binding like that would it have still needed the `class` keyword?
评论 #39474652 未加载
评论 #39474676 未加载
eobabout 1 year ago
This has some pretty great ideas within it. A few that stuck out to me in case others don&#x27;t want to skim the full spec:<p>Start with YAML&#x2F;JSON&#x2F;TOML, but then add:<p>- Optionally strict typing and structs<p>- Inheritance<p>- Dynamically computed properties<p>- Functions &amp; object methods, which are really more like computer properties<p>- If&#x2F;Else conditionals, which are really more like a ternary<p>.. and managed to do it while still making it look like a simple config file.<p>The closest analogue from memory might actually be Terraform.<p>The one thing that had me squinting was the object extension syntax. It looks powerful.. and I understand its value.. but wow that&#x27;s ends up being eye-full of () {} and [] all in one code bock.
评论 #39493683 未加载
codetrotterabout 1 year ago
See also <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=39232976">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=39232976</a>
galoisscobiabout 1 year ago
Sucks that there’s no rust or python support.
评论 #39474979 未加载