当前位置:首页 > 报告详情

陈研-RustConfChina2023.pdf

上传人: 2*** 编号:132031 2023-06-30 35页 1.35MB

1、第三届中国Rust开发者大会Candid:the interface description language of the Internet Computer smart contractsYan ChenDFINITY FoundationRust China Conf 2023 How DFINITY uses procedure macro to extend RustOverviewOverview Macro system is a hidden gem in Rust.We share our experience in safely extending Rust languag

2、es without modifying the compiler.Running example:Candid,a strongly typed serialization library Extended language features:Backward compatible API upgrades with subtyping Type reflection Structural typingMotivationMotivation How to maintain interoperability between microservices?MotivationMotivation

3、 How to maintain interoperability between microservices?UpgradeMotivationMotivation How to maintain interoperability between microservices?APIs are allowed to evolve without breaking existing client Wire format contains type information Decoder knows two types:wire type,and expected typeServing API

4、v2Client only knows API v1Send v1 dataDecode v1 as v2Send v2 resultDecode v2 as v1MotivationMotivation How to maintain interoperability between microservices?APIs are allowed to evolve without breaking existing client Wire format contains type information Decoder knows two types:wire type,and expect

5、ed typeServing API v2Client only knows API v1Send v1 dataDecode v1 as v2Send v2 resultDecode v2 as v1ContravarianceCovarianceSubtyping and safe upgradesSubtyping and safe upgrades Outbound data(provided by service)can upgrade to more specific data Inbound data(required by service)can upgrade to more

6、 general data Orientation is inverted for higher order functionsv3v2v1v1v2v3f :Send(record age=42:nat8)Send(record name=”Admin”;age=42:nat8)ExampleExampletype Profile=record name:text;service:getProfile:(nat)-(Profile);API v1type Profile=record name:text;age:nat8;service:getProfile:(nat)-(Profile);A

word格式文档无特别注明外均可编辑修改,预览文件经过压缩,下载原文更清晰!
三个皮匠报告文库所有资源均是客户上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作商用。
本文介绍了第三届中国Rust开发者大会的主题演讲内容,重点关注了DFINITY基金会开发的Candid接口描述语言,以及如何在Rust中实现类型反射。Candid是一种强类型序列化库,支持类型升级和反射,适用于互联网计算机智能合约。文章还讨论了如何通过过程宏扩展Rust语言,以及如何将Candid类型转换为Rust类型。最后,文章提到了DFINITY的Rust SDK,用于在互联网计算机上开发智能合约,并指出DFINITY已经完成了复杂的工作,以便开发者可以轻松使用。
"Rust SDK如何扩展互联网计算机的智能合约功能?" 如何在Rust中实现强类型序列化库?" "如何使用Rust和Candid实现类型反射和接口描述?"
客服
商务合作
小程序
服务号
折叠