News for hackers. Stuff that matters.
Re:Brython – A Python 3 implementation for client-side web p... by rrrix1 on Monday July 06, 2020 @12:33PM (#23749576)
Important footnote: the creator of Node.js is also the creator of Deno. One of his key reasons for "starting over" with Deno is that the lack of a standard library in Node.js is one of it's biggest pitfalls. That is also one of Denos biggest features (among many other awesome things). Unfortunately there is still a long way to go for Deno to "catch up" to node.js.

As an experienced JS/TS and Python developer, I can confidently say that the Node.js / npm / yarn ecosystem sucks compared to what you get with Python and PyPi.

Re:Brython – A Python 3 implementation for client-side web p... by nawgszy on Monday July 06, 2020 @05:30PM (#23752999)
>the lack of a standard library in Node.js is one of it's biggest pitfalls

>npm / yarn ecosystem sucks compared to what you get with Python and PyPi

So you claim Python has a better standard library AND a better package ecosystem? That's bold. Care to expand on why you feel this?

I ask because of this. From the perspective of a JS dev who helps Python devs at work, pip seems pretty weak, its publishing story even weaker, and then both languages seem to have all their strength in their package ecosystems (Python: tf, django, dataframes, etc; JS: react, typescript, etc). So now to see you say "npm ecosystem sucks compared to pip" has me wondering what I'm missing.

Re:Brython – A Python 3 implementation for client-side web p... by zenhack on Monday July 06, 2020 @09:58PM (#23754864)
As someone who's done a lot of python and a fair bit of JavaScript, I'll agree with the preference for the python ecosystem. I guess my perception of the difference is a quantity vs quality thing. My experience has been that python packages tend to be more stable, better documented, and frankly more reasonable in scope. There's less framework churn (Django has been around for what feels like forever, as have lighter solutions like Flask) and libraries tend to include enough functionality to seem with adding a dependency for; the number of transitive dependencies on a typical JS project is alarming. Also much less of the ecosystem feels like it's just trying to make up for an absent standard library. You don't see stuff like underscore in python land.

Both languages suffer from patchwork build infrastructure; interpreted languages are great when you have one file and no dependencies, but as soon as you grow a bit beyond that rules about where to find modules make things complicated. Both languages have developed tooling around this that suffers from being an afterthought, and I'm not sure which is worse.

Re:Brython – A Python 3 implementation for client-side web p... by nawgszy on Tuesday July 07, 2020 @04:43AM (#23757022)
I guess this might not strictly belong to "the package ecosystem", but I strongly disagree that you can compare the npm packaging story to the pip packaging story. Publishing to npm, hosting your own npm instance, configuring npm to look behind proxies for certain packages, an opinionated `package.json` with real functionality beyond dependencies, a unified entrypoint, wow it actually boggles my mind to hear Python people say pip is even in the same room as npm.

Definitely let's be clear - babel & webpack and the associated ecosystem are a pain, but those are mostly borne of necessity to transpile HTML/CSS/JS from frameworks, and not because node.js itself isn't a decent language.

Finally, I don't really follow all this business about the lack of standard library. Can you explain to me what you mean? What parts of the Python standard library are a part of your everyday toolkit? I've built a lot of web apps over the years and the only time I've ever used lodash is for throttle and debounce.

Re:Brython – A Python 3 implementation for client-side web p... by pseudalopex on Wednesday July 08, 2020 @04:26AM (#23767990)
What's the matter with publishing to PyPI or hosting your own instance?

The Python ecosystem makes publishing binary packages easy. node-pre-gyp might come close if you use S3.

The most used NPM packages[1] overlap with Python's argparse, datetime, glob, os, shutil, uuid, and xml modules.

[1] https://www.npmjs.com/browse/depended

Re:Brython – A Python 3 implementation for client-side web p... by nawgszy on Wednesday July 08, 2020 @01:00PM (#23771787)
>What's the matter with publishing to PyPI

This is a succinct guide to publishing a PIP package: https://medium.com/@joel.barmettler/how-to-upload-your-pytho...

An npm publish requires you to run `npm publish`, assuming your `package.json` points to the entrypoint of your code. Remember: `package.json` is pre-populated when you start your project with `npm init`.

Also, I was able to run my own NPM instance with a zero-config tool, I expect Python has parity there.

Anyways, pip... Just the other day, I went to use a Python project I had been regularly using, and without any changes to Python, my OS, pip, or the project, it completely started failing. Some errors that the `ssl` module wasn't available. How can a module not be available? There was no easy solution, all to something triggered by nothing. This install was literally done thru a source-controlled script too. It's a pretty awful situaton.

Anyways, NPM has never so wholly failed me, and in the worst cases where it fails it usually has helpful messages directing the user what to do.

That plus tools `npx` make it pretty clear to me, Python is literally version and dependency hell. NPM has had this all on lock for years now

Re:Brython – A Python 3 implementation for client-side web p... by zaro on Tuesday July 07, 2020 @01:57AM (#23756143)
Indeed, pip feels like a joke after using npm.

Not that npm doesn't have flaws, but it gets much more things right.

Re:Brython – A Python 3 implementation for client-side web p... by zaro on Tuesday July 07, 2020 @02:28AM (#23756315)
> As an experienced JS/TS and Python developer, I can confidently say that the Node.js / npm / yarn ecosystem sucks compared to what you get with Python and PyPi.

I can say the same. As an experienced Python and TS/JS developer, I confidently state that Python ecosystem sucks compared to what you get with typescript and npm. And if we take only type systems TS is on another level compared to Python.