Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http bindings? #84

Open
jtenner opened this issue Jan 20, 2022 · 1 comment
Open

Http bindings? #84

jtenner opened this issue Jan 20, 2022 · 1 comment

Comments

@jtenner
Copy link
Contributor

jtenner commented Jan 20, 2022

A large portion of the AssemblyScript community could really use a way to parse http, and making bindings for something battle tested and safe would be beneficial to help aid in adoption of lunatic by users of AssemblyScript. This might affect other languages like grain which probably don't have http libraries to choose from.

These bindings can also be hidden behind a flag so that binaries remain small for rust developers.

@bkolobara
Copy link
Contributor

bkolobara commented Jan 20, 2022

I'm generally not against shipping a http server with lunatic. I mean, Go has one in the standard library and they are doing fine :).

If you are interested in taking the time and drafting out a proposal it would be a great starting point. I understand that it's a lot of work, HTTP has a big surface area and is complicated. However, if there is a nice way of modelling it with processes and we can create host functions with good ergonomics, I think it could be a good addition. There are so many things to think about (http1/2/3, tls, websockets, keep-alive, ...) though, it will take us some time until we figure everything out.

Another approach would be to use an existing guest-side web server in lunatic (e.g. https://github.com/bailion/puck) and modify it so that it can spawn processes from AssemblyScript modules. Then you could send all HTTP requests as messages to it and get the responses back as messages. All APIs to make this work already exist in lunatic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants