Move是一种新的编程语言,旨在为Libra Blockchain提供安全可编程的基础。

组织

Move语言目录由五部分组成:

  • 虚拟机(VM),其中包含的字节码格式,字节码解释器,和基础设施执行事务的块。该目录还包含生成创世块的基础结构。

  • 字节码验证,其中包含了拒绝无效移动字节码静态分析工具。虚拟机在执行它之前遇到的任何新Move代码上运行字节码验证程序。编译器在其输出上运行字节码验证器,并将错误表示给程序员。

  • Move中间表示(IR)编译器,它将人类可读的程序文本编译为Move字节码。警告:IR编译器是一种测试工具。它可以生成将被Move字节码验证器拒绝的无效字节码。IR语法是一项正在进行的工作,将进行重大更改。

  • 标准库,它包含核心系统模块,如移动IR代码LibraAccountLibraCoin

  • 测试虚拟机,字节码验证和编译器。这些测试是在Move IR中编写的,由测试框架运行,该测试框架从注释中编码的特殊指令解析运行测试的预期结果。

Move语言如何适应天秤座核心

Libra Core组件通过VM与语言组件交互。具体地,准入控制组件使用VM功能的有限的只读子集在它们被允许进入mempool和共识之前丢弃无效事务。执行组件使用VM来执行交易的块。

探索MoveIR

目录组织

├── README.md          # This README
├── bytecode_verifier  # The bytecode verifier
├── e2e_tests          # infrastructure and tests for the end-to-end flow
├── functional_tests   # Testing framework for the Move language
├── compiler           # The IR to Move bytecode compiler
├── stdlib             # Core Move modules and transaction scripts
├── test.sh            # Script for running all the language tests
└── vm
    ├── cost_synthesis # Cost synthesis for bytecode instructions
    ├── src            # Bytecode language definitions, serializer, and deserializer
    ├── tests          # VM tests
    ├── vm_genesis     # The genesis state creation, and blockchain genesis writeset
    └── vm_runtime     # The bytecode interpreter

Libra国内开发者微信交流群:

不能入群请加管理微信,拉你进群=>

 
posted on 2019-07-20 01:31  王庆东mas  阅读(285)  评论(0编辑  收藏  举报