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

Run processes in web workers, use message passing for orchestration #18

Draft
wants to merge 37 commits into
base: main
Choose a base branch
from

Conversation

JohnStarich
Copy link
Collaborator

Closes #11

This is currently a huge refactor and a work in progress. Hopefully will suss out the major bugs soon 😅

@JohnStarich JohnStarich force-pushed the feature/web-workers-2 branch from 909d19d to 6c97ee7 Compare April 8, 2022 02:57
@gedw99
Copy link

gedw99 commented Sep 29, 2022

I have been working on exactly the same thing myself but you seem to already be way further down the road.

I am using tinygo to compile golang to wasm and then exposing it as a WebWorker. The Dwarf debugging works in the chrome browser which makes it really easy to test your golang . Very promising for those interested in building a IDE or just reusing golang in the Browser .

I am yet to pull this PR to try it out . I saw the latest update to go 1.9 too. Nice

@JohnStarich
Copy link
Collaborator Author

Hey @gedw99, good to hear on the debugging side of things with tinygo. Mainline Go's support for debugging has been difficult to say the least. I do hope it improves.

This PR is so very close to being ready. Unfortunately, I'm continuing to have setbacks especially with regard to inter-worker communication. The latest build I have (may not be pushed here yet) is doing everything with web workers and works pretty well, but still has some issues with sharing file descriptors over pipes. Until those issues are overcome, I hesitate to merge them in as it would decrease reliability of the currently deployed version.

I'm maddeningly close – only thing holding me back right now is the lack of a useful debugger. Walking through individual Wasm instructions isn't my idea of fun 😅

This was referenced Oct 2, 2022
@gedw99
Copy link

gedw99 commented Oct 15, 2022

It’s not possible to use tinygo ?

There are pretty easy work around for reflect is that’s the issue.

Here is an example of debugging tinygo wasm with Chrome. It has source maps so you step through actual golang inside chrome.

https://blog.noops.land/debugging-webAssembly-from-go-sources-in-chrome-devtools

You might already know about all the above ?

@gedw99
Copy link

gedw99 commented Oct 15, 2022

Thankyou for persisting on this. I think a ton of devs doing wasm golang want Web workers but just don’t have time / energy to work it through.

Also there are a ton of disruptive things that can be bunk on top of hackpadfs. Unblocking the gui thread by having the FS in a Web Worker unblocks tons of possibilities !!!

@JohnStarich
Copy link
Collaborator Author

Hey @gedw99! If it takes much longer, I may need to try tinygo instead. I'm feeling the sunk-cost fallacy pretty strongly right now 😂
It at least appears I'm close to done. There's some message passing issues (messages showing up out of order or duplicated) but that's essentially all I can see remaining.

Thank you for your words of encouragement ❤️

@amlwwalker
Copy link

hey @JohnStarich how is this going?

@JohnStarich
Copy link
Collaborator Author

Hey @amlwwalker, thanks for checking in. Not swiftly, unfortunately. Probably will be quite a while yet. I've hit several frustrating brick walls in the process of fixing this up. While I would love to say "going great, almost done", I don't want to give you the wrong idea – this likely won't be done for many more weeks.

Instead of giving up, however, I've been investing my time in fixing everything that's been slowing me down. Recently, I've been tackling the lack of tools for Go + Wasm. Specifically I'm making it possible to write more and higher quality automated tests with improvements to wasmbrowsertest (#41, #42) and Hackpad's underlying libraries (safejs, #8, #31). These are a critical part of my workflow, so hopefully this will be the catalyst we need.

It's very slow going, but I fully intend to root out these impossible-to-debug failures I'm hitting on this PR eventually!

@paralin
Copy link

paralin commented Mar 21, 2023

hi @JohnStarich looking forward to seeing this exciting work proceed. is there anything that I can help contribute to?

@gedw99
Copy link

gedw99 commented May 16, 2023

@JohnStarich

like @paralin said - if i can help please shout :)

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

Successfully merging this pull request may close these issues.

Use Web Workers for true concurrency
4 participants