Skip to content
A static analysis of the network communication of programs in a synchronous subset of Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
codemirror-5.5.0 @ 322a80b
examples-gopherlyzer
examples
src
.gitmodules
.merlin
.ocamlinit
Makefile
README.md
_tags
index.html
index.js
myocamlbuild.ml

README.md

Static analysis prototype for nano-go, a small subset of the full Go programming language. The analysis infers the communication behaviour and content of integer Go programs without running them.

A prototype interface is available here: https://jmid.github.io/nano-go/

The prototype can run purely client side in the browser thanks to both CodeMirror and js_of_ocaml.

When the code is edited the prototype runs in the background (sans webworkers, sorry) and marks the following two categories with a warning:

  • provably failing reads and writes
  • provably dead code

Alternatively it can be run from the command line. Building from scratch requires OCaml.

Currently we support only the following subset of Go:

       e ::= i | ( e ) | x | - e
           | e + e | e - e | e * e | e % e
       b ::= true | false | ! b | ( b )
           | e == e | e <= e | e < e | b && b
recvstmt ::= x = <- ch | <- ch
sendstmt ::= ch <- e
    stmt ::= x = e
           | recvstmt
           | sendstmt
           | if b block else block
           | for [test] block
           | select { selcase* }
           | print(e)
   stmts ::= stmt [;]
           | stmt ; stmts
           | { stmts }
   block ::= { stmts } | {}
 selcase ::= case recvstmt : [stmts]
           | case sendstmt : [stmts]
  chdecl ::= x := make(chan int)
    func ::= go func() { [body] } ()
    body ::= var x int [;] body
           | stmts
    prog ::= package main
             func main() { chdecl+ func+ body }
You can’t perform that action at this time.