Skip to content

Commit

Permalink
zz
Browse files Browse the repository at this point in the history
  • Loading branch information
3dgen committed Sep 13, 2023
1 parent a0ed094 commit 2137a28
Show file tree
Hide file tree
Showing 42 changed files with 84 additions and 2 deletions.
2 changes: 2 additions & 0 deletions en/1.InstallAndGetStart/1.1.HelloWorld.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 1.1. hello world

Printing "hello world" is a common example for PL. The Wa-lang example prints "你好,凹语言!" in Chinese, means "Hello, Wa-lang".
Expand Down
2 changes: 2 additions & 0 deletions en/1.InstallAndGetStart/1.2.Install.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 1.2. Install Wa-lang Compiler

In addition to accessing the online Wa-lang playground, you can also install the compiler locally.
Expand Down
2 changes: 2 additions & 0 deletions en/1.InstallAndGetStart/1.3.Command.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 1.3. wa command line

This section introduces the main functions of the `wa` command.
Expand Down
2 changes: 2 additions & 0 deletions en/1.InstallAndGetStart/1.4.ProjectStructure.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 1.4. Project directory structure

The project directory structure is the basis for the work of the entire peripheral tools. For example, init generates projects based on this structure, and the package management tool manages dependencies in turn.
Expand Down
2 changes: 2 additions & 0 deletions en/1.InstallAndGetStart/1.5.Plugins.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 1.5. Plug-ins for IDE

Modern programming languages generally provide extensions for various IDEs and editors to improve the programming experience. The Wa-lang provides basic plug-in support for VS Code, Fleet and Vim.
Expand Down
2 changes: 2 additions & 0 deletions en/1.InstallAndGetStart/readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: https://github.com/wa-lang/man/tree/master/en*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

# 1. Install and get start

This chapter describes the simplest Wa-lang example, how to install the Wa-lang compiler, plug-ins for IDE, project directory structure and command line functions, etc.
2 changes: 2 additions & 0 deletions en/2.ProgramStructure/2.1.GlobalDeclaration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 2.1. Global declaration

A typical Wa-lang program source code is as follows:
Expand Down
2 changes: 2 additions & 0 deletions en/2.ProgramStructure/2.2.GlobalVariableDeclaration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 2.2. Global variable declaration

Global variable declaration starts with the keyword `global`, and the general syntax is as follows:
Expand Down
2 changes: 2 additions & 0 deletions en/2.ProgramStructure/2.3.FunctionDeclaration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 2.3. Function declaration

The function declaration starts with the keyword `func`, and the general syntax is as follows:
Expand Down
2 changes: 2 additions & 0 deletions en/2.ProgramStructure/2.4.ConstDeclaration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 2.4. Constant declaration

The constant declaration starts with the keyword `const`, and the general syntax is as follows:
Expand Down
2 changes: 2 additions & 0 deletions en/2.ProgramStructure/2.5.ImportDeclaration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 2.5. Import declaration

The import declaration starts with the keyword `import`, and the general syntax is as follows:
Expand Down
2 changes: 2 additions & 0 deletions en/2.ProgramStructure/readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

# 2. Program structure

Like other programming languages, a Wa-lang program is composed of many small parts. This chapter introduces global variable declarations, function declarations, constant declarations, import declarations, and type declarations.
2 changes: 2 additions & 0 deletions en/3.BasicTypes/3.1.LocalVariableDeclaration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 3.1. Local variable declaration

Chapter 2 introduces global variable and constant declarations. Also commonly used is local variable (variables defined within a function) declaration. Its general syntax is:
Expand Down
2 changes: 2 additions & 0 deletions en/3.BasicTypes/3.2.Integers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 3.2. Integers

Wa-lang currently supports the following integer types:
Expand Down
2 changes: 2 additions & 0 deletions en/3.BasicTypes/3.3.FloatingPointNumbers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 3.3. Floating point number

Wa-lang currently supports the following types of floating point numbers (both are IEEE 754 standards):
Expand Down
2 changes: 2 additions & 0 deletions en/3.BasicTypes/3.4.String.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 3.4. String

Strings are regarded as basic data types in Wa-lang. The type name is: `string`. String literal constants are defined by double quotes `""` and are encoded in UTF-8, for example:
Expand Down
2 changes: 2 additions & 0 deletions en/3.BasicTypes/readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

# 3. Basic types

At a low level, all data is made up of bits. The corresponding basic data types of Wa-lang include integers, floating point numbers, strings, etc. This chapter introduces basic data types and the use of local variables.
2 changes: 2 additions & 0 deletions en/4.Function/4.1.FunctionCall.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 4.1. Function call

We have come across many functions in previous chapters, such as the commonly used built-in printing function `println`. The general syntax for function calls is:
Expand Down
2 changes: 2 additions & 0 deletions en/4.Function/4.2.FunctionValues.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 4.2. Function values

In Wa-lang, functions can be treated as special values, for example:
Expand Down
2 changes: 2 additions & 0 deletions en/4.Function/4.3.AnonymousFunctionsAndClosures.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 4.3. Anonymous functions and closures

The previous section introduced the basic usage of function values. Since functions can be regarded as values, can function literals be declared inside functions in the same way as basic type literals? The answer is yes, for example:
Expand Down
2 changes: 2 additions & 0 deletions en/4.Function/4.4.ifStatements.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 4.4. if statements

The general form of conditional statements is:
Expand Down
4 changes: 3 additions & 1 deletion en/4.Function/4.5.forStatements.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

## 4.5. for statement
***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 4.5. for statements

There are three basic forms of loop statements:
```wa
Expand Down
2 changes: 2 additions & 0 deletions en/4.Function/4.6.switchStatements.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 4.6. switch statements

swtich statements are often used to replace multiple conditional statements. The general form is:
Expand Down
4 changes: 3 additions & 1 deletion en/4.Function/readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

# 4. Function
***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

# 4. Functions

Functions are sequences of statements designed to be reused many times. This chapter introduces the basic usage of Wa-lang functions, as well as features such as function values, anonymous functions, and closures.
2 changes: 2 additions & 0 deletions en/5.CompositeTypes/5.1.Reference.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 5.1. Reference

In Wa-lang, adding the `&` symbol before a variable is called a **reference** operation. Assume that the type of the variable is `T`, and the type of the return value of the reference operation is `*T`, which is called It is a **T-type reference**, for example:
Expand Down
2 changes: 2 additions & 0 deletions en/5.CompositeTypes/5.2.Array.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 5.2. Array

The basic declaration of an array type is as follows:
Expand Down
2 changes: 2 additions & 0 deletions en/5.CompositeTypes/5.3.Slice.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 5.3. Slice

The basic declaration of the slice type is as follows, `T` is the element type:
Expand Down
2 changes: 2 additions & 0 deletions en/5.CompositeTypes/readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

# 5. Composite types

Composite types are built-in complex types.
2 changes: 2 additions & 0 deletions en/6.CustomTypes/6.1.Structure.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 6.1. Structure

The general form of structure declaration in Wa-lang is:
Expand Down
2 changes: 2 additions & 0 deletions en/6.CustomTypes/6.2.Method.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 6.2. Method

In addition to encapsulating member data, the biggest role of structures is that they can have methods. In Wa-lang, **method** is a special type of function that is attached to a specific type, see the following example:
Expand Down
2 changes: 2 additions & 0 deletions en/6.CustomTypes/6.3.MethodValues.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 6.3. Method values

Since methods are also functions, you can use them following the pattern in Section 4.2, for example:
Expand Down
2 changes: 2 additions & 0 deletions en/6.CustomTypes/6.4.EmbeddedStructure.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 6.4. Embedded structure

When declaring a structure type, if the type of a member is a structure but the name of it is omitted, this usage is called **embedded structure**. For example, in the following code, the structure `Sc` is embedded The `Sp` member:
Expand Down
2 changes: 2 additions & 0 deletions en/6.CustomTypes/6.5.AnonymousStructure.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 6.5. Anonymous structure

In the previous sections of this chapter, the structures we used were declared in the following form:
Expand Down
2 changes: 2 additions & 0 deletions en/6.CustomTypes/readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

# 6. Custom types

Custom types include structures and interfaces generated around structure methods.
2 changes: 2 additions & 0 deletions en/7.Interface/7.1.NullInterface.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 7.1. Null interface - universal wrapper

In Wa-lang, the simplest interface is the null interface, namely `interface {}`. The method of declaring interface type variables is the same as other types. For example, the following code declares an null interface variable named `i`:
Expand Down
2 changes: 2 additions & 0 deletions en/7.Interface/7.2.Non-nullInterface.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 7.2. Non-null interface

An interface is a collection of methods. The general form of an interface declaration is as follows:
Expand Down
2 changes: 2 additions & 0 deletions en/7.Interface/7.3.TypeAssertions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 7.3. Summary of type assertions

Section 7.1 introduces how to obtain the specific value contained in an interface value of type `interface{}` through type assertion. This usage still holds for non-null interface values, for example:
Expand Down
2 changes: 2 additions & 0 deletions en/7.Interface/7.4.OtherFeatures.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*The content on this page is written in Chinese, and then traslated into English by machine. More accurate traslations are welcome at: [https://github.com/wa-lang/man/tree/master/en](https://github.com/wa-lang/man/tree/master/en)*

***Ending's law: "Any application that can be compiled to WebAssembly, will be compiled to WebAssembly eventually."***

## 7.4. Other features of interface

When declaring an interface, the interface's method set can contain another interface, for example:
Expand Down
Loading

0 comments on commit 2137a28

Please sign in to comment.