The Water programming language

Water is a C-like high-level language built specifically for WebAssembly. Water's semantics align very closely with Wasm's primitives. You are able to directly use features like strings, Wasm's GC types, multiple memories, tables, exceptions, SIMD, atomics, branch hinting, etc.

This allows unmatched levels of flexibility and control which you can not get from any other programming language, short of writing it directly in assembly. As a result, code that you write is never far removed from what is actually executed, and performance characteristics remain transparent and easy to reason about.

Apart from running high-performance code on the Web, Water is a great choice for a scripting language. Owing to WebAssembly being very portable, it can run and be embedded in almost any tech stack and programming language.

Features

Water supports a variety of both high-level and low-level programming constructs:

  • The usual control flow (if, for, while, do-while, etc.)
  • Every statement is an expression which can yield a value
  • Function expressions and closures
  • Classes and inheritance
  • Template-like generics
  • Operator overloading
  • Custom allocators
  • Arrays
  • Static type checking and basic type inference
  • Multivalued types
  • Modules optimised with partial compilation
  • Inline assembly
For concrete examples on how to use these features, have a look through the documentation.

Ready to start learning Water?

Check out the getting started guide here.