23 Commits

Author SHA1 Message Date
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
94c8f9388c Implements the Ord type class 2025-04-09 12:44:32 +02:00
Johan B.W. de Vries
4001b086db Cleanup, got rid of OPERATOR_MAP 2025-04-06 12:58:40 +02:00
Johan B.W. de Vries
521171540b Properly implemented test_crc32
Also extended the hack around u8 to u32 cast used
in crc32 - its type was lost, so it would just cast
to whatever the environment was expecting.

Had to do_format_check=False since the file has
some comments and such.
2025-04-05 16:41:46 +02:00
Johan B.W. de Vries
5c537f712e Project update
Various updates to bring the project uptodate.

- Updated required packages
- Removed runtimes that are not being updated
- wasmtime is for now the only supported runtime
- Implements imports for wasmtime runtime
- Fixes a memory access bug for wasmtime runtime
- compile_wasm is now optional - runtimes have to
  implement and call this themselves
- Typing fixes
- Linting fixes
2025-04-05 15:43:49 +02:00
Johan B.W. de Vries
97b61e3ee1 Test generation framework with typing improvements
Prior to this PR, each type would have its own handwritten
test suite. The end result was that not all types were tested
for all situations.

This PR adds a framework based on a Markdown file, which
generates the basic tests for the types defined in json
files. These are auto generated and updated by the Makefile
before the test suite is run.

Also, a number of unsupported type combinations are now
supported.

Also, we now support negative literals.

Also, allocation calculation fixes for nested types.

Also, the test helpers can now properly import and export
typed variables such as bytes, static arrays and tuples. This
may come in handy when it comes to phasm platform wanting to
route data.

Also, adds better support for i8 type.

Also, started on a runtime.py, since there's quite some code
now that deals with compile time handling of WebAssembly stuff.

Also, minor improvement to the type constrains, namely we
better match 'tuple' literals with static array types.

Also, reduced spam when printing the type analysis results;
constraints that go back on the backlog are now no longer
printed one by one. It now also prints the end results of
the typing analysis.

Also, reorganized the big test_primitives test into type
classes.

Also, replaced pylint with ruff.
2023-11-15 12:52:23 +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
451a8e9158 Removes the old ___new_reference___ allocator 2022-08-09 20:42:02 +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
89ad648f34 Moved rendering to codestyle, parsing to parser
Also, removed name argument when parsing, wasn't used.
2022-07-09 14:04:40 +02:00
Johan B.W. de Vries
d32613d9b8 We have a name \o/ 2022-07-09 12:35:32 +02:00
Johan B.W. de Vries
14eede6b06 Cleanup to wasm.py 2022-07-09 12:30:28 +02:00
Johan B.W. de Vries
76d80f57cb Imports 2022-07-08 21:06:13 +02:00
Johan B.W. de Vries
374231d206 bytes, u8 types 2022-06-25 20:45:33 +02:00
Johan B.W. de Vries
0da309a280 Remove old code 2022-06-19 17:04:20 +02:00
Johan B.W. de Vries
ac0c49a92c Now runs on new code 2022-06-19 16:54:14 +02:00
Johan B.W. de Vries
658e442df2 - Tuple => ()
- All tests are now parsed by our own AST
2022-06-06 12:18:09 +02:00
Johan B.W. de Vries
865eccd719 Testing with various wasm implementations
Also:
- Started on SIMD before finding out no implementation
  supports that yet
- Type fix result Import / Function
- Various error reporting improvements
- Non-const tuple members
2022-05-07 14:21:50 +02:00
Johan B.W. de Vries
6b717dba0b Fix pathing issue when wat2wasm is not globally installed 2022-05-07 12:14:34 +02:00
Johan B.W. de Vries
b468ffa780 First memory test checks out [skip-ci] 2022-03-04 15:50:53 +01:00
Johan B.W. de Vries
58bd5f0889 More cleanup [skip-ci] 2021-04-05 10:41:26 +02:00