Internal Structure
RefTrace uses Go to parse the Nextflow DSL. The Go code is compiled to a shared object. The shared object is then called by a Python wrapper.
The Go code is a Groovy parser. It follows the internal structure of Groovy's own parser. Any developer familiar with the Groovy AST should be able to modify the Go code.
The Go library does this:
- Treat the .nf file as a Groovy script. All valid Nextflow scripts are valid Groovy scripts.
- Parse the Groovy script into an AST.
- Traverse the AST and extract the modules, processes, and directives.
- Serialize the extracted information as a Protocol Buffer.
Protocol Buffers are used to get around having to pass complex data types between Go and Python.
Python Preference
While the core parsing of Nextflow is done in Go, useful work can be done by developers only familiar with Python.
For example, the CLI is written in Python.
If work can be done in Python, it should be.