Skip to content

Commit

Permalink
chore: reorganize the documents
Browse files Browse the repository at this point in the history
  • Loading branch information
jianzs committed Dec 28, 2023
1 parent b60e87a commit 0d5da86
Show file tree
Hide file tree
Showing 44 changed files with 133 additions and 27 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ The key difference between Pluto and other products is that it uses program anal
- Compared to SDK-based IfC products like Shuttle and Nitric, Pluto obtains resource dependencies of applications through static program analysis rather than executing user code.
- Both Winglang and Pluto are IfC products based on programming languages, but compared to Winglang, Pluto generates IaC code independent of the user code, so that the code executed at compile time is not directly related to the user code.

You can learn more about the differences with other project [here](./docs/en/whats-different.md).
You can learn more about the differences with other project [here](./docs/documentation/whats-different.en.md).

## 🚀 Quick Start

Expand Down Expand Up @@ -129,13 +129,13 @@ npm install # install the depnedencies
pluto deploy # shoot!
```

For detailed steps, please refer to the [Getting Started Guide](./docs/en/getting-started.md).
For detailed steps, please refer to the [Getting Started Guide](./docs/documentation/getting-started.en.md).

> Currently, Pluto is limited to supporting single-file applications. Within each handler function, it is possible to access literal constants and regular functions that exist outside the scope of the handler function. However, accessing variables (except for resource variables), classes, interfaces is not currently supported.
## 👏 Contributing

Pluto is currently in the PoC stage, and we welcome interested people to contribute. Whether it is suggestions or ideas about the problems Pluto aims to solve, the features it provides, or code implementation, you can participate in the community to build together. Check out the project [contribution guide](./docs/dev_guide/dev_guide.md).
Pluto is currently in the PoC stage, and we welcome interested people to contribute. Whether it is suggestions or ideas about the problems Pluto aims to solve, the features it provides, or code implementation, you can participate in the community to build together. Check out the project [contribution guide](./docs/dev_guide/dev_guide.en.md).

## 🐎 Roadmap

Expand Down
8 changes: 4 additions & 4 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Pluto 是一种新型开源编程语言,旨在帮助开发者编写云应用

## 🤯 痛点

[从这里可以了解我们为什么要做 Pluto](./docs/zh-CN/what-problems-pluto-aims-to-address.md),简单讲,我们想解决几个你或许经常遇到的痛点。
[从这里可以了解我们为什么要做 Pluto](./docs/documentation/what-problems-pluto-aims-to-address.zh-CN.md),简单讲,我们想解决几个你或许经常遇到的痛点。

- **上手门槛高**:开发一个云应用程序需要同时掌握业务与基础设施两种技术栈,同时又很难测试和调试,导致开发者在编写业务之外耗费了大量精力。
- **架构选型难**:目前云服务提供商提供了数百种能力选项,Kubernetes 更是有无穷尽的能力组合,普通开发者难以针对自身的业务确定一个合适的架构选型。
Expand All @@ -65,7 +65,7 @@ Pluto 是一种新型开源编程语言,旨在帮助开发者编写云应用

整体上,Pluto 首先从用户代码中推导出所需云资源及资源间依赖关系,构建云参考架构(architecture reference)。然后,依据 arch ref 生成一份独立于用户代码的 IaC 代码,并将用户代码拆分成多个业务模块。最终,由 IaC 引擎适配器根据 IaC 代码的类型调用相应 IaC 引擎执行部署,将应用程序发布到指定的云平台上。整个流程中,推导器、生成器、适配器都是可替换的,以此来支持更多不同的推导、生成方式和 IaC 引擎。

可以在[这篇文章](./docs/zh-CN/how-pluto-works.md)中详细了解 Pluto 的工作流程。
可以在[这篇文章](./docs/documentation/how-pluto-works.zh-CN.md)中详细了解 Pluto 的工作流程。

## 🤔️ 与其他项目的不同?

Expand All @@ -78,7 +78,7 @@ Pluto 与其他产品的关键区别在于:它利用程序分析技术直接
- 与基于 SDK 的 IfC 产品(如 Shuttle、Nitric)相比,Pluto 通过静态程序分析获取应用的资源依赖,而不是通过执行用户代码来获取。
- Winglang 和 Pluto 都属于基于编程语言的 IfC 产品,但与 Winglang 相比,Pluto 会生成独立于用户代码的 IaC 代码,使得编译时执行的代码与用户代码没有直接关联。

可以在[这篇文档](./docs/zh-CN/whats-different.md)中详细了解与其他产品的不同之处。
可以在[这篇文档](./docs/documentation/whats-different.zh-CN.md)中详细了解与其他产品的不同之处。

## 🚀 快速开始

Expand Down Expand Up @@ -129,7 +129,7 @@ npm install # 下载依赖
pluto deploy # 一键部署!
```

详细步骤可以参考[上手指南](./docs/zh-CN/getting-started.md)
详细步骤可以参考[上手指南](./docs/documentation/getting-started.zh-CN.md)

> 目前,Pluto 只支持单文件。在每个处理程序函数中,支持访问处理程序函数作用域之外的字面量常量与普通函数,尚不支持访问变量(资源变量除外)、类、接口等。
Expand Down
Binary file added assets/getting-started-aws-arch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/getting-started-case-arch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions docs/_meta.en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"index": {
"title": "Home",
"type": "page",
"theme": {
"typesetting": "article"
}
},
"documentation": {
"title": "Documentation",
"type": "page"
},
"blogs": {
"title": "Blog",
"type": "page"
},
"dev_guide": {
"title": "Developer's Guide",
"type": "page"
}
}
21 changes: 21 additions & 0 deletions docs/_meta.zh-CN.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"index": {
"title": "首页",
"type": "page",
"theme": {
"typesetting": "article"
}
},
"documentation": {
"title": "文档",
"type": "page"
},
"blogs": {
"title": "博客",
"type": "page"
},
"dev_guide": {
"title": "开发者指南",
"type": "page"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Envisioning a Cloud-Native Application Development Paradigm

![cover](../../../assets/231227-cover.png)
![cover](../../assets/231227-cover.png)

## Background

Expand All @@ -22,7 +22,7 @@ But does the development approach of microservices and containers still hold up

In essence, the development model directly based on FaaS is less than ideal, posing significant challenges in managing and coordinating functions effectively. Naturally, we seek a better experience in application development. It is with this in mind that a new concept is introduced: **Monolithic Programming, Compile-Time Splitting, and Distributed Execution**.

![principle](../../../assets/231227-step.png)
![principle](../../assets/231227-step.png)

## Conceptual Analogies

Expand Down Expand Up @@ -101,7 +101,7 @@ async function main() {
main();
```

![show case](../../../assets/231227-case.png)
![show case](../../assets/231227-case.png)

The execution of this code is expected to manifest as illustrated above:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 云原生应用开发模式的一个构想

![cover](../../../assets/231227-cover.png)
![cover](../../assets/231227-cover.png)

## 背景

Expand All @@ -22,7 +22,7 @@

整体来说,直接基于 FaaS 的开发模式体验较差,如何有效管理和协调这些函数成为了一个重要问题。显然,我们不希望开发一个应用程序是这种体验,那么,我们该如何开发云原生应用呢?在这里提出一个构想:**单体式编程,编译时拆分,分布式执行**

![principle](../../../assets/231227-step.png)
![principle](../../assets/231227-step.png)

## 联想

Expand Down Expand Up @@ -101,7 +101,7 @@ async function main() {
main();
```

![show case](../../../assets/231227-case.png)
![show case](../../assets/231227-case.png)

这份代码执行起来的预期效果应该像上面这张图展示的:

Expand Down
9 changes: 9 additions & 0 deletions docs/blogs/_meta.en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"*": {
"theme": {
"typesetting": "article"
}
},
"231227-envisioning-a-cloud-native-application-development-paradigm": "Envisioning a Cloud-Native Application Development Paradigm",
"has-cloud-evolved-into-infra": "Has the Cloud Truly Evolved into Infrastructure?"
}
9 changes: 9 additions & 0 deletions docs/blogs/_meta.zh-CN.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"*": {
"theme": {
"typesetting": "article"
}
},
"231227-envisioning-a-cloud-native-application-development-paradigm": "云原生应用开发模式的一个构想",
"has-cloud-evolved-into-infra": "云真的成为基础设施了吗?"
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Developers can continue defining variables required for their applications and w

![](http://cdn.zhengsj.cn/ob-1698301951197.png)

The main idea behind this is to deduce the cloud resources that an application depends on from the user code, as well as the dependencies between resources. This builds a cloud resource topology, which serves as an architecture reference for the cloud environment. By further splitting and rewriting the user code, multiple computing modules can be exported that depend on this architecture reference. With this architecture reference as a basis, we are able to generate infrastructure code that is **not directly related to the user code**, but includes definitions of resources and deployment of computing modules. Finally, executing this infrastructure code creates and deploys a runtime environment for running applications in the cloud. You can learn more about this workflow in [this article](https://github.com/pluto-lang/pluto/blob/main/docs/en/how-pluto-works.md).
The main idea behind this is to deduce the cloud resources that an application depends on from the user code, as well as the dependencies between resources. This builds a cloud resource topology, which serves as an architecture reference for the cloud environment. By further splitting and rewriting the user code, multiple computing modules can be exported that depend on this architecture reference. With this architecture reference as a basis, we are able to generate infrastructure code that is **not directly related to the user code**, but includes definitions of resources and deployment of computing modules. Finally, executing this infrastructure code creates and deploys a runtime environment for running applications in the cloud. You can learn more about this workflow in [this article](../documentation/how-pluto-works.en.md).

The key to ensuring an exceptional development experience for users lies in the separation between compile-time executed code and user code. Developers should not need to specify during development which parts of their code are meant for compile-time execution versus runtime execution.

Expand Down Expand Up @@ -77,6 +77,6 @@ Here are a few more example applications:

## References

- [How Pluto Works](https://github.com/pluto-lang/pluto/blob/main/docs/en/how-pluto-works.md)
- [What Problem does Pluto Solve?](https://github.com/pluto-lang/pluto/blob/main/docs/en/what-problems-pluto-aims-to-address.md)
- [Differences between Pluto and other Products](https://github.com/pluto-lang/pluto/blob/main/docs/en/whats-different.md)
- [How Pluto Works](../documentation/how-pluto-works.en.md)
- [What Problem does Pluto Solve?](../documentation/what-problems-pluto-aims-to-address.en.md)
- [Differences between Pluto and other Products](../documentation/whats-different.en.md)
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ router.get("/hello", async (req: HttpRequest): Promise<HttpResponse> => {

![](http://cdn.zhengsj.cn/ob-1698301951197.png)

这背后的主要思路是:从用户代码中推导出应用程序所依赖的云资源,以及资源间的依赖关系,构建出云资源拓扑图,也就是针对云环境的参考架构(Architecture Reference)。进一步对用户代码进行拆分、改写,导出多个计算模块,同时依赖于参考架构,可以生成一份**与用户代码不直接相关**的基础设施代码,其中包含对资源的定义与计算模块的发布。最终,执行这份基础设施代码就能创建与部署应用程序在云上的运行环境。可以在[这篇文章](https://github.com/pluto-lang/pluto/blob/main/docs/zh-CN/how-pluto-works.md)中了解详细的工作流程。
这背后的主要思路是:从用户代码中推导出应用程序所依赖的云资源,以及资源间的依赖关系,构建出云资源拓扑图,也就是针对云环境的参考架构(Architecture Reference)。进一步对用户代码进行拆分、改写,导出多个计算模块,同时依赖于参考架构,可以生成一份**与用户代码不直接相关**的基础设施代码,其中包含对资源的定义与计算模块的发布。最终,执行这份基础设施代码就能创建与部署应用程序在云上的运行环境。可以在[这篇文章](../documentation/how-pluto-works.zh-CN.md)中了解详细的工作流程。

保障用户开发体验的关键在于编译时执行的代码不能与用户代码直接关联,否则就需要开发者在开发时指定哪些代码是编译时执行的,哪些代码是运行时执行的。

Expand All @@ -75,6 +75,6 @@ Demo 中,我在一份代码文件中,定义 3 个变量,KVStore、Queue、

## 参考

- [Pluto 工作原理](https://github.com/pluto-lang/pluto/blob/main/docs/zh-CN/how-pluto-works.md)
- [Pluto 解决什么问题](https://github.com/pluto-lang/pluto/blob/main/docs/zh-CN/what-problems-pluto-aims-to-address.md)
- [Pluto 和其他技术有什么不同](https://github.com/pluto-lang/pluto/blob/main/docs/zh-CN/whats-different.md)
- [Pluto 工作原理](../documentation/how-pluto-works.zh-CN.md)
- [Pluto 解决什么问题](../documentation/what-problems-pluto-aims-to-address.zh-CN.md)
- [Pluto 和其他技术有什么不同](../documentation/whats-different.zh-CN.md)
5 changes: 5 additions & 0 deletions docs/dev_guide/_meta.en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dev_guide": "Developer's Guide",
"extend-sdk": "Extend SDK",
"setup-k8s-dev-env": "Set Up a Kubernetes Development Environment"
}
9 changes: 9 additions & 0 deletions docs/dev_guide/_meta.zh-CN.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extend-sdk": "SDK 扩展手册",
"dev_guide": {
"display": "hidden"
},
"setup-k8s-dev-env": {
"display": "hidden"
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This document will use the official SDK as an example to introduce the extension methods of the SDK, namely how to extend `@plutolang/pluto` and `@plutolang/pluto-infra`.

If you encounter any unclear concepts or unexplained terms in this document, please refer to the ["How the SDK Works"](../en/concepts/sdk.md) for more information.
If you encounter any unclear concepts or unexplained terms in this document, please refer to the ["How the SDK Works"](../documentation/concepts/sdk.en.md) for more information.

## Overall Process

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

本篇文档将以官方 SDK 为例,介绍 SDK 的扩展方式,即如何扩展 `@plutolang/pluto``@plutolang/pluto-infra`

如果在本篇文档中遇到不清楚且未解释的概念,请从[“SDK 工作原理”](../zh-CN/concepts/sdk.md)中了解。
如果在本篇文档中遇到不清楚且未解释的概念,请从[“SDK 工作原理”](../documentation/concepts/sdk.zh-CN.md)中了解。

## 整体过程

Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions docs/documentation/_meta.en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"getting-started": "Getting Started",
"how-pluto-works": "How Pluto Works",
"what-problems-pluto-aims-to-address": "What Problem does Pluto Solve?",
"whats-different": "Differences between Pluto and other Products",
"concepts": "Concepts"
}
7 changes: 7 additions & 0 deletions docs/documentation/_meta.zh-CN.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"getting-started": "快速上手",
"how-pluto-works": "Pluto 工作原理",
"what-problems-pluto-aims-to-address": "Pluto 要解决什么问题?",
"whats-different": "Pluto 与其他产品的区别",
"concepts": "概念"
}
9 changes: 9 additions & 0 deletions docs/documentation/concepts/_meta.en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"deducer": "Deducer",
"generator": "Generator",
"adapter": "Adapter",
"arch-ref": "Architecture Reference",
"stack": "Stack",
"simulator": "Simulator",
"sdk": "SDK"
}
9 changes: 9 additions & 0 deletions docs/documentation/concepts/_meta.zh-CN.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"deducer": "推导器",
"generator": "生成器",
"adapter": "适配器",
"arch-ref": "参考架构",
"stack": "工作栈",
"simulator": "模拟器",
"sdk": "SDK"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ queue.subscribe(async (evt: CloudEvent): Promise<void> => {
```

<p align="center">
<img src="http://cdn.zhengsj.cn/ob-1700630175532.png" alt="case arch" width="450">
<img src="../../assets/getting-started-case-arch.png" alt="case arch" width="450">
</p>

This code includes 3 resource variables and 2 processes:
Expand All @@ -105,7 +105,7 @@ export AWS_REGION=us-east-1
```

<p align="center">
<img src="http://cdn.zhengsj.cn/ob-1700630203893.png" alt="aws arch" width="400">
<img src="../../assets/getting-started-aws-arch.png" alt="aws arch" width="400">
</p>

Pluto will create 3 resource components and 2 function objects on the specified cloud platform. For example, if you chose AWS, it will create:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ queue.subscribe(async (evt: CloudEvent): Promise<void> => {
```

<p align="center">
<img src="http://cdn.zhengsj.cn/ob-1700630175532.png" alt="case arch" width="450">
<img src="../../assets/getting-started-case-arch.png" alt="case arch" width="450">
</p>

这段代码包含 3 个资源变量和 2 个处理过程:
Expand All @@ -105,7 +105,7 @@ export AWS_REGION=us-east-1
```

<p align="center">
<img src="http://cdn.zhengsj.cn/ob-1700630203893.png" alt="aws arch" width="400">
<img src="../../assets/getting-started-aws-arch.png" alt="aws arch" width="400">
</p>

Pluto 将会在你指定的云平台上创建 3 个资源组件和 2 个函数对象,以 AWS 为例,将会创建:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0d5da86

Please sign in to comment.