DEV Community

Beautiful-dom; a HTML parser built with TypeScript

Ajah Chukwuemeka on August 23, 2019

Beautiful-dom Beautiful-dom is a lightweight library that mirrors the capabilities of the HTML DOM API needed for parsing crawled HTML/XML pages. ...
Collapse
 
adam_cyclones profile image
Adam Crockett πŸŒ€

Why typescript and not a faster lower level language? (I love ts btw)

Collapse
 
ajahso4 profile image
Ajah Chukwuemeka

Remember TypeScript is mostly transpiled down to Javascript. Also, the project is for NodeJS which works with Javascript. Moreover, I was learning typescript of recent and decided to build this project with the newly acquired knowledge.

Collapse
 
adam_cyclones profile image
Adam Crockett πŸŒ€

I'm talking about webassembly, you can write programs in rust, CPP, c, Assembly script (typescript like) and others to achieve near native speeds. For JavaScript. I was a regular typescript user but node supports wasm which meant I set out to learn CPP now rust, it's enormous fun.

Thread Thread
 
mindplay profile image
Rasmus Schultz

WASM doesn't really seem like a real candidate for something like this - not if you want an API you can consume from JS, anyhow.

Most likely the amount of work you'd be able to outsource to WASM, is more or less the same work you're already outsourcing to highly optimized C code with the standard (String, RegExp, etc.) JS APIs - so I don't think there's a whole lot to gain with WASM here?

Collapse
 
moshosanya profile image
Michael Oshosanya

Good one man. Recently started learning typescript too. It's a good language

Collapse
 
ajahso4 profile image
Ajah Chukwuemeka

Thanks brother. I appreciate your shout out. I wouldn't mind collaborating with you to speed it up.