Abusing Conda's Turing-Complete YAML Comments
astrid.tech
astrid.tech
Is there some way that new recipes are auto-parsed by every client?
But the dysfunction in Python packaging is nothing new. Everything with adoption appeals to the lowest common denominator.
Another POV is that “code conductors” have always vastly outnumbered actual programmers, but now that Python is ChatGPT’s expertise, does packaging matter? People will use whatever packages the LLM’s really cool notebook interface ships with, and nothing more. The environment doesn’t even have access to the Internet, and yet: here we are. The next 20 million Python developers - almost outnumbering all professional programmer combined - are going to get away with literally never installing a package.
(If I'm reading this correctly, they may have their own "YAML" parser entirely -- multiple keys with different values shouldn't be distinctly represent-able in a normal YAML document, at least not after parsing.)
I don't think they have their own YAML parser - the preprocessor just strips out lines whose magic comments return False.
Notably, not JSON. In fact JSON doesn't support comment specifically to prevent this. And YAML was created specifically to add comments to JSON, in violation of this precaution. So YAML can eat the lunch that it serve itself.
They were mainly concerned about interoperability but partially yes.
Source: https://web.archive.org/web/20190112173904/https://plus.goog...
The Norway problem, anchors & references, infinite ways to begin a multi-line string, on the other hand, are all legitimate grievances that are somewhat unique to YAML.
Edit: And note: what makes this hack bizarre is that they chose to do it in comments, despite YAML having ample syntax for an inline dictionary or whatever else. YAML offers all kinds of exquisitely complicated ropes to hang yourself with, and they chose plain old boring comments!
[1]: https://json-schema.org/understanding-json-schema/reference/...
I've never seen someone try to template JSON or XML like this. About the closest is HTML templating but even that is not really the best way these days.
At least they support ~=3.9 and >=1,<3 comparisons (although this is undocumented as far as I can tell.
You can view the PR and it waits for you to review and merge the changes to the YAML, but my god those diffs are becoming harder to grok.