Johan B.W. de Vries
22a10d5d92
Implements sum for Foldable types
...
Foldable take a TypeConstructor. The first argument must be a
NatNum.
2025-05-10 19:54:56 +02:00
Johan B.W. de Vries
f8d107f4fa
Replaces did_construct with a proper router
...
By annotating types with the constructor application
that was used to create them.
Later on we can use the router to replace compiler's
INSTANCES or for user defined types.
2025-05-10 16:49:10 +02:00
Johan B.W. de Vries
42cb38d67d
Clean up todo list
2025-05-02 21:29:24 +02:00
Johan B.W. de Vries
bee0c845a8
Removes UnaryOp
...
It was no longer used.
2025-05-02 21:12:25 +02:00
Johan B.W. de Vries
d3e38b96b2
Removed the len special casing
2025-04-27 12:37:17 +02:00
Johan B.W. de Vries
234bfaa8df
Changes AppliedType to TypeConstructor
...
First to be more in line with how the literature
treats these types. But also to make them workable with
type classes.
2025-04-21 11:14:30 +02:00
Johan B.W. de Vries
87866cff55
More ideas
2025-04-09 16:02:47 +02:00
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