Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
forked fromwa-lang/wa

🇨🇳 凹语言™ The Wa Programming Language

License

NotificationsYou must be signed in to change notification settings

Kensuke-Hinata/wa

 
 

Repository files navigation

Build StatusGo Report CardCoverage StatusGitHub releaseGo Referencelicense

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 athttps://gitee.com/wa-lang/wa. There is a mirror of the repository athttps://github.com/wa-lang/wa. Unless otherwise noted, the Wa source files are distributed under the AGPL-v3 license found in the LICENSE file.

Playground

https://wa-lang.org/playground

Snake Game

Install and Run:

Go >= 1.17

  1. go install wa-lang.org/wa@latest
  2. wa init -name=_examples/hi
  3. wa run _examples/hi

The Wa project is still in very early stage. If you want to submit PR, please read theContribution Guide(Chinese). We do not accept PR only about 3rdparty changes.

Example: Print Wa

Print rune and call function:

// Copyright @2019-2022 The Wa author. All rights reserved.import "fmt"func main {println("hello, Wa!")println(add(40, 2))fmt.Println(1+1)}func add(a: i32, b: i32) => i32 {return a+b}

Execute the program:

$ go run main.go hello.wa hello, Wa!422

Example: Print Prime

Print prime numbers up to 30:

func main {for n := 2; n <= 30; n = n + 1 {var isPrime int = 1for i := 2; i*i <= n; i = i + 1 {if x := n % i; x == 0 {isPrime = 0}}if isPrime != 0 {println(n)}}}

Execute the program:

$ go run main.go run _examples/prime2357111317192329

Example: Print Prime with Chinese syntax

Print prime numbers up to 30:

引于 "书"【启】:  // 输出30以内的素数  从n=2,到n>30,有n++:    设素=1    从i=2,到i*i>n,有i++:      设x=n%i      若x==0则:        素=0      。    。    若素!=0则:      书·曰:n    。  。。

Output is the same as the previous example.

More examples_examples

About

🇨🇳 凹语言™ The Wa Programming Language

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go95.7%
  • JavaScript2.4%
  • C0.5%
  • CSS0.4%
  • Witcher Script0.4%
  • C++0.2%
  • Other0.4%

[8]ページ先頭

©2009-2025 Movatter.jp