“every rust project has a billion dependencies”

oh no they made code composable oh nooooooo should we call someone??

rust has a lot of problems, but let me tell you: “micro libraries” isn’t one

splitting packages per concern is good for build performance, it’s good for review, it’s good for API evolution.

the problems are technical (compiler perf), financial (funding OSS), human etc.

@fasterthanlime Honestly, I've never had a problem with Javascript microlibraries, let alone Rust ones. I've never been a huge consumer of them I guess, but it's always been a solid experience.

@ddr @fasterthanlime The main issues I've seen with JS microlibraries are:

1. things that should be in the standard library
2. things where the implementation everyone ends up using is pretty shoddy
3. bad governance leading to disasters due to a commonly-used dependency disappearing or becoming a malware source

and yeah none of those are problems with microlibraries themselves.

I've also seen JS devs be very hesitant to update their dependencies leading to a miasma of security issues.

@ddr @fasterthanlime Why I don't like such packages:

is-number - Claims that numeric strings are numbers but NaN and inf are not.
falsey - Has a weird list of words that are considered false.
to-regex-range - Something that I consider a bad idea.
And apparently it's
heavily used
repeat-string - claiming they have the fastest implementation but turns out it's mostly because of caching and bad benchmarking

All those libraries make assumptions that when not carefully checked will create problems down the line.

Those examples are all from the same author because it was the fastest way for me to find examples.
is-number/index.js at master · jonschlinkert/is-number

JavaScript/Node.js utility. Returns `true` if the value is a number or string number. Useful for checking regex match results, user input, parsed strings, etc. - jonschlinkert/is-number

GitHub
@interru @ddr @fasterthanlime
But NaN isn't a number. That's why it's called "Not a Number"

@kirtai @ddr @fasterthanlime it's part of the primitive type number. Let me quote MDN:

NaN ("Not a Number") is a special kind of number value [...]Names often don't fully convey the full complexity leading to wrong assumptions. is-number doesn't just check for type number but also for numeric strings and NaN is part of type number despite it's name.

JavaScript data types and data structures - JavaScript | MDN

Programming languages all have built-in data structures, but these often differ from one language to another. This article attempts to list the built-in data structures available in JavaScript and what properties they have. These can be used to build other data structures.

MDN Web Docs