https://github.com/rsms/dew
Dew is a little programming language which targets the Lua virtual machine
https://github.com/rsms/dew
Last synced: 11 months ago
JSON representation
Dew is a little programming language which targets the Lua virtual machine
- Host: GitHub
- URL: https://github.com/rsms/dew
- Owner: rsms
- License: apache-2.0
- Created: 2025-01-19T00:15:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-14T01:22:12.000Z (11 months ago)
- Last Synced: 2025-07-21T23:50:33.304Z (11 months ago)
- Language: C
- Size: 2.1 MB
- Stars: 25
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Dew is a little programming language which targets the Lua virtual machine.
## Language
### Examples
```
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
}
```
### Operators
+ & += &= && == != ( )
- | -= |= || < <= [ ]
* ^ *= ^= <- > >= { }
/ << /= <<= ++ = := , ;
% >> %= >>= -- ! ... . :
~
#### Operator precedence
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 ,
## Building dew
```
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 system
- `make DEBUG=1` — debug build for host system
- `make TARGET=web` — release build for web platform
- `make TARGET=web DEBUG=1` — debug build for web platform
- `make test` — build & run tests