Advice for Web Workers

I have a super-basic Halogen UI for a sudoku solver

Here it is for the curious. (Ctrl+click to enter your own puzzle)

Right now, the whole thing freezes up while a solution is computed, for the harder to solve puzzles this is quite noticeable. It seems like the ideal place to shove a Web Worker.

I think I know how I might accomplish this entirely through FFI. If, however, anybody has beginner-friendly examples of doing this with PureScript (perhaps even Halogen Specifically), I’d be interested.

If anybody has seen success with a specific library, I’d be interested in that too.

3 Likes

This isn’t quite what you’re looking for, but it might be a nice reference implementation: https://github.com/natefaubion/purescript-node-workerbees

Unfortunately, workerbees is very node specific. You could maybe use something like the Send class as a serialization reference.

How about https://github.com/truqu/purescript-workers ? Needs to be updated, I think.

Yeah, I’ve been trying a few different libraries, but getting the dependencies on older libraries to play nice is a headache. I think I’ll need a bit more experience before I jump head-first into trying to update a library myself :slight_smile:

1 Like