
Debugging


Via Jay Gischer
Circa 1970
Another attempt to explain Haskell to the wilfully ignorant.
This post is an experiment I decided to attempt after conversations with Ben Lesh and some other folks. I will assume as little knowledge of Haskell as I possibly can here. Later we’ll talk about some tools we have in Haskell to make the pattern more conceptually compact.
This is an excellent productivity tool. Send this to your BA.
How to deeply clone an object in JavaScript? The simplest way is via JSON eg.
JSON.parse(JSON.stringify(obj))
See below for two alternatives which use browser APIs in unexpected ways.
The first one, the asynchronous PostMessage version runs 7 times faster than the JSON approach. These methods also have the advantage of working with circular references and non-serializable types like Dates, Sets, Maps and ArrayBuffers etc.
Something a little less wierd really needs to get built into JavaScript.
https://twitter.com/dassurma/status/955484341358022657



How Rust handles asynchronous IO
Compile WebAssembly faster than it comes in with streaming compilation and Firefox’s new baseline compiler.

New ecmascript recommendation:
[42, …undefined] –> [42]
This is to make it consistent with:
{ a: 42, …undefined } –> { a: 42 }
As opposed to throwing a TypeError exception. I’m not sure this new behaviour is a great move but I think it’s because:
Object.assign({ a: 42 }, undefined) –> { a: 42 }
https://github.com/tc39/ecma262/pull/1069