Dew is a little programming language which targets the Lua virtual machine.
1 + (2 + 3) * (4 - 5)
fun f
fun f(x, y int)
fun f(x, y int) int
fun f(x, y int) int, int
fun f(x, y int) (int, int)
fun ♥︎(x, y, z int) int, int {
return x + y*z
}
+ & += &= && == != ( )
- | -= |= || < <= [ ]
* ^ *= ^= <- > >= { }
/ << /= <<= ++ = := , ;
% >> %= >>= -- ! ... . :
~
Binary operators of the same precedence associate from left to right.
E.g. x / y * z
is the same as (x / y) * z
.
7 .
6 ++ -- + - ! ~ * & ?
5 * / % << >> &
4 + - | ^
3 == != < <= > >=
2 &&
1 ||
0 ,
make && o.*/dew examples/hello.dew
Requirements:
- C17 compiler (tested with clang 17)
- GNU Make
- curl for wasm build
Various ways to build:
make
— release build for host systemmake DEBUG=1
— debug build for host systemmake TARGET=web
— release build for web platformmake TARGET=web DEBUG=1
— debug build for web platformmake test
— build & run tests