Better HN
topnewbestaskshowjobs
Log inSign up

bdubbeldam

4 karma · joined Sep 13, 2025 (1y ago) · 3 submissions

KSON Developer. Feel free to get in touch through the KSON Zulip: https://kson-org.zulipchat.com/
Submissions

comment 1y ago · link · parent

We agree that there are lots of situations where code ideally does not belong in configuration files, and perhaps if it gets out of hand you need to rethink your software architecture.

However, reality shows that embedded code in configs is already widespread - think SQL queries in dbt, bash scripts in CI/CD configs, or regex patterns in routing rules. These aren't going away. KSON's embed blocks acknowledge this reality while making it safer and more maintainable through proper syntax highlighting, validation, and clear boundaries. We're not encouraging bad practices, we're providing better tooling for existing patterns.

comment 1y ago · link · parent

That's a great idea, we've just added it to the playground. Here's the KSON, much of YAML's leanness and simplicity without the footguns:

  server_config:
    port_mapping:
    # Expose only ssh and http to the public internet.
      - '22:22'
      - '80:80'
      - '443:443'
    serve:
      - '/robots.txt'
      - '/favicon.ico'
      - '*.html'
      - '*.png'
      # Do not expose our Git repository to the entire world.
      - '!.git'
    geoblock_regions:
      # The legal team has not approved distribution in the Nordics yet.
      - dk
      - fi
      - is
      - no
      - se
    flush_cache:
      on: [push, memory_pressure]
      priority: background
      .
    allow_postgres_versions:
      - '9.5.25'
      - '9.6.24'
      - '10.23'
      - '12.13'
Testing this actually helped us catch a bug - of course our transpiler hits the Norway problem when converting to YAML. Thanks for helping us with the beta! Fix coming soon.

comment 1y ago · link · parent

K stands for KSON. Soft spot for recursive acronyms!