Hacker News new | ask | show | jobs
by gbuk2013 17 days ago
I’m a JS/TS dev (and fan) I don’t think either is a replacement for Python. They are not standalone languages but require some runtime to interact with the world (DOM or Node.js etc) which have limited capabilities for interacting with the system - their focus is network services. It’s not that inaccurate to say that JS is just API for a C++ app. :)

Now if .NET was still not so embedded in the Windows ecosystem that would be very interesting to me to jump from TS. As it is I am learning Go instead.

3 comments

This is a non-sequitur? Python is also not a "standalone language" and requires "some runtime".
Sure but that runtime is much more general purpose - JS runtimes are focused on network apps. For example you can write an app like Calibre in Python and QT and it is much lighter than writing something with JS and Electron.

Python is easier to interface with C/C++ libs.

The async loop does not automatically make it "focused on network apps". Most apps I work with in Python also run on an async runtime.
It’s not the async loop - it’s interfacing with the system. JS is designed to run in a sandbox and the only way out in say Node.js is to write C++ addons.

For example you don’t get to see TCP headers with Node out of the box and you can’t craft packets, whereas you can in Python.

Yeah, I've thought about this since I do prefer JS as a language... Always thought the main advantage of Python was interaction with C libs. Which is also why CPython was the only serious option for an interpreter, even though things like PyPy were faster.
> require some runtime to interact with the world

This was why I was excited by Bun until recent events. A typescript runtime with a rich standard library, and fast. It looked like it would be a great sweet spot for many use cases.

.NET has had Linux support since 2016 or so. The only major part of .NET that is still stuck in Windows is official UI frameworks from MS, though there are third party frameworks like Avalonia that support Linux.
I am well aware it supports Linux but the vast majority of work still involves being in Windows-only shops which is a circle of hell I am keen to tread only when I absolutely have to. :)