How to use "cowsay" project in my project?

The vision was always that you could just write

import CowSay "ic:7igbu-3qaaa-aaaaa-qaapq-cai";

in your Motoko file, and the development tools would do the rest for you (in particular, fetch that canister’s Candid file to find out the type of CowSay), but this feature never had highest priority, would have required cross-component coordination (moc and dfx, maybe replica) and there were opiniated differences on how to best do that under the hood, so it never happened. But the work-around pointed out by Ori is good enough™ for many cases.

(In fact, the Motoko compiler in moc already implements all that’s needed, as specified here. So the Motoko playground and/or dfx could add that feature on their side, and it would “just work”.)

2 Likes