Compiling sharding implementation