15 Commits

Author SHA1 Message Date
Johan B.W. de Vries
20c507a9ec Adds the Bits type class
Also adds the remaining unexposed WebAssembly opcodes as
comments (eqz, clz, ctz, popcnt, copysign).

This also means that BinaryOp.operator is now always
a type class method.
2025-04-09 15:40:20 +02:00
Johan B.W. de Vries
46dbc90475 Implements ceil, floor, trunc, nearest
To round of the f32 / f64 wasm supported opcodes.

This also means we can remove the now outdated
WEBASSEMBLY_BUILTIN_FLOAT_OPS.
2025-04-06 16:38:57 +02:00
Johan B.W. de Vries
7544055a94 Split Num into NatNum and IntNum
This is because Haskell defines negate, abs and signum
for Num, but they don't work with our unsigned number
types. (abs would be a noop.) Haskell has Word32 / Word64,
but there negate doesn't make much sense to me.

Implemented neg and abs.

Implemented a type class inheritance check.

Removed Integral from u8 and i8 since it wasn't implemented.
2025-04-06 16:12:36 +02:00
Johan B.W. de Vries
111cb0f702 Review 2025-04-06 13:37:12 +02:00
Johan B.W. de Vries
5d9ef0e276 Code review
Added a test, simplified another and added
a lot of TODO's.
2025-04-06 12:58:20 +02:00
Johan B.W. de Vries
e6610a6e96 Adds a todo note 2023-01-29 12:42:38 +01:00
Johan B.W. de Vries
205897101f Adds a typing system to Phasm 2023-01-07 16:24:50 +01:00
Johan B.W. de Vries
7a8b1baa25 Some repo cleanup 2022-08-20 18:21:23 +02:00
Johan B.W. de Vries
c4ee2ab3dc Memory initialization is now done during compilation
Also, the user can now define tuple module constants
2022-08-17 21:07:33 +02:00
Johan B.W. de Vries
b6fb0d45b6 Implements foldl 2022-08-11 19:56:47 +02:00
Johan B.W. de Vries
0cf8a246fe Reworked compiler so it uses WasmGenerator
Also, started work on foldl

Also, added a missing FIXME
2022-08-10 20:51:01 +02:00
Johan B.W. de Vries
451a8e9158 Removes the old ___new_reference___ allocator 2022-08-09 20:42:02 +02:00
Johan B.W. de Vries
a0d575f61f Implements __alloc_bytes__, uses it in the buffer example
Also, updated todo, remove broken code from buffer example
2022-08-09 20:21:59 +02:00
Johan B.W. de Vries
a13713d709 Cleanup to helpers, making use of runners 2022-08-09 19:04:40 +02:00
Johan B.W. de Vries
ac0c49a92c Now runs on new code 2022-06-19 16:54:14 +02:00