Hacker News new | ask | show | jobs
by drinchev 2979 days ago
Last time I checked the bindings of QT[1] for NodeJS were not updated since 6 years.

I think they are still unmaintained and also are lacking the community around it. I think GitHub embracing Chrome-wrapped-apps was a significant move, since no other company did something similar for desktop javascript applications.

Maybe we will need to wait a bit more, until some of the big tech companies realises that having better QT / GTK bindings and build tools, examples, proper documentation will benefit a lot the company and the community around it. Until then, we are stuck.

[1] : https://github.com/arturadib/node-qt

3 comments

But why would I want to use Node JS?
The obvious answer to that is "because you are familiar and comfortable with JS and don't want to (or ATM don't have time to) learn the ins-and-outs of another language and its ecosystem."

That seems to be one of the main drivers behind Electron's popularity, others being easier cross-platform support (or at least the perception of that) and the vote of confidence in its stability from the likes of MS using it in their products (primarily VSCode in MS's case).

What would be your alternate suggestion, and why? (genuine question rather than a rhetorical dig: I plan to tinker with Electron for a couple of projects soon so if there is something better (or simply that is a suitable alternative to consider) out there I'm not aware of, I'd like to be made aware)

* runs on a fast JIT

* package management and modules actually work

* huge ecosystem of packages

* ability to use native code modules in needed

* has webassembly too

* runs a huge range of other languages. It can fill a role similar to the JVM and .Net runtimes in this respect.

> * package management and modules actually work

> * huge ecosystem of packages

This is satire, right?

NPM (both the tool, and the repository of packages it pulls from) are a joke to anyone outside the NodeJS bubble of Stockholm syndrome.

A company that was given $8M in venture capital and can't find more than two people to work on the main way people interact with their service, cannot be taken seriously.

Remember when everyone found out that the progress bar made NPM install packages 3x slower?

Then lets get into the actual 'ecosystem'.

The community actively encourages and embraces the sort of culture and decision making that leads to an entire module to do what you can do with this: `$foo % 2 === 0` (i.e. 'is even')

You would type more characters just requiring the module than you would just using the modulo operator.

Then you find out the same author published another module that literally just calls the other one and negates the returned result.

Let that sink in: a module, to do nothing more than prefix a function call with a `!`.

No fucking surprise the 'ecosystem' is huge. What other people call "writing code" NPM module developers look at as another opportunity to bump their ridiculous package count e-penis.

You can use NPM and NodeJS if you want, you can even "like" them. But don't for a second think that the community and practices of that environment are "good" by any comparison.

Okay, I'm going to jump on the "package management and modules actually work" thing; I'm not a noder, but I've considered using several tools that are built on Node, and every time — almost literally — `npm install whatever` fails. Linux, Windows, doesn't matter: I see the latest cool thing on Node, try to install it, and think, "If they can't even get installation to work, why should I bother?" Am I alone in this? I don't have that problem with other tools, so I don't think I'm unable to read and follow instructions. I'm disappointed, because there are a couple of toolkits for mobile development that I'd love to use, and there's a big Node roadblock in my way.
If you have a C++ compiler that works, you should be fine. I've never had an issue installing a package that isn't, in fact, a C++ issue.

Meanwhile, Python versioning of plugins is really broken, unless you use virtual environments. Maven seems to be fairly hard to integrate with IDEs (Eclipse seems to come bundled with a separate one, not sure about IntelliJ). Most other package managers I use don't have enough packages to be as useful.

> Python versioning of plugins is really broken

It is not broken - you ARE supposed to use virtual environments. I would say its is much saner than nodejs ecosystem where every conflict is being solved by having multiple versions of overlapping dependencies.

"If you have a C++ compiler that works, you should be fine. I've never had an issue installing a package that isn't, in fact, a C++ issue."

I've also had a compilation problem on Windows caused by Python not being installed (IIRC, the SASS package needed gyp, which uses Python). That was exceptional: I expect npm packages to install without issue, although I'm still bothered by how many dependent packages every tool seems to need.

> Most other package managers I use don't have enough packages to be as useful.

Let me guess, no `iseven` package?

Then learn a new language? It shouldn’t be that hard to transition between languages for UI stacks
> Then learn a new language?

Learn a new language (Python/C++/other) in order to learn and use a different framework (Qt)? Thanks for your advice I'll down tools right now and get on with that using my time the way I want to.

(Actually I've never developed anything using Electron yet, though some personal projects may get implemented that way in future should they ever get off the ground)

I fully understand much of the criticism of Electron and similar: the results are rather bulky in terms of both package size and memory use (and if you aren't careful sometimes CPU use) which can add up to quite a performance hit if running a number of small apps/tools that are large because of the framework. For interactive (or script-called) non-resident utilities startup time can be a significant issue too.

But there are a lot of entitled people out there who seem to be of a mind that because they don't like Electron (for those reasons or whatever else) they have the right to demand that developers stop using it. If you don't want to use an Electron driven application then the solution is to not use that Electron driven application. There are no doubt alternatives out there. If not then the deep knowledge you have that makes you an expert on why it would be better developed other ways should allow you to write your own and compete.

This is true for both paid-for services like this (show them who is boss by collectively voting with your wallets) and free and/or open source options (in which case making demands of the creator/maintainer seems even more egregious IMO).

</rant>

Isn’t it just as entitled to refuse learning something because you will only use the language you want? Even if it’s forcing a square peg in a round hole?

Cmon tho, any competent engineer can switch between languages without many issues.

The basics of switching to a language in the same/similar paradigm isn't that hard. Re-learning tooling, libraries, etc takes a very long time. I can rattle off reams of stuff in the languages I know, but I'd have to spend hours searching for that same stuff in other languages.
Thats very true. The tooling and dependency part about switching sucks for sure.
> Isn’t it just as entitled to refuse learning something because you will only use the language you want?

Not really IMO. If users don't like it, they can usually use something else.

A point I didn't make clear at all is "you have used Electron, eww" is a poor judgement. "It is too slow for my needs, look at this benchmark" or "it takes too much RAM, look at the problem this causes" or "it takes a while to load, look at this metric that shows the effect it has on me" are all valid and constructive criticisms. "I don't like part of what, to me as a user should be a black box, is made with" isn't (if it works for you, it works, if it doesn't for a practical reason then it doesn't, how it is made and how the maintainers might solve your issue if they chose to address it is their problem). If going from a fellow developers PoV then by all means give constructive critique but "you use Electron, you a stupid" (a tone I've seen a fair few times) isn't that, and as a developer if you want an X made a different way go make an X that way (or, back to user-land, go find one made that way, there will probably be other options).

> Even if it’s forcing a square peg in a round hole?

This can be a problem created by switching language (or framework, or other) without sufficient acclimation time: you end up using the new tools like they were your old tools, which might produce something that works badly because the new options are not optimal for that construction pattern or at least that pattern does not use the other tools to their best advantage. Have you never heard the pained yelps of "but... that just isn't Pythonic!" or similar?

> Cmon tho, any competent engineer can switch between languages without many issues.

Depending on experience level, that is rarely without at least some context switching cost even if you are already familiar with what you are switching to. Maybe you are a natural star engineer for whom this is as close to zero as makes no odds, but most of use are not quite that perfect!

Pretty sure no one thinks 'js' when they think about slim desktop apps