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

zhanluxianshen/wa

 
 

Repository files navigation

Build StatusCoverage StatusGitHub releaselicenseCNCF Landscape

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

WASM4 Game

NES emulator

WebGPU Demo

P5 for creative coding

Arduino Nano 33

Example: Print Wa

Print rune and call function:

import "fmt"global year: i32 = 2023func main {println("hello, Wa!")println(add(40, 2), year)fmt.Println(1+1)}func add(a: i32, b: i32) => i32 {return a+b}

Execute the program:

$ wa run hello.wa hello, Wa!42 20232

Example: Print Prime

Print prime numbers up to 30:

func main {for n := 2; n <= 30; n = n + 1 {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:

$ cd waroot && wa run -target=wasi 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.

Example: Chrome Native AI

Chrome builtin Gemini Nano Demo:

import "ai"func main {ai.RequestSession(func(session: ai.Session){session.PromptAsync("Who are you?", func(res: string) {println(res)})})}

More exampleswaroot/examples

Contributors

ContributorContribution points
柴树杉69000
丁尔男73500
史斌29000
扈梦明39000
赵普明18000
宋汝阳2000
刘云峰1000
王湘南1000
王泽龙1000
吴烜3000
刘斌2500
尹贻浩2000
安博超3000
yuqiaoyu600
qstesiro200
small_broken_gong100
tk103331100
蔡兴3000
王仁义1000
imalasong1000

Give a Star! ⭐

If you like or are using Wa to learn or start your projects,please give it a star. Thanks!

About

The Wa Programming Language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go82.7%
  • JavaScript13.6%
  • CSS1.6%
  • C0.5%
  • Witcher Script0.4%
  • HTML0.4%
  • Other0.8%

[8]ページ先頭

©2009-2025 Movatter.jp