23 Commits

Author SHA1 Message Date
Johan B.W. de Vries
38294497cb Moves the prelude to runtime
Previously, it was hardcoded at 'compile' time (in as much
Python has that). This would make it more difficult to add
stuff to it. Also, in a lot of places we made assumptions
about prelude instead of checking properly.
2025-05-29 16:43:37 +02:00
Johan B.W. de Vries
96f52a274c Minor cleanup
- Removed unused stubs
- Removed wabt dependency since wasmtime can compile
  wat2wasm as well.
- Removed wasm2c references, it was never tested.
2025-04-05 16:02:55 +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
a85129254d Adds partial additional debugging info 2023-11-10 12:52:14 +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
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
253974df24 Adds runner classes to tests, implements xor for u8, u32, u64 2022-08-06 20:11:39 +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
eb74c8770d Examples HTML now serve higlighted py 2022-07-08 20:41:58 +02:00
Johan B.W. de Vries
17aa5fd6f9 Examples HTML now serve higlighted WAT 2022-07-08 20:23:12 +02:00
Johan B.W. de Vries
b28df7fa74 Fix: Could not both export and use function
Added HTML pages for fib example
2022-06-24 18:52:43 +02:00
Johan B.W. de Vries
0da309a280 Remove old code 2022-06-19 17:04:20 +02:00
Johan B.W. de Vries
efba4e0daa pip fix, wasmer update 2022-05-24 11:43:42 +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
541b3a3b62 Learning about data usage [skip-ci] 2022-03-04 12:51:10 +01:00
Johan B.W. de Vries
e972b37149 If statements \o/ 2021-08-07 14:34:50 +02:00
Johan B.W. de Vries
58bd5f0889 More cleanup [skip-ci] 2021-04-05 10:41:26 +02:00
Johan B.W. de Vries
2a93d6125e ideas [skip-ci] 2021-04-03 20:40:11 +02:00
Johan B.W. de Vries
473cd0b626 cleanups [skip-ci] 2021-04-03 12:45:13 +02:00
Johan B.W. de Vries
547576de00 New repo, containing the basic idea 2021-04-03 12:26:06 +02:00