Commit Graph

29 Commits

Author SHA1 Message Date
41f9c231c0 feat(interface-types) Introduce RecordType for InterfaceType and Type.
The `Type::Record` variant now is defined by `RecordType`. In
addition, `InterfaceType` has a new variant: `Record`, that is also
defined by `RecordType`. Encoders and decoders are updated to consider
`RecordType`, which removes code duplication and simplify code.
2020-03-26 13:35:24 +01:00
c3c6fcbfdd feat(interface-types) Introduce the record type.
This patch updates the `Type` type to be an enum with 2 variants:
`Function` and `Record`, resp. to represent:

1. `(@interface type (func (param i32 i32) (result string)))`
2. `(@interface type (record string i32))`

This patch updates the binary encoder and decoder, along with the WAT
encoder and decoder.
2020-03-26 10:54:58 +01:00
864ac79123 feat(interface-types) Use better errors.
The new `errors` module contains structure to represent errors,
instead of using basic strings. The first usage is in the interpreter
itself.
2020-03-10 17:49:35 +01:00
8bd3345a79 feat(interface-types) Remove the 'input lifetime on Instruction. 2020-03-10 10:37:09 +01:00
f342670532 feat(interface-types) Rename call to call-core, and remove call-export. 2020-03-09 14:33:17 +01:00
330dbac96b doc(interface-types) Fix a typo. 2020-02-26 15:34:04 +01:00
d4c01e8ddc test(interface-types) Fix all tests based on previous commits. 2020-02-26 15:32:14 +01:00
f9ef4a650b feat(interface-types) Re-implement interface kinds.
Adopt a flat structure: Flat resolved imports, flat resolved exports,
flat resolved types etc.

Also, use the latest textual format for adapters & co.
2020-02-24 18:12:01 +01:00
410d8d4476 feat(interface-types) Re-implement Type.
The semantics of “types” have changed since the previous draft. Now, a
type is like a regular WebAssembly type but with Interface Types.
2020-02-24 16:23:31 +01:00
165a8ca585 feat(interface-types) Forwarded adapters have been removed. 2020-02-24 15:56:11 +01:00
1f2a5640a6 feat(interface-types) The “helper adapter” has been removed. 2020-02-24 15:49:03 +01:00
09e57b7156 feat(interface-types) Update interface types.
According to the last working notes, new interface types are s8, s16,
s32, s64, u8, u16, u32, u64, f32, f64, string, anyref, i32, and i64.

Their binary reprensentations are changing too, from 0x00 to 0x0d.
2020-02-24 15:37:03 +01:00
ea855d29bd doc(interface-types) Add intra links. 2020-02-21 12:23:58 +01:00
0767560b79 fix(interface-types) Remove #[allow(unused)]. 2020-02-20 15:16:35 +01:00
9b98a211cd feat(interface-types) Replace nom by wast for decoding WIT's text format. 2020-02-20 14:43:58 +01:00
b9ce5b7956 feat(interface-types) Start implementing the WAT decoder. 2020-02-19 16:12:06 +01:00
80f317a1eb feat(interface-types) Ensure ast::Type is always well-formed.
As @MarkMcCaskey noted, `Type` can be corrupted because `field_names`
and `field_types` must have the same length. This patch removes the
public visibility, and adds methods like `new`, `add_field`,
`field_names` and `field_types` to encapsulate `Type` internal data.
2020-02-13 11:24:29 +01:00
8ec4eb429e doc(interface-types) Improve documentation of the ast module. 2020-02-10 15:44:28 +01:00
57692f0458 doc(interface-types) Improve documentation of the ast module. 2020-02-10 15:41:41 +01:00
a8da95b339 doc(interface-types) Improve module descriptions. 2020-02-10 15:27:04 +01:00
f206ccd55f feat(interface-types) Introduce the wasm::structures::MemoryView trait. 2020-02-10 13:00:29 +01:00
c042050497 feat(interface-types) Split the interpreter into multiple modules/files. 2019-09-26 14:14:46 +02:00
23d5e7b7b3 feat(interface-types) Draft instruction interpreter. 2019-09-19 00:18:36 +02:00
68e699e495 feat(interface-types) Add new instructions. 2019-09-18 17:12:42 +02:00
0352e39741 feat(interface-types) Continue the WAT encoder. 2019-09-18 17:12:42 +02:00
a017b920c5 fix(interface-types) get-field #1 argument is of type InterfaceType. 2019-09-18 17:12:42 +02:00
086c3bdb4c feat(interface-types) Move TryFrom from the ast to the binary module. 2019-09-18 17:12:42 +02:00
b38418fcc3 fix(interface-types) Fix visibility of various symbols. 2019-09-18 17:12:42 +02:00
2f888757d4 feat(interface-types) Split into multiple files. 2019-09-18 17:12:42 +02:00