Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Conversation

@ithinuel
Copy link
Contributor

Constrained targets such as microcontroller will rarely have more than a few kilo byte of stack.

@parity-cla-bot
Copy link

It looks like @ithinuel hasn't signed our Contributor License Agreement, yet.

The purpose of a CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen licence.
Wikipedia

You can read and sign our full Contributor License Agreement at the following URL: https://cla.parity.io

Once you've signed, please reply to this thread with [clabot:check] to prove it.

Many thanks,

Parity Technologies CLA Bot

@ithinuel
Copy link
Contributor Author

The main page of the repo states the below in respect of contributions i.e. it doesn’t say you must sign up to a contributor licence agreement

Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in parity-wasm by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

The Readme should probably be updated if people now have to sign a CLA to contribute. Or this bot disabled if it's no longer the case.

@NikVolf
Copy link
Contributor

NikVolf commented Oct 24, 2019 via email

@athei athei requested review from NikVolf and pepyakin and removed request for NikVolf January 14, 2021 08:52
@athei
Copy link
Member

athei commented Jan 14, 2021

Is this still relevant? @NikVolf @pepyakin

@athei athei requested a review from NikVolf January 14, 2021 08:53
@ithinuel
Copy link
Contributor Author

It is still at least for my usecase :)

@pepyakin
Copy link
Contributor

Sorry for the delay, first of all.

Can you share more info about your use-case? I am wondering why would you want to use parity-wasm on an MCU.

I think this PR would de-optimize the non-MCU code path, e.g. when we are reading from a file.

@ithinuel
Copy link
Contributor Author

ithinuel commented Jan 14, 2021

Running wasm on an MCU as an alternative to mycropython or Lua except that with wasm the compilation is done ahead of time.
In my case it is/was mainly a proof of concept and not (yet) embedded in an actual product.

What are the advantage of running an interpreter on non-mcus rather than jit solutions (Lucet/Wasmer/Wasmtime etc) ?

Anyway, I would be happy with a reduced-stack-usage feature and making all use of buffered_read rely on configurable constants rather than hardcoded values. 😄
If that works for you I can amend this PR accordingly :)

EDIT: However, a feature flag would also require a similar flag in wasmi to pass over the feature dependency.
EDIT2: Prepared a commit for both wasmi and parity-wasm with a feature flag reduced-stack-buffer.
The commit on parity-wasm also replaces all hardcoded buffer sizes with a const defined at the start of the related module.
It works great :) It you're ok with that I'll update this PR and wasmi-labs/wasmi#220

@ithinuel
Copy link
Contributor Author

The PoC can be found here :

ithinuel@90bf032
ithinuel/wasmi@e353a61

Note this is based on parity-wasm 0.41 instead of 0.42.3 because wasmi 0.7.0 is dependent on that older version.

@athei
Copy link
Member

athei commented Jan 18, 2021

I think that would work for me. What do you think @pepyakin ?

@pepyakin
Copy link
Contributor

Yeah, I wouldn't mind to include that. Although I am not sure if we can give any strong commitment on supporting this use-case long-term at this moment.

@ithinuel
Copy link
Contributor Author

Being mindful of the memory usage (especially on the stack) is always a good thing.

The commitment should be limited at keeping the value in constants rather than hard-coded.

I'll push the extra commit to this PR and will create a new PR on wasmi to support the feature forwarding.

@ithinuel ithinuel force-pushed the render_constrained_system_friendly branch from 90bf032 to 6135140 Compare January 19, 2021 18:38
Copy link
Member

@athei athei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants