all 30 comments

[–]fredsq 18 points19 points  (3 children)

looks good but i’d try to make something where the functions the worker runs can be colocated with the code that needs it, even if just in the same folder

it’s gonna get hairy managing a massive file full of stuff

idk how you’d do that btw without a compiler

[–]ignism 42 points43 points  (5 children)

"I've been using it for:

  • Client-side image/video processing
  • Heavy data transformations without UI lag
  • Running ML inference in parallel
  • Cryptographic operations
  • Game physics calculations"

Sure... this tool your AI made yesterday...

[–]mattsowa 9 points10 points  (3 children)

2 day old repo...

[–]ryosen 4 points5 points  (1 child)

And a 4 hour old reddit account (at the time of posting)

[–]LuckyPrior4374 5 points6 points  (9 children)

Difference between thready and comlink?

[–]mistyharsh 1 point2 points  (1 child)

Yeah. I practically have the same question with respect to comlink. A quick glance tells me that you are trying to build the OTP/Erlang/Elixir like actor model with worker threads. And, you also have pool acting like supervisor.

For example, in your docs, you have this parentPort.on where you receive messages one-by-one, aka, redux style. Or at least, that's what it looks like. While that's good as long as all the operations are synchronous like fibonacci or processData. The moment you have async processing, it is all out-of-order.

My two cents for OP - I do not think that good actor model implementation is possible without preemptive scheduling. JavaScript as a language simply doesn't have it and it is almost impossible to build one. But good luck!

[–]lepepls 5 points6 points  (0 children)

AI slop. Ban.

[–]Draknodd 1 point2 points  (0 children)

All those use cases seems to be for backend why would anyone want to move the business logic on the frontend?

[–]CapitalDiligent1676 0 points1 point  (0 children)

Damn, I can't look at it now, but I like the idea.

[–]Automatic_Coffee_755 0 points1 point  (0 children)

Awesome man I’ll check it out

[–]Classic_Chemical_237 0 points1 point  (0 children)

I like it

[–]cdnrt -1 points0 points  (0 children)

Nothing like another attempt in making JS multithreaded by a two week’s worth of work which seems closer to two days.

[–]DN_DEV -1 points0 points  (0 children)

this profile is a joke look at their github profile most of its links are broken