Skip to content

Commit 9e4ff77

Browse files
committed
Improve readme
1 parent 3273d05 commit 9e4ff77

File tree

1 file changed

+9
-82
lines changed

1 file changed

+9
-82
lines changed

README.md

+9-82
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1-
# wasm-hl
1+
# wah
22

33
Shortcuts for wasm
44

55
| wasm-hl | wasm |
66
|---------------|-------------------------------------------|
77
| `(0 = 1)` | `(set_local 0 (f64.const 0))` |
88
| `(%$a + %$b)` | `(f64.add (get_local $a) (get_local $b))` |
9+
| `(0 + 1)` | `(i32.add (i32.const 0) (i32.const 1))` |
10+
| `(0.0 + 1.0)` | `(f64.add (f64.const 0) (f64.const 1))` |
911

10-
* Adds infix operators: `*`, +, -, / (all compile to f64 right now)
12+
* Adds infix operators: `*, +, -, /, ==, >, <, >=, <=`
1113
* Supports (0 = 1) shortcut for `set_local`
12-
* Supports bare numbers that become f64.const
14+
* Supports bare numbers that become f64.const if they have a decimal point, and
15+
i32.const if they don't.
16+
* Supports type inference by walking up the tree, paying attention to param
17+
and local types.
1318

1419
## Installation
1520

16-
Download from http://example.com/FIXME.
1721

1822
## Usage
1923

@@ -23,8 +27,6 @@ FIXME: explanation
2327

2428
## Options
2529

26-
FIXME: listing of options this app accepts.
27-
2830
## Examples
2931

3032
...
@@ -33,84 +35,9 @@ FIXME: listing of options this app accepts.
3335

3436
...
3537

36-
### Any Other Sections
37-
### That You Think
38-
### Might be Useful
39-
4038
## License
4139

42-
Copyright © 2017 FIXME
40+
Copyright © 2017 Tom MacWright
4341

4442
Distributed under the Eclipse Public License either version 1.0 or (at
4543
your option) any later version.
46-
47-
;; From https://github.com/WebAssembly/design/blob/master/Semantics.md
48-
;; `f32.add`: addition
49-
;; `f32.sub`: subtraction
50-
;; `f32.mul`: multiplication
51-
;; `f32.div`: division
52-
;; `f32.abs`: absolute value
53-
;; `f32.neg`: negation
54-
;; `f32.copysign`: copysign
55-
;; `f32.ceil`: ceiling operator
56-
;; `f32.floor`: floor operator
57-
;; `f32.trunc`: round to nearest integer towards zero
58-
;; `f32.nearest`: round to nearest integer, ties to even
59-
;; `f32.eq`: compare ordered and equal
60-
;; `f32.ne`: compare unordered or unequal
61-
;; `f32.lt`: compare ordered and less than
62-
;; `f32.le`: compare ordered and less than or equal
63-
;; `f32.gt`: compare ordered and greater than
64-
;; `f32.ge`: compare ordered and greater than or equal
65-
;; `f32.sqrt`: square root
66-
;; `f32.min`: minimum (binary operator); if either operand is NaN, returns NaN
67-
;; `f32.max`: maximum (binary operator); if either operand is NaN, returns NaN
68-
;; `f64.add`: addition
69-
;; `f64.sub`: subtraction
70-
;; `f64.mul`: multiplication
71-
;; `f64.div`: division
72-
;; `f64.abs`: absolute value
73-
;; `f64.neg`: negation
74-
;; `f64.copysign`: copysign
75-
;; `f64.ceil`: ceiling operator
76-
;; `f64.floor`: floor operator
77-
;; `f64.trunc`: round to nearest integer towards zero
78-
;; `f64.nearest`: round to nearest integer, ties to even
79-
;; `f64.eq`: compare ordered and equal
80-
;; `f64.ne`: compare unordered or unequal
81-
;; `f64.lt`: compare ordered and less than
82-
;; `f64.le`: compare ordered and less than or equal
83-
;; `f64.gt`: compare ordered and greater than
84-
;; `f64.ge`: compare ordered and greater than or equal
85-
;; `f64.sqrt`: square root
86-
;; `f64.min`: minimum (binary operator); if either operand is NaN, returns NaN
87-
;; `f64.max`: maximum (binary operator); if either operand is NaN, returns NaN
88-
;; `i32.add`: sign-agnostic addition
89-
;; `i32.sub`: sign-agnostic subtraction
90-
;; `i32.mul`: sign-agnostic multiplication (lower 32-bits)
91-
;; `i32.div_s`: signed division (result is truncated toward zero)
92-
;; `i32.div_u`: unsigned division (result is [floored](https://en.wikipedia.org/wiki/Floor_and_ceiling_functions))
93-
;; `i32.rem_s`: signed remainder (result has the sign of the dividend)
94-
;; `i32.rem_u`: unsigned remainder
95-
;; `i32.and`: sign-agnostic bitwise and
96-
;; `i32.or`: sign-agnostic bitwise inclusive or
97-
;; `i32.xor`: sign-agnostic bitwise exclusive or
98-
;; `i32.shl`: sign-agnostic shift left
99-
;; `i32.shr_u`: zero-replicating (logical) shift right
100-
;; `i32.shr_s`: sign-replicating (arithmetic) shift right
101-
;; `i32.rotl`: sign-agnostic rotate left
102-
;; `i32.rotr`: sign-agnostic rotate right
103-
;; `i32.eq`: sign-agnostic compare equal
104-
;; `i32.ne`: sign-agnostic compare unequal
105-
;; `i32.lt_s`: signed less than
106-
;; `i32.le_s`: signed less than or equal
107-
;; `i32.lt_u`: unsigned less than
108-
;; `i32.le_u`: unsigned less than or equal
109-
;; `i32.gt_s`: signed greater than
110-
;; `i32.ge_s`: signed greater than or equal
111-
;; `i32.gt_u`: unsigned greater than
112-
;; `i32.ge_u`: unsigned greater than or equal
113-
;; `i32.clz`: sign-agnostic count leading zero bits (All zero bits are considered leading if the value is zero)
114-
;; `i32.ctz`: sign-agnostic count trailing zero bits (All zero bits are considered trailing if the value is zero)
115-
;; `i32.popcnt`: sign-agnostic count number of one bits
116-
;; `i32.eqz`: compare equal to zero (return 1 if operand is zero, 0 otherwise)

0 commit comments

Comments
 (0)