|
1 | | -# Gaia 多平台汇编器 |
| 1 | +# Gaia Multi-Platform Assembler |
2 | 2 |
|
3 | | -Gaia 是一个现代化的多平台汇编器项目,旨在为不同的目标平台提供统一、人类工程学的汇编语言前端。 |
| 3 | +Gaia is a modern multi-platform assembler project designed to provide a unified, ergonomic assembly language frontend for different target platforms. |
4 | 4 |
|
5 | | -## 🎯 项目概述 |
| 5 | +## 🎯 Project Overview |
6 | 6 |
|
7 | | -Gaia 项目包含以下核心组件: |
| 7 | +The Gaia project contains the following core components: |
8 | 8 |
|
9 | | -- **gaia-frontend**: Rust 核心库,提供汇编器的主要功能 |
10 | | -- **gaia-frontend-wasm32**: WebAssembly 前端,支持在浏览器和 Node.js 环境中运行 |
11 | | -- **示例项目**: 包含 mini-go 和 mini-ts 等示例实现 |
| 9 | +- **gaia-frontend**: Rust core library, providing the main functionality of the assembler. |
| 10 | +- **gaia-frontend-wasm32**: WebAssembly frontend, supporting execution in browser and Node.js environments. |
| 11 | +- **Example Projects**: Includes example implementations such as mini-go and mini-ts. |
12 | 12 |
|
13 | | -## 🏗️ 项目结构 |
| 13 | +## 🏗️ Project Structure |
14 | 14 |
|
15 | 15 | ``` |
16 | 16 | gaia.ts/ |
17 | 17 | ├── projects/ |
18 | | -│ ├── gaia-frontend/ # Rust 核心库 |
19 | | -│ └── gaia-frontend-wasm32/ # WASM32 前端包 |
| 18 | +│ ├── gaia-frontend/ # Rust core library |
| 19 | +│ └── gaia-frontend-wasm32/ # WASM32 frontend package |
20 | 20 | ├── examples/ |
21 | | -│ ├── mini-go/ # Go 语言示例 |
22 | | -│ └── mini-ts/ # TypeScript 示例 |
23 | | -├── Cargo.toml # Rust 工作区配置 |
24 | | -└── License.md # 项目许可证 |
| 21 | +│ ├── mini-go/ # Go language example |
| 22 | +│ └── mini-ts/ # TypeScript example |
| 23 | +├── Cargo.toml # Rust workspace configuration |
| 24 | +└── License.md # Project license |
25 | 25 | ``` |
26 | 26 |
|
27 | | -## 🚀 快速开始 |
| 27 | +## 🚀 Quick Start |
28 | 28 |
|
29 | | -### 环境要求 |
| 29 | +### Prerequisites |
30 | 30 |
|
31 | | -- **Rust**: 最新稳定版本 |
32 | | -- **Node.js**: 18.0 或更高版本 |
33 | | -- **wasm32-wasip2 目标**: 用于 WASM 构建 |
| 31 | +- **Rust**: Latest stable version |
| 32 | +- **Node.js**: 18.0 or higher |
| 33 | +- **wasm32-wasip2 target**: For WASM builds |
34 | 34 |
|
35 | | -### 安装步骤 |
| 35 | +### Installation Steps |
36 | 36 |
|
37 | | -1. **克隆项目** |
| 37 | +1. **Clone the project** |
38 | 38 | ```bash |
39 | 39 | git clone https://github.com/nyar-vm/project-gaia |
40 | 40 | cd gaia.ts |
41 | 41 | ``` |
42 | 42 |
|
43 | | -2. **添加 WASM 目标** |
| 43 | +2. **Add WASM target** |
44 | 44 | ```bash |
45 | 45 | rustup target add wasm32-wasip2 |
46 | 46 | ``` |
47 | 47 |
|
48 | | -3. **构建项目** |
| 48 | +3. **Build the project** |
49 | 49 | ```bash |
50 | | - # 构建 Rust 核心库 |
| 50 | + # Build Rust core library |
51 | 51 | cargo build --release |
52 | 52 |
|
53 | | - # 构建 WASM32 前端(可选) |
| 53 | + # Build WASM32 frontend (optional) |
54 | 54 | cd projects/gaia-frontend-wasm32 |
55 | 55 | npm install |
56 | 56 | npm run build |
57 | 57 | ``` |
58 | 58 |
|
59 | | -## 📦 核心组件 |
| 59 | +## 📦 Core Components |
60 | 60 |
|
61 | 61 | ### gaia-frontend |
62 | 62 |
|
63 | | -Rust 核心库,提供以下功能: |
| 63 | +Rust core library, providing the following features: |
64 | 64 |
|
65 | | -- **汇编器 (Assembler)**: 将汇编代码转换为目标平台代码 |
66 | | -- **元数据 (Metadata)**: 处理汇编元数据和调试信息 |
67 | | -- **工具函数 (Utils)**: 提供各种实用工具函数 |
68 | | -- **简易测试 (Easy Test)**: 简化测试流程的工具 |
| 65 | +- **Assembler**: Converts assembly code into target platform code. |
| 66 | +- **Metadata**: Handles assembly metadata and debugging information. |
| 67 | +- **Utilities**: Provides various practical utility functions. |
| 68 | +- **Easy Test**: Tools to simplify the testing process. |
69 | 69 |
|
70 | 70 | ### gaia-frontend-wasm32 |
71 | 71 |
|
72 | | -WebAssembly 前端包,特点: |
| 72 | +WebAssembly frontend package features: |
73 | 73 |
|
74 | | -- 基于 WebAssembly 技术,支持跨平台运行 |
75 | | -- 提供 JavaScript/TypeScript API |
76 | | -- 支持在浏览器和 Node.js 环境中使用 |
77 | | -- 包含完整的类型定义文件 |
| 74 | +- Based on WebAssembly technology, supporting cross-platform execution. |
| 75 | +- Provides JavaScript/TypeScript API. |
| 76 | +- Supports usage in browser and Node.js environments. |
| 77 | +- Includes complete type definition files. |
78 | 78 |
|
79 | | -## 🧪 示例项目 |
| 79 | +## 🧪 Example Projects |
80 | 80 |
|
81 | 81 | ### mini-go |
82 | 82 |
|
83 | | -演示如何使用 Gaia 汇编器处理 Go 语言风格的语法: |
| 83 | +Demonstrates how to use the Gaia assembler to handle Go-style syntax: |
84 | 84 |
|
85 | | -- 词法分析器 (Lexer) |
86 | | -- 语法分析器 (Parser) |
87 | | -- 抽象语法树 (AST) |
88 | | -- 代码生成器 (Code Generator) |
| 85 | +- Lexer |
| 86 | +- Parser |
| 87 | +- AST (Abstract Syntax Tree) |
| 88 | +- Code Generator |
89 | 89 |
|
90 | 90 | ### mini-ts |
91 | 91 |
|
92 | | -TypeScript 版本的类似实现,展示不同语言前端的集成方式。 |
| 92 | +A similar implementation in TypeScript, showing how different language frontends can be integrated. |
93 | 93 |
|
94 | | -## 🔧 开发指南 |
| 94 | +## 🔧 Development Guide |
95 | 95 |
|
96 | | -### 运行测试 |
| 96 | +### Running Tests |
97 | 97 |
|
98 | 98 | ```bash |
99 | | -# Rust 测试 |
| 99 | +# Rust tests |
100 | 100 | cargo test |
101 | 101 |
|
102 | | -# WASM32 前端测试 |
| 102 | +# WASM32 frontend tests |
103 | 103 | cd projects/gaia-frontend-wasm32 |
104 | 104 | npm test |
105 | 105 |
|
106 | | -# 示例项目测试 |
| 106 | +# Example project tests |
107 | 107 | cd examples/mini-go |
108 | 108 | npm test |
109 | 109 | ``` |
110 | 110 |
|
111 | | -### 构建发布版本 |
| 111 | +### Building Release Version |
112 | 112 |
|
113 | 113 | ```bash |
114 | | -# Rust 发布构建 |
| 114 | +# Rust release build |
115 | 115 | cargo build --release |
116 | 116 |
|
117 | | -# WASM32 发布包 |
| 117 | +# WASM32 release package |
118 | 118 | cd projects/gaia-frontend-wasm32 |
119 | 119 | npm run build |
120 | 120 | ``` |
121 | 121 |
|
122 | | -## 📄 许可证 |
| 122 | +## 📄 License |
123 | 123 |
|
124 | | -本项目采用 MPL-2.0 许可证,详见 [License.md](License.md) 文件。 |
| 124 | +This project is licensed under the MPL-2.0 License, see the [License.md](License.md) file for details. |
125 | 125 |
|
126 | | -## 🤝 贡献指南 |
| 126 | +## 🤝 Contribution Guide |
127 | 127 |
|
128 | | -欢迎贡献代码!请遵循以下步骤: |
| 128 | +Contributions are welcome! Please follow these steps: |
129 | 129 |
|
130 | | -1. Fork 项目仓库 |
131 | | -2. 创建功能分支 (`git checkout -b feature/amazing-feature`) |
132 | | -3. 提交更改 (`git commit -m 'Add some amazing feature'`) |
133 | | -4. 推送到分支 (`git push origin feature/amazing-feature`) |
134 | | -5. 创建 Pull Request |
| 130 | +1. Fork the repository |
| 131 | +2. Create a feature branch (`git checkout -b feature/amazing-feature`) |
| 132 | +3. Commit your changes (`git commit -m 'Add some amazing feature'`) |
| 133 | +4. Push to the branch (`git push origin feature/amazing-feature`) |
| 134 | +5. Create a Pull Request |
135 | 135 |
|
136 | | -## 📞 联系方式 |
| 136 | +## 📞 Contact |
137 | 137 |
|
138 | | -- **项目团队**: Gaia Team <team↯gaia-project.org> |
139 | | -- **仓库地址**: https://github.com/nyar-vm/project-gaia |
140 | | -- **文档地址**: https://docs.rs/gaia-frontend |
| 138 | +- **Project Team**: Gaia Team <team↯gaia-project.org> |
| 139 | +- **Repository**: https://github.com/nyar-vm/project-gaia |
| 140 | +- **Documentation**: https://docs.rs/gaia-frontend |
141 | 141 |
|
142 | 142 | --- |
143 | 143 |
|
144 | | -**Gaia** - 让汇编语言开发更加人性化、现代化! |
| 144 | +**Gaia** - Making assembly language development more human and modern! |
0 commit comments