Config Dialect - oilshell/oil GitHub Wiki

This is now Hay

Use Cases for Hay

Each one is a mix of declarative (key-value pairs) and imperative (shell code)

Build systems

  • Particularly generating Ninja files. Because you need it for the repo, and it's an easier way of unifying shell and make
    • note: does this just print to stdout immediately? it's not generating structured data?
    • existing: cmake, etc.

Distro Package Definitions

  • Debian -- mish-mash of text files and shell
  • Arch Linux -- shell
  • Alpine Linux -- shell where they try to parse shell in shell! (similar to bash auto-completion)
  • Nix -- custom language
  • Guix -- Guile scheme
  • Gentoo -- ebuilds Python

Init Daemon Service Definition

  • systemd -- custom language that embeds shell
  • What does upstart, etc.? use
  • sysvinit is shell scripts with special names -- metadata and names.

Cluster Task Config

  • Kubernetes Config
    • YAML
    • similar to Borg config

App Server Configuration

Difference: These probably don't have shell ? They don't shell out as far as I know. But maybe they can use key-value pairs.

  • Nginx config
    • custom language, which inspired UCL / HCL
  • Bind DNS?

CI Services

  • travis YAML
  • sourcehut YAML
  • Github Actions YAML
  • Gitlab CI YAML

Containers Provisioning (both build and runtime)

  • Custom Dockerfile DSL with shell

VM and infrastructure provisioning

  • Ansible (Python?)
  • Chef / Puppet (Ruby?)
  • Vagrant VM build
    • Ruby DSL

Data Structures / DSLs

  • SVG DSL ?
  • Graphviz?

Languages (not platforms)

  • Awk (predicate / action)
  • Find (predicate / action)
  • Make (graph
  • lexers / parsers
    • re2c, yacc, etc .
  • Stretch:
    • schema languages (protobuf, ASDL) -- this could cause nesting?
      • ASDL in Oil / Tea would be cool but I think it requires custom syntax ... for type definitions
    • State machine dialects?
      • P language?
    • Annotations like the pash and posh optimizers use: https://github.com/oilshell/oil/issues/867

Summary of Use Cases by Existing Language

  • Custom languages
    • CMake
    • Starlark for Bazel, etc.
    • Nix
    • Nginx
  • YAML
    • all CI services and Kubernetes
  • Ruby and Python
    • Chef / Puppet / Ansible
  • Mix of shell and tiny files / comments / hacks
    • Linux distros

Concrete Examples of Configuraiton + Shell

Appendix: Oil Builtins Using Blocks (not config)

  • fork, forkwait, cd
  • shopt, shvar
  • push-registers
  • try
  • argparse, describe