更新日期:2020年09月02日 投稿作者:分类目录网 围观人数:17983



Walt是WebAssembly文本格式的替代语法,.walt文件直接编译为WebAssembly二进制格式。 其特点:

  • 不需要C / C ++或Rust,只需输入 JavaScript。
  • 不需要LLVM /二进制工具包,零依赖关系100%用js编写。
  • 快速编译,集成到webpack中!


Walt_用于WebAssembly文本格式的js风格的语法 第1张

Walt | Alternative Syntax for WebAssembly | Demo

Walt_用于WebAssembly文本格式的js风格的语法 第2张 Walt_用于WebAssembly文本格式的js风格的语法 第3张 Walt_用于WebAssembly文本格式的js风格的语法 第4张 Walt_用于WebAssembly文本格式的js风格的语法 第5张 Walt_用于WebAssembly文本格式的js风格的语法 第6张

Walt_用于WebAssembly文本格式的js风格的语法 第7张 Walt is an alternative syntax for WebAssembly text format. It's an experiment for using JavaScript syntax to write to as 'close to the metal' as possible. It's JavaScript with rules. .walt files compile directly to WebAssembly binary format.


  • Write "close to the metal" JavaScript!
  • No C/C++ or Rust required , just typed JavaScript.
  • NO LLVM/binary toolkits required , zero dependencies 100% written in JS.
  • Fast compilation, integrates into webpack!

Walt_用于WebAssembly文本格式的js风格的语法 第8张Read the Quick Start Guide

Walt_用于WebAssembly文本格式的js风格的语法 第9张Try it out in the Walt Explorer .

Walt_用于WebAssembly文本格式的js风格的语法 第10张Contributi*** are welcomed! Contributing guide .

Walt_用于WebAssembly文本格式的js风格的语法 第11张Current status: Alpha



Writing zero-overhead, optimized WebAssembly is pretty tough to do. The syntax for .watfiles is terse and difficult to work with directly. If you do not wish to use a systems language like C or Rust, then you're kind of out of luck . Your best bet (currently) is to write very plain C code, compile that to .wast and then optimize that result. Then you're ready to compile that into the final WebAssembly binary. This is an attempt to take C/Rust out of the equation and write 'as close to the metal' as possible without losing readability.

I feel like this is currently a problem. Most Web engineers are not familiar with the C family languages or Rust. It's a barrier for wide spread adoption of WebAssembly. A competent Front-end engineer should be able to edit WebAssembly as easily as any other systems programmer.


Provide a thin layer of syntax sugar on top of .wattext format. Preferably porting as much of JavaScript syntax to WebAssembly as possible. This improved syntax should give direct control over the WebAssembly output. Meaning there should be minimal to none post optimization to be done to the wast code generated. The re-use of JavaScript semantics is intentional as I do not wish to create a brand new language.

Here is what an example of a .waltmodule which exports a recursive Fibonacci function looks like:

export  function  fibonacci ( n :  i32 ):  i32  {  if ( n <= 0 ) return 0 ;         if  ( n  ==  1 )  return  1 ;   return  fibonacci ( n  -  1 )  +  fibonacci ( n  -  2 );  }

When this code is ran through the walt compiler you end up with a buffer which can be used to create a WebAssembly module with a fibonacciexport just as you would expect. All done with familiar JS syntax and without any external binary toolkits! A working demo of this exists in the fibonacci-spec.js unit test file .

Project Goals

The ultimate goal of Walt is to make WebAssembly accessible to average JavaScript engineer by providing a subset of JavaScript syntax which compiles to WebAssembly bytecode directly. That WebAssembly should be easy to make use of and simple to integrate into an existing project with the current build tools .

Use cases

Pretty much everyone who wants a quick-start into wasm can use Walt to get there. The use-cases are not specific to this project alone but more to WebAssembly in general. The fact that Walt does not require a stand-alone compiler and can integrate into any(almost?) build tool still makes certain projects better candidates over others.

  • Web/Node libraries, looking to improve performance.
  • Games
  • Projects depending on heavy real-time computation from complex UIs to 3D visualizati***
  • Web VR/AR
  • Anyone interested in WebAssembly who is not familiar with system languages.

See Wiki for detailed design decisi*** etc.

Prior Art

  • wah - A slightly higher level syntax on top of the wasm text format
  • mini-c - Experimental C to WebAssembly compiler



BT Kitty https://cnbtkitty.pw/ 专注于提供BT种子搜索和下载的网站,你可以在这里搜索和下载电影、剧集、音乐、图书、图片、综艺、软件、动漫、教程、游戏等资源,BT Kitty 可以说算得上一款BT种子搜索神器、下载利器。 BT Library https://btlibrary.xyz/ 索引了几千万千万BT种子,包括电影、剧


电脑怎么设置开机密码:   相信很多人都有不想给别人乱上自己的电脑的想法吧?电脑怎么设置开机密码呢?那么设置电脑开机密码是最好的办法了。如何设置开机密码?简单几步就能设置好咯!这里来演示一下XP系统和win7系统的开机密码设置方法。   除以上系统外,还将给大家带来windows10系统开机密码的设置方法


电脑没有声音怎么办?其实原因无非就2个,电脑硬件问题与软件问题。硬件问题主要是声卡坏了,或者输出声音接口损坏等,一般声卡硬件损坏很少,软件问题是比较常见的导致电脑没声音。那么如何判断是硬件问题还是软件问题呢?下面来分条详细说明。  一般处理电脑故障我们都是先软件后硬件的。如果您的电脑没有声音请尝试以下解决办法,一般是可以解决的. 电脑没有声音怎么办