Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #28935
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2015-12-01 18:18 -0800 |
| References | <e4834b6d-6881-46cd-8c2b-739f3fa6dd11@googlegroups.com> <faacbd18-19a2-4414-b76b-a7f5a5ce4db9@googlegroups.com> <a490147e-d786-474f-a8c7-6454d624a173@googlegroups.com> <3e209cb8-9ce6-44f4-95d1-2731a73589d6@googlegroups.com> <83b2c189-cfac-41e4-987e-765b4f274982@googlegroups.com> |
| Message-ID | <70743cae-2935-4fe9-b9b4-cf406a6ea88e@googlegroups.com> (permalink) |
| Subject | Re: Concurrency folded out? |
| From | "Michael Haufe (TNO)" <tno@thenewobjective.com> |
Øyvind Teig wrote:
> [...] Not to make it faster or more elegant, just to learn JavScript and how JavaScripters think.
Given the size of the community, I'm afraid it's more like a Bazaar and a Tragedy Of The Commons. "JavaScripters" are better described by their chosen subgroups (What libraries and frameworks do they choose). I guess you could think of it as somewhat analogous to the C++ community debate over being reliant on Boost or not. Depending on which framework/library community you follow you can identify a certain skill level and a certain mindset around what development in JavaScript is.
Michael Haufe (TNO) wrote:
> > The other listed solutions are an abstraction over existing functionality:
> >
> > Events/Callback = Concurrency
> > task.js = Concurrency
> > Web Worker = Parallelization
> > node-csp = Concurrency
> > RxJS = Concurrency + Parallelization (Using Web Workers)
Øyvind Teig wrote:
> Great table. I'll take it into my blog note. I was aware of the contents, but it made it clearer. What functionality of JavaScript would you say that these are abstractions are on top of?
You can look at the respective web pages for details:
[1] <https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame>
[2] <http://taskjs.org/>
[3] <https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers>
[4] <https://web.archive.org/web/20140915015947/http://jlongster.com/Taming-the-Asynchronous-Beast-with-CSP-in-JavaScript?>
[5] <https://github.com/Reactive-Extensions/RxJS>
Øyvind Teig wrote:
> A run-time system or operating system (making threads (with different kind of process model) available) written in C, I won't consider an abstraction over existing functionality. I'd like to know what you mean.
I'm using "abstraction" in the informal sense (Not writing code irrelevant to the problem you are solving). For example: a given library could provide an API such as the following for managing mouse clicks:
mouseClicks.map(function(clickEvent){ ... Do Something ... })
What you're not seeing is the moderate amount of code required to give you this, as it requires converting the provided standard Subject/Observer event model into a Reactive event model.
Øyvind Teig wrote:
> If I may ask, provided I do want a concurrent tree, which methodology would you have chosen? I then assume that Web Worker is out.
Personally I'd probably still try to recreate the effect with an L-System description and use that to drive what I write to canvas pixel data, but that's mostly because I'm a fan of formalisms.
You can use Web Workers still, but the approach would be to have each worker (however many you want to use) draw a generation on a canvas pixel array. When the worker is done it can post the data back to your main thread (which happens asynchronously) which will then update the main canvas when the animation frame calls your render code.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Concurrency folded out? Øyvind Teig <oyvind.teig@gmail.com> - 2015-11-18 00:48 -0800
Re: Concurrency folded out? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-11-19 17:13 -0800
Re: Concurrency folded out? Øyvind Teig <oyvind.teig@gmail.com> - 2015-11-20 04:47 -0800
Re: Concurrency folded out? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-11-21 10:41 -0800
Re: Concurrency folded out? Øyvind Teig <oyvind.teig@gmail.com> - 2015-11-22 13:47 -0800
Re: Concurrency folded out? Øyvind Teig <oyvind.teig@teigfam.net> - 2015-11-24 13:15 -0800
Re: Concurrency folded out? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-12-01 18:18 -0800
Re: Concurrency folded out? Øyvind Teig <oyvind.teig@teigfam.net> - 2015-12-04 11:36 -0800
Re: Concurrency folded out? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-12-05 10:25 -0800
Re: Concurrency folded out? Øyvind Teig <oyvind.teig@teigfam.net> - 2015-12-08 00:04 -0800
Re: Concurrency folded out? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-12-08 16:04 -0800
csiph-web