nevalang / neva

🌊 Dataflow programming language with static types and implicit parallelism. Compiles to machine code and Go
https://nevalang.org
MIT License
124 stars 7 forks source link

CLI: Add support for new "json" build target #539

Closed Catya3 closed 7 months ago

Catya3 commented 7 months ago

Allows easily debugging the IR using JSON.

Example usage:

$ go run ../cmd/neva/ build --target json 0_do_nothing/without_net_kw
$ cat program.json
{
  "ports": [
    {
      "port_addr": {
        "path": "in",
        "port": "start"
      }
    },
    {
      "port_addr": {
        "path": "out",
        "port": "stop"
      }
    }
  ],
  "connections": [
    {
      "sender_side": {
        "path": "in",
        "port": "start"
      },
      "receiver_sides": [
        {
          "port_addr": {
            "path": "out",
            "port": "stop"
          }
        }
      ]
    }
  ]
}