Stream: git-wasmtime

Topic: wasmtime / PR #3807 Implicit type conversions in ISLE


view this post on Zulip Wasmtime GitHub notifications bot (Feb 22 2022 at 22:07):

cfallin edited PR #3807 from isle-implicit-conversions to main:

An initial sketch of the ISLE compiler implementation for implicit type conversions (#3753). I can clean it up a bit but this is the general shape at least.

Two implementation bits: (i) I opted to add conversions as their own IR node type, rather than try lowering these to extractors/constructors to share that code, as the operations are just a tiny bit different (not associated with a term, for example); and (ii) there is the option to denote a converter as returning a borrow or a value -- the former is useful in patterns, the latter may be necessary if the converted value does not already exist inside the original or in the context, and we also always clone to a value when in the right-hand side to avoid holding a borrow on the mut context.

I'll work a bit further ahead by trying to use this to simplify some of the lowering rules, to make sure it actually works as we hope it will (but any such use will be merged by a later PR).

cc @fitzgen for thoughts?

view this post on Zulip Wasmtime GitHub notifications bot (Feb 22 2022 at 22:19):

cfallin updated PR #3807 from isle-implicit-conversions to main.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 19:00):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 19:00):

fitzgen created PR review comment:

Thanks so much for writing these tests! <3

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 19:00):

fitzgen created PR review comment:

nitpick: missing trailing newline. and since I'm here, "for unit tests only" is kinda redundant since that is what dev-dependencies effectively are already.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 19:00):

fitzgen created PR review comment:

Or just manually factor out the conversions into a single conversion with a let.

Bringing up CSE here is opening up more questions about implementation and how we guarantee that this is actually semantics-preserving than it answers in my mind, so sort of seems like a distraction from what is otherwise prescriptive documentation.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 19:00):

fitzgen created PR review comment:

Can we have tests for when

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 19:00):

fitzgen created PR review comment:

Package this up into a helper function like you've done for the exprs?

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 19:00):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 19:55):

cfallin updated PR #3807 from isle-implicit-conversions to main.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 19:56):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 19:56):

cfallin created PR review comment:

Done!

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 19:56):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 19:56):

cfallin created PR review comment:

Added!

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 19:56):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 19:56):

cfallin created PR review comment:

Yup, I'm glad we have them now!

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 19:56):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 19:56):

cfallin created PR review comment:

Fixed!

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 19:57):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 19:57):

cfallin created PR review comment:

Good point, just removed this parenthetical for now; we can work out the details and document appropriately if/when we need to do this.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 20:06):

cfallin updated PR #3807 from isle-implicit-conversions to main.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 20:15):

cfallin updated PR #3807 from isle-implicit-conversions to main.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2022 at 21:15):

cfallin merged PR #3807.


Last updated: Dec 23 2024 at 12:05 UTC