Live data from Hacker News

The Path to Parallel JavaScript

blog.mozilla.org

1–10 of 58 posts

Re: The Path to Parallel JavaScript

#5
Great developments, since, imho, we really need multi-threading to make decent user-interfaces (ones without hick-ups due to blocking of the cpu-resource).

I think what we need is immutable data-structures to be shareable between threads. This approach should also allow structural sharing between threads, allowing for efficient and safe data structures.

Also, I could see a use for a mechanism where a thread creates a data-structure, then marks it as read-only, such that it can become shared.

Re: The Path to Parallel JavaScript

#6
post #3

I would love to see a channel primitive similar to Golang's. They really seem to have hit the nail on the head with that one.

Clojure's core.async library works wonders in ClojureScript giving you channel primitives and coroutines.

I've never tried using them across web workers however.

Re: The Path to Parallel JavaScript

#7
post #3

I would love to see a channel primitive similar to Golang's. They really seem to have hit the nail on the head with that one.

The CSP model is very nice, but I don't think that what this proposal is aiming for. CSP is more about concurrency, while the post makes it clear they are looking at parallelism. This is more addressing "things that appear to be single threaded but run faster" like image analysis, for instance.

Re: The Path to Parallel JavaScript

#8
post #3

I would love to see a channel primitive similar to Golang's. They really seem to have hit the nail on the head with that one.

Clojure and ClojureScript have core.async which does a great/better job https://github.com/clojure/core.async/blob/master/examples/w...

There's also a video if you care to watch https://www.youtube.com/watch?v=enwIIGzhahw

Post reply on HN