Reading these old Linus exchanges always has me in two minds. On the one hand, it's great to peer into the mind of a genius and see the thought process, but on the other - and in light of his stepping back after recognising his own highly unprofessional behaviour over the years - I wonder if we should repost and idolise these emails.
Are people - especially young and impressionable developers - able to separate the two sides of the coin, or does it serve to plant a seed of normalisation for this kind of communication?
construct-js uses DataView under the hood. I wrote construct-js to ease working with binary data by allowing you to name and reference sections, and handle things like endianess easily in one place. With a DataView, I still need to calculate offsets into a structure manually, whereas construct-js has .getOffset(name) and .getDeepOffset(path). If performance is key however, use the lowest level of course.
Map wouldn't have really brought a lot of clarity or control. You'd have to specify an array of array-pairs, which is noisy IMO, and then you wouldn't have the benefit of being able to programatically/conditionally add fields.
I might consider a static `Struct.fromMap(name, mapObject)`, but as a complimentary API.
Thanks! When it comes to performance I can understand choosing a more low level approach. construct-js trades performance for declarativeness (though I suspsect that I can do a lot of optimising under the hood).
As for DEFLATE, I'm working on an automatic bit level structure at the moment which would allow for unaligned structures. Should be in the lib in a couple of days.
Hey - author here. You're completely right, but I hope the basic understanding will whet peoples appetites to try some more exotic stuff! Really I was just trying to lift the veil of what can be a quite intimidating subject if you haven't grazed past it before. Thanks for checking it out!
Indeed, the core concepts are essentially exactly the same. This is a lot simpler of course because it doesn't need to do anything with drawing or sound.
I really like this project https://github.com/juchi/gameboy.js/ . I'd like to do something similar myself but more in the coding style I've used on the 16-bit VM.
Ah very cool! Rust seems like an awesome language, especially for something like this. I'l going to take a dive into your project at some point in the week
Are people - especially young and impressionable developers - able to separate the two sides of the coin, or does it serve to plant a seed of normalisation for this kind of communication?