And....<number of languages supported>++!
Cubix now supports Sui Move, the smart contract language of the Sui blockchain. This is made possible thanks to our new integration with Tree-Sitter, which paves the way for a lot more languages. (Also, you really do not want to use Tree-sitter directly for program analysis or transformation].)
This is a basic syntax-only support; control-flow graphs are still coming. But it's enough to perform many useful transformations and syntactic analyses.
And because this is Cubix: if you also have tools that work on C, Java, JavaScript, Lua, Python, or Solidity, many of them will now work on Sui Move too, for free.
The cubix-sui-move package ships with 10 example analyses and transformations. Some are fully language-generic and work unchanged on all seven Cubix-supported languages. Others are Sui-Move-specific, or mix generic and language-specific logic. They range from listing identifiers and renaming variables to finding unused imports and summarizing struct abilities.
Sui Move support is available in the cubix-sui-move package. Build it with:
cabal build cubix-sui-move
Then run any of the examples with cabal run:
cabal run sui-move-examples -- sort-functions myfile.move
cabal run sui-move-examples -- unused-imports myfile.move
# See docs for the full list
If you already have Cubix tools that work on other languages, try pointing them at .move files — many generic ones will just work.
We have validated Cubix's Sui Move support against a corpus of ~1.5 million lines of real-world Sui Move code, drawn from over 100 open-source projects. The corpus is available at cubix-framework/sui-move-test-corpus.
The corpus achieves 100% node-pair coverage: every attainable pair of grammar nodes is represented in at least one file. Node-pair coverage is important because, by the power of composition, if a tool works correctly for all pairs of grammar nodes, it is very likely to work correctly for all programs. This is the same testing methodology that Semantic Designs used to translate 1.5 million lines of B-2 stealth bomber flight software from JOVIAL to C — perfectly on the first try, without ever being allowed to see their source code.
For questions or feedback, reach out on the mailing list or contact us directly.