Skip to content

Instantly share code, notes, and snippets.

@heyimalex
Created March 13, 2019 07:09
Embed
What would you like to do?
Looking at npm projects that are good candidates for being re-written in rust / webassembly!

rust-js

Looking at projects that are good candidates for being re-written in rust / webassembly!

moment https://www.npmjs.com/package/moment

https://www.npmjs.com/package/moment-timezone

could build off work in rust: https://github.com/chronotope/chrono

glob https://github.com/isaacs/node-glob#readme

see also:

js-yaml https://www.npmjs.com/package/js-yaml

Ok, this is just obvious. Could lean heavily on yaml-rust

handlebars https://www.npmjs.com/package/handlebars

It's being worked on here (to some degree)

https://github.com/sunng87/handlebars-rust

Still, a drop in replacement would be cool?

Other templating libs:

postcss and associated plugins

like the babel clone, really hard and the whole ecosystem needs to be rewritten. nah.

qs https://www.npmjs.com/package/qs

querystring parsing. it's maybe a good candidate (parsing library), but it's pretty ugly imo, and I think that

mime https://www.npmjs.com/package/mime

probably not

marked https://www.npmjs.com/package/marked

Like js-yaml, probably a good candidate. Someone else has surely done the work of making a markdown parser in rust already.

validator https://www.npmjs.com/package/validator

Eh, not too keen on this. The biggest benefit is that I get to take advantage of rust's compile time perfect hashing jam to make lookup tables fast.

ajv https://www.npmjs.com/package/ajv

json schema vaidator, probably one exists in rust

query string: https://www.npmjs.com/package/query-string

limited utility: native in node 6+ and browsers.

md5 https://www.npmjs.com/package/md5

getting this up and running would be fairly easy, but getting it to be the best wasm md5 impl possible would take some work and you'd probably learn a lot.

prettier

would probably be a super cool and very popular project honestly, but the amount of work is huge

highlight.js https://www.npmjs.com/package/highlight.js

my work on syntect_wasm compilation should be the decider! see also:

bignumber https://www.npmjs.com/package/bignumber.js

this could be interesting! and maybe even reasonably faster. However, the chaining api makes it a little hard to imagine.

see also:

ms https://www.npmjs.com/package/ms

time parsing and conversion

clean-css https://www.npmjs.com/package/clean-css

css minifier. see also: https://www.npmjs.com/package/cssnano

filesize.js https://www.npmjs.com/package/filesize

human readable file sizes

jszip https://www.npmjs.com/package/jszip

self explanatory see also: https://www.npmjs.com/package/adm-zip

jimp https://www.npmjs.com/package/jimp

native image processing, 0.5m weekly downloads and would probably see very large perf improvements. May be stuff in the rust ecosystem that's already trying this.

@mrcnski
Copy link

mrcnski commented Mar 13, 2019

glob https://github.com/isaacs/node-glob#readme

There is already a glob crate ;)

@corbinu
Copy link

corbinu commented Mar 13, 2019

I have been working on a rewrite of sax and a axios replacement in rust/wasm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment