Wa is a general-purpose programming language designed for developing robustness and maintainability WebAssembly software.
Instead of requiring complex toolchains to set up, you can simply go install it - or run it in a browser.
Note: Our canonical Git repository is located at https://gitee.com/wa-lang/wa. There is a mirror of the repository at https://github.com/wa-lang/wa. Unless otherwise noted, the Wa source files are distributed under the AGPL-v3 license found in the LICENSE file.
The Wa project is still in very early stage. If you want to submit PR, please read the Contribution Guide(Chinese). We do not accept PR only about 3rdparty changes.
func main {
for n := 2; n <= 30; n = n + 1 {
isPrime: int = 1
for i := 2; i*i <= n; i = i + 1 {
if x := n % i; x == 0 {
isPrime = 0
}
}
if isPrime != 0 {
println(n)
}
}
}
Execute the program:
$ cd waroot && go run ../main.go run examples/prime
2
3
5
7
11
13
17
19
23
29
The Wa Programming Language
简体中文 | English
Wa is a general-purpose programming language designed for developing robustness and maintainability WebAssembly software. Instead of requiring complex toolchains to set up, you can simply go install it - or run it in a browser.
Playground
https://wa-lang.org/playground
Snake Game
Install and Run:
Install from binary: download
wa
command from https://github.com/wa-lang/wa/releases, and set$PATH
env.Or install from Go (Go >= 1.17):
go install wa-lang.org/wa@latest
cd waroot
wa init -name=examples/hi
wa run examples/hi
Example: Print Wa
Print rune and call function:
Execute the program:
Example: Print Prime
Print prime numbers up to 30:
Execute the program:
Example: Print Prime with Chinese syntax
Print prime numbers up to 30:
Output is the same as the previous example.
More examples waroot/examples
Contributors