Hacker Newsnew | past | comments | ask | show | jobs | submit | AlphaCharlie's commentslogin

Yaml is the language nobody needed. All we wanted was a better JSON format that supports comments and doesn’t crash with an extra comma as the end of a list, eg: [1,2,3,]


JSON5 is exactly what you're looking for and has somewhat decent adoption. I use it for configuration on one of my projects and I really enjoy it.


Does it support float NaNs? Only asking because of Python's quirky non-standard implementation


I want multiline strings and references


Have you considered XML?


Or heck, PLists. They have an XML representation that is fairly similar to what JSON can express.

https://en.wikipedia.org/wiki/Property_list


As someone who has tried to parse this crazypants as a side-effect of the old 1Password.opvault, please don't. The idea that one has to //key[text()=="firstname"]/following-sibling::string/text() because they're not nested they're siblings. Insanity


Trailing commas for sure, but I buy the argument that comments would be used to sneak in arbitrary directives and break interoperability. In fact, I’d like to see a less featureful JSON where everything is strings. Trivial parsing, leave interpretation up to the receiver.


For a configuration language, comments are absolutely crucial. You want to be able to say "# This option is set because <so-and-so>" to explain why you are configuring it this way to the next person that reads the code (or you, in the future).

If the price to pay is that there is some risk some dummy might start parsing the comments as code, so be it. This is not a really a problem in "regular" programming languages, I don't see why it would be in a configuration language.


I will start by saying, I completely agree with you!

But, then, I have to behave like a typical computer nerd and say..

Well ackchuallyyyyyy:

  > "This is not a really a problem in "regular" programming languages"
Browsers do stupid: <!--[if IE 8]>

Linux does stupid: #!/bin/bash

C/C++ (preprocessor marcos) do stupid: #ifdef

https://en.wikipedia.org/wiki/Conditional_comment

https://en.wikipedia.org/wiki/Comment_(computer_programming)


I don’t think the Linux one is that stupid, but it might be me.

It’s not a “magic comment” because it doesn’t depend on the runtime. It specifies an interpreter to use, regardless of the language of the file.

Eg you can use #!/usr/bin/python for a Python script. I don’t find it worse than the existing alternative of making the file name magic and finding and interpreter based on that.


It is a magic comment though.

It's a comment ignored by the interpreter (bash, python, whatever).

The kernel just says "Hey! You can't execute a text file, you weirdo! I'll just read the very first line of the text file and if it happens to be a comment that points to another executable, I'll run that and pass it this file."


Macros are not comments.


> This is not a really a problem in "regular" programming languages

https://go.dev/wiki/Comments#directives :-D


They said "regular" programming languages


Comments by themselves provide enough value to justify their supports.

Plus non standard stuff is not a valid argument. As there are many tools which support non standard behaviour, because useful features like comment are considered non standard


In most cases Yaml is bizarre kind of DSL with tricky way of API interaction. For instance - I don't understand why exactly the same Ansible API isn't just python library?


For the same reason any DSL exists: because the programming representation is a lot more verbose than the DSL, due to the computers not currently honoring the "you know what I meant" flag

  #!/usr/bin/env python3
  """A made up example of the line noise"""
  from ansible import *
  def main():
    hosts = ["localhost"]
    for h in hosts:
      run_one_host(h)
  def run_one_host(inventory_hostname: str):
    connection = ansible.builtin.ssh(inventory_hostname)
    print("sniff out the machine's os")
    host_vars = ansible.builtin.setup(gather_subset="os", connection)
    if host_vars["distribution"] == "ubuntu":
      dest = "/etc/apt"
    else ...
      dest = "/etc/something else"
         
    print("do something awesome")
    copy_ok = ansible.builtin.copy(src="./some_file", dest=dest, connection)
    ...

That said, I can't readily imagine why you couldn't do exactly what you said because the AnsibleModule[1] contract is JSON over stdin/stdout (and one can write Ansible modules in any programming language[2] - they just default to Python)

1: https://github.com/ansible/ansible/blob/v2.18.4/lib/ansible/...

2: https://docs.ansible.com/ansible-core/2.18/dev_guide/develop... and https://github.com/ansible/ansible/blob/v2.18.4/test/integra...


python (as much as I personally dislike the language itself) has clean syntax for sets, dicts and arrays. Which are the data structures you use in a playbook. Ansible as python instead of yaml can be made to look very similar to current playbooks. But saner. And easier to script.


Oh, sorry I misunderstood, then. So, closer to the troposphere version of using python to generate json to feed into ansible?


ansible is already written in python. Just eliminate the json/yaml and let us use it from python directly.


Yes, this.


How does a self signed cert protect you from MITm if the iPhone will accept any signed certificate thereafter? There’s no cert pinning AFAIK in imaps.


You'd have to manually trust the MITM cert again? Which you certainly would not do as you know you didn't create a new self-signed cert in that moment.


Can you expand on that subject? What are the traits of warm blooded species that lead to higher cancer rates?


not just higher cancer rates, but higher rates of all kinds of aging-related deaths

the advantage of being warm-blooded is that your metabolism is more precise and much faster, but, as james dean quoted willard motley saying, 'live fast, die young'

most of the causes of aging are unwanted chemical reactions; https://www.cell.com/action/showPdf?pii=S0092-8674%2813%2900... is a highly-cited paper reviewing what we knew about the causes of aging 11 years ago. chemical reactions of all kinds follow the https://en.wikipedia.org/wiki/Arrhenius_equation which makes them happen about 2–3 times faster per 10° temperature rise

(being old is a more important risk factor for cancer than anything else i can think of, even smoking and radioactive fallout)

small sharks around greenland, to take an extreme example, are at essentially the temperature of the seawater, about -1.8°. larger sharks could conceivably raise their internal body temperature, but greenland sharks swim very slowly to avoid this even when they are large. so their metabolism is about 16× slower than yours is—both healing and aging processes happen slower. their gestational period is about 8–18 years


Thank you. This is the kind of thing I was looking for. After posting, I also found out that plants are even further in the other direction because their strong cell walls prevent metasticization.


happy to help! another weird thing is how rare cancers of the skeletal muscles are


That is interesting. I'm currently obsessed with exercise physiology. I might look into that.


Probably constant generation of reactive oxidizing chemicals from the higher metabolism needed to maintain body temperature.


Free PDF file of the research: https://arxiv.org/pdf/2310.09423


No they killed the project a while ago. The goal was to identify if you were watching a video based on the audio.

I assume that the feature was not worth privacy implications and potential fallout.


It is, it was then used regularly across project as a sign that touching this code is very dangerous and should not be done except by the experts of that codebase.

Fun nostalgia to see it out there :)

Note that I doubt anybody ever got fired for modifying these parts of the code. In particular, automatic refactors would have modified these (safely); and it’s a scary warning about negative consequences of messing up.


Cars rarely spontaneously burst in flame and causing a chemical fire taking that takes hours to put out. I am all for safe e-bikes, and these bootleg batteries are dangerous to the population and to the way the population sees this alternative transportation mode.


Looks like another scam.

In the end, who decides who to give money to? You might vote but money has to be distributed to real people, not faceless addresses.

This reads like another rug pull.



That’s correct :)


The binlogs are applied first, then the deletes are emitted.

There’s also support for read after write consistency within a single cluster by adding a canary to the memcache key warning to read from the master replica after the write succeeds, that’s a really cool feature for a multi region eventually consistent system


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: