4 ms·
“Pure” does definitely connote that you’ll be able to read all the code in the given language. That’s exactly what “pure” means - “pure rust”, “pure go”, etc.
by pstoll 4y ago
“Pure” does definitely connote that you’ll be able to read all the code in the given language.
That’s exactly what “pure” means - “pure rust”, “pure go”, etc. IMO you can’t say the heart of all the work is a c++ lib and call it a “pure JS” anything.
More accurately / correctly / usefully would be calling it “JS wrapper over a c++ library cross compiled to JS”. Or maybe “All JS at runtime” or some other qualifier.
Want to see how to cross-compile a non-trivial c++ lib? Check out here!
Want to see a great JS wrapper library where we had to make cross-language & cross memory-management API decisions? Check this out!
But - want to read some awesome high performance image processing algorithms in JS? Not this.
- danShumway 4y ago> “Pure” does definitely connote that you’ll be able to read all the code in the given language. I'm not sure where the line here is supposed to be drawn, but I don't personally think looking at asm.js code is significantly harder than looking at something like compiled Typescript, and certainly it's not any harder than looking at minified Javascript. If I'm going to be debugging code, they're both going to be annoying to look at. We're quibbling over definitions so I'm not going to say that you're wrong, "pure" can mean whatever you want it to mean. I'm just saying that most JS devs I know consider (for example) JSX code to still be pure Javascript when it's compiled. It seems a little odd to me to look at something where every single line of code is Javascript, being run entirely in a Javascript interpreter, and say that isn't actually completely real Javascript, but if the programming circles you frequent are different and think about this differently, :shrug: more power to you. > But - want to read some awesome high performance image processing algorithms in JS? Not this. I also wouldn't necessarily assume that every Open Source program written in only JS without compilation is going to be well suited for reading or learning from. But again, sort of splitting straws here -- my only concern is that you're probably going to be disappointed a lot if you equate "pure Javascript" with "readable".
- rhacker 4y agoI tend to agree. When I see "pure" I don't think about the code being hand written in JS I think more about the potential of browser run OR that there are no native modules for Node required. That being said perhaps a poll is needed to find out what most people think.