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

Thread syntax sugar #7

Open
aleclarson opened this issue Nov 1, 2018 · 5 comments
Open

Thread syntax sugar #7

aleclarson opened this issue Nov 1, 2018 · 5 comments

Comments

@aleclarson
Copy link

It might be cool if there was syntax sugar for "threads" (the definition of which depends on the target platform). For example, threads would compile to web workers for a browser target.

@jamiebuilds
Copy link
Owner

Ghost has reached a point where it would have to be compiled to Wasm which is starting to have support for threads now https://developers.google.com/web/updates/2018/10/wasm-threads

I'm not sure what's needed for syntax other than potentially a syntax for moving/copying values into closures to be spawned as a thread

@SCKelemen
Copy link

This looks a lot like a language I have been working on. Have you consider alternative concurrency models such as Actors or CSP?

@jamiebuilds
Copy link
Owner

Actors, CSP, etc are things you would implement on top of threads. I think they would be more in the stdlib.

@aleclarson
Copy link
Author

Thoughts on cooperative threading vs preemptive threading?

@SCKelemen
Copy link

SCKelemen commented Nov 3, 2018

I don't think that needs to be true. CSP, Actors, and threads are all independent concurrency paradigms. All of them can be implemented completely independently and without any other, and each can be implemented on top of any other.

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

3 participants