|
|
|
|
|
by mccanne
460 days ago
|
|
Nice article! Decoding sum types into Go interface values is obviously tricky stuff, but it gets even harder when you have recursive data structures as in an abstract syntax tree (AST). The article doesn't address this. Since there wasn't anything out there to do this, we built a little package called "unpack" as part of the SuperDB project. The package is here... https://github.com/brimdata/super/blob/main/pkg/unpack/refle... and an example use in SuperDB is here... https://github.com/brimdata/super/blob/main/compiler/ast/unp... Sorry it's not very well documented, but once we got it working, we found the approach quite powerful and easy. |
|
https://superdb.org/docs/formats/data-model/#25-union