DEV Community

Discussion on: Given a chance to time-travel to 90s and rewrite the JavaScript specification, what you'd have done differently?

Collapse
 
alaindet profile image
Alain D'Ettorre

A standard library

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

Should utility libraries be centralized? However, I think Node.js and web browsers are vastly different.

I actually think towards smaller size of global object. And only import when needed.

Collapse
 
alaindet profile image
Alain D'Ettorre

A standard library would ease a lot of problems like huge node_modules with hundreds of similar utility packages and as many similar but different approaches to solve the same problems. I mean, a standard library, like that on Python or PHP.

Now that I think about it, some other cool things would be having a single type of file module (no more ASM and CommonJS) and import/export syntax, as well as avoid any unwanted context binding (like with the old function syntax)

Thread Thread
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

Now that I think what it actually does IRL.

  • Golang + VSCode -- on first run, it installs many code quality tools to the central store, i.e. GOPATH
  • Python + VSCode -- if virtualenv is present, it attempts to install "only pylint" to the venv, otherwise, it will try install globally.

I would argue that "A standard library would ease a lot of problems like huge node_modules" isn't real. The approach is whether you will use isolated environment or not. Also there is a solution in Node.js world, like pnpm, but is it against Node.js's philosophy?