An investigation into using MoveVM within Go for the purpose of Cadence compilation.
This repo requires a local version of https://github.com/RZhang05/aptos-core/tree/composite-cadence in the same parent directory as this repo as specified in lib/sample/Cargo.toml.
This repo consists of a main Go library which calls into a nested Rust library which calls into a nested Go library. This means that there are some complications with linking and the build process. This was built on linux.
- The innermost Go library cannot be static because this will cause multiple definition errors in the linker for cgo functions.
Changes required
- replace
libsample.sowithlibsample.dylibin theMakefile - potentially build
go_libfirst, theMakefileshould handle this - copy
libmain.dylibto the root directory
https://docs.google.com/spreadsheets/d/1YDnU5YkEs8il2slYY5la9HXc5xMfxzUJNEITadL5_iU/edit?usp=sharing
git clone https://github.com/RZhang05/cadence_movevm.git
cd cadence_movevmmake
cd cadence_movevm/lib/samplecargo benchcargo flamegraph -c "record -c 20 --call-graph dwarf -g"(optional)perf record -c 90 --call-graph dwarf -g ./target/debug/sample