I'm running into problems trying to create a web worker with haste. I'm running on 0.5.5.1 and there every compiled file has prepended the line 'if(typeof window === 'undefined') window = global;' in front of the js file. This seems to be fixed (26/8) in the current version of 'lib/rts.js' which seems to prepend 'if(typeof window === 'undefined' && typeof global !== 'undefined') window = global;'. This works when updating my local 'rts.js' file. However, the crypto extension added on 24/11 clearly won't work in case of a web worker.
Perhaps it could be changed into something like this?
if(typeof window === 'undefined')
if (typeof global !== 'undefined')
window = global;
else if (typeof self != 'undefined')
window = self;
Another question related to web workers. Would it be interesting to have a similar interface to web workers as the haste-app client server model? Does it make sense, and perhaps someone is already working on that? It seems neat to be able to call web workers directly and type safe.
p.s. I'm really impressed with the speed of compiled Haste programs. It is about twice as fast as a GHC version of SAPL when loading and saving midi files. It also seems significantly faster than purescript, however, that is somewhat counter intuitive and I would need to do some more testing. Besides, purescript hits a 'out of stack' fairly soon, when trying to load larger midi files. So, I'm quite impressed overall.