"Luckily, most of them are using the same version of lodash, which just needs one lodash to install inside node_modules. This is often not the case with real-world production projects. Sometimes, different packages require different versions of other packages."
Npm lets you install several versions of the same package. This has the advantage of saving the dev the testing of their lib with a wide range of dependencies versions: it almost always works. Unfortunately, that means most devs just choose one version and call it a day. They build libs like one would build a project: as you were alone in the world.
Because of the small stdlib, you need dependancies, sure.
But why this idea that each dependency must be very small, forcing you to install a hundreds childs, which, themselves, will install a hundred until the pyramid of files start to turn node_modules into a stress test?
One idea that probably got encoded in the culture is that this code would also have to ship to the client. By having small deps, nobody had to wait around for more advanced tree-shaking (and its idiosyncrasies) to enter the picture.
The problem is not small packages or huge dependency trees. It's the fact widely used packages have to be installed at all. This is compounded by the package manager which allows packages to have independent copies of their dependencies.
We should have a de facto standard library that gets distributed along with the language's reference implementation. Widely-used packages that have a stable and well-designed interfaces should be distributed by default. If something isn't being used anymore, it can be dropped from the standard library while still being available from the repositories.
The problem is not small packages. The problem is there are many of these small libraries trying to solve the same problem (extending the small standard library more). And when there are no clear winners your dependency tree will be full of packages trying to do the same.
Which is weird. I would have expected have the leftpad scandal that the community would have found a balance.
To me, culture is a feature, and despite using JS a lot since it has a monopoly on the browser, the community culture never clicked with me.
I often feel like they are reinventing the wheel, not learning from other techs solving the same problems, under and over-engineering, regularly guilty of the XKCD 927 syndrom.
Few projects taste integrated, working together, clean. The stacks looked like hacked together. Agreement on best practices and conventions are timidly showing up. It also seems popular tools are just starting to stabilize and the breaking modifications rhythm to slow down. At least more than anywhere else I worked.
There is no way I can be objective saying this, but anyone with the same feeling?
1) JavaScript is a first language for many, many new developers, especially the ones not coming from a formal computer science program. This is because it's multi-paradigm, extremely hireable, runs on everything, runs on the web specifically, and other reasons. If you're only going to learn one language, it's a very good and versatile choice. So its community has a lot of inexperienced members.
2) Because it's such a focal point of the industry, it gets a lot of attention from major players as well and has been evolving rapidly in terms of core features. These features usually get tested out first in the form of packages.
3) Being a dynamic language it's very easy to extend and hack. The prototype system even allows you to modify the behavior of its core primitives.
4) The more experienced devs who use it are often dissatisfied with the qualities of the base language, and so take advantage of its flexibility to try and extend it into what they think a good language is (see TypeScript, Ramda, RxJS, etc).
The response to the leftpad scandal was for NPM to disallow packages being unpublished once they've been out for 72 hours, which really should've always been the case.
Separating the IO from the rest of the program is always a good practice, that we keep rediscovering.
E.G:
- UI in React are trying to be just rendering functions with one input and one output. Even more so with hooks.
- in python, there is a new trend of providing "Sans I/O" (https://sans-io.readthedocs.io/), and async/await are not just keywords, but a generic protocol created to delegate I/O to something from outside your code.
It's interesting to see that on very old systems, even the hardware was organized that way.
The book Propaganda is good, but you can feel the naive vision of capitalism, corporation and power in general. The author seems to genuinely believe the invisible hand will balance things out, that people won't abuse their power and that ethics were a stronger motivator than money in the system.
This is a false dichotomy and assumes there are only two choices:
- not handling the pandemic
- tracking the population
You can get information about people assembling in other ways:
- helicopters
- intel gathering
- cops and army patrolling dressed as civilian
- create groups of citizen in town responsible to patrolling
And probably many I don't know about.
Then you add to that: keeping to communicate with the public, testing a lot, providing masks, etc.
The fact you are using this argument shows how much powerful the culture about "the end justify the mean" and "trusts the authority to deal with this" is.
I remember the first time I saw Jack Bauer on TV decapitating a terrorist in 24 to get an information. I though, "wow, they are really creating a new normal here".
That's what it is about: creating a new normal. And pretending there is no other choice, while nobody is trying to provide any.
There's no pretending there is no other choice, this already is a proposal for that "other choice". Contact tracing certainly isn't new, it's a required step in tackling many infectious diseases and will happen whether or not it is assisted by digital means. The technical alternatives to the tiny part proposed here are coarse and many of them more invasive in terms of privacy. This proposal is specifically designed to prevent tracking populations, it also limits the number of necessary off switches to the two OS vendors. What exactly is the part of the "new normal" you are worried about here? I hope it's not people walking around with tracking beacons in their pocket, they already do that without giving it a single thought.
It’s not about “people assembling” at all. It’s about individual prolonged contacts, possibly accidental (mass transit), with an infected person, allowing much more targeted (as opposed to current blunt tools like shelter at home orders) suppression of the disease.
> Public safety is not a human right, while privacy is.
Seriously? “Everyone has the right to life, liberty and security of person” is literally Article 3 of The Universal Declaration of Human Rights - and 1&2 are “this applies to everyone; yes, we mean it”. Privacy is all the way down in Article 12.
I’ll take my life, health and freedom, for which targeted suppression of this disease is essential, over my privacy any time, thank you very much.
I'm part of the crowd that dislikes the trend to use electron for everything. I have 8gb of soldered Ram on my laptop, and will be forced to buy a new machine because I'm swapping like crazy now. My workflow hasn't changed. My activity hasn't. But 2 years ago, Firefox and Virtualbox were the only hogs, for reasons I could accept. Now, dynalist, stremio, discord, signal, pulsesms and vscode are added to the mix.
However, I understand that said apps may have not existed without Electron at all.
And especially, for jitsi, I think it makes perfect sense. If you are going to create an app that does video, audio and web rtc, it would be silly not to use a battle tested browser engine that does all this already.
Besides, having contemplated the state of UI in a world were you have a bazillions of combination of hardware type + screen format + OS kernel + OS version, I have to say Electron doesn't have much competition.
What are you going to do? QT? Phone support is abysmal and it's a pain to package. Kivy? Super slow, almost no widgets. Flutter ? Uses a niche language with a very small ecosystem and an unknown life expectancy.
I probably would go with the later, but I can't blame people for taking the easy road.
> If you are going to create an app that does video, audio and web rtc, it would be silly not to use a battle tested browser engine that does all this already.
I think you mean "create an app that does video, audio USING web rtc".
Plenty of native desktop/mobile apps do video/audio/text without embedding a browser.
> Plenty of native desktop/mobile apps do video/audio/text without embedding a browser.
Yes and it's a pain to do: format is limited, packaging is hard, ability to manipulate/embed the video is annoying. In fact, most apps doing that ship ffmpeg and/or vlc and call it a day. The browser gives so you much for free.
Most attacked, I could believe. Most compromised, I'm not so sure. Browser teams ship out new versions very regularly, it's nothing compared to vulnerabilities contained within the first release of Windows XP, for example.
Is it? ffmpeg as a library can decode about anything you want and put it in a buffer in less than 100 lines. Is that not for free? It's a self contained shared library.
Electron apps have the slowest interfaces on anything I've seen, lots of times each click of a button or menu has lag on a very solid computer. Who wants to have a program doing video embedded in a painfully slow interface?
What do you mean by lifecycle and fallbacks? Also you just said that building in multimedia was the problem and when I point out libraries are easy to use and modular you say that C++ is the problem.
I think you are giving too much credit to people using electron. It really seems to be mostly people who haven't really looked at their options avoiding native languages at the expense of the user. If all someone knows is javascript and they don't really care about their users' lag or resources, then electron is any easy choice.
When I buy a computer, the first thing I look for is extendable memory. If I can't easily plopp in at least double the RAM than it has, I'm not buying it. Got bitten already enough with the old 286+ era computers. Since then the memory consumption has been increasing the whole time until now you can't even start your editor without 1-2 GB disappearing. Want a browser too? That's another GB at least. A chat program? Another GB. The times where a chat client was 40 kb are long gone, now it has to have emotes and embeded movies at a minimum.
I had the freakish opposite experience where I went from an 8gb linux machine that was scraping the top of that to a 16gb machine at the same time I switched from openSUSE's standard release to their rolling release (Tumbleweed). My memory usage immediately dropped by 30-40% and the bits that didn't were all Electron-based. Even Waterfox with 4K tabs dropped significantly. I have no idea how they managed it, but it was a pleasant surprise at the same time it highlighted that if you use a lot of Electron apps there are no good options.
Imagine when Windows 10 is "updated" to essentially be a chromium browser with typescript used for all UI and builtin utilities. In such a case only special windows store apps are able to be installed... this is the future Microsoft and Google want for us.
I would imagine such a monstrostiy would be so slow with even 32gb that we would have to pay for extra cloud-based services to do menial tasks like edit documents.
I bought a mac with 32gb in 2013, figuring this would be good for a long while... these days with mem usage constantly hanging around 28-30gb, I'm now choosing between 64 and 128 for the next machine (with 128+ only being available in apple's 'pro' line...).
Without Electron many of programs/apps would not be available on Linux. I'm happy Electron exist and we have overall more Linux desktop compatibility in an easy way. Electron fulfilled what Java has envisioned, it's only bad there is not an universal ONE runtime below that all (although there are Electron bugs on github where this is worked on).
Any previous solution to do UI: QT, GTK, WX, etc were cross plateforms.
I don't think that's it.
Electron make it easy, if you know front end dev, to do an app. It's easy to package as well.
I don't know if you tried to design a beautiful QT app, but it's hard. A beautiful QT app with medias capabilities ? Extra hard. Packaging that? A royal pain.
> Now, dynalist, stremio, discord, signal, pulsesms and vscode are added to the mix.
So your workflow has changed. You added additional tools to it. These tools have always been electron. You don’t have to use them. There are alternatives.
The people behind these tools have decided that they target an audience you don’t belong to. You are of course free to ask them to change the audience, but you are not entitled to that
These are all just more recent variants of tools which we have always used, e.g. some chat apps, some editor, etc. In that way, not much has changed. It make sense though to move on to newer tools, which are basically the same tools though, just updated, maybe more modern features, not necessarily more features in total.
And maybe offering these modern features is so much easier using the electron platform that offering the features based in something else is not worth doing.
There must be a benefit for developers for them to chose electron. And that benefit for developers will have an effect for the users in either more features, quicker rollout or more supported platforms.
I have a suggestion for you that helped me. Try running Android OS like Prime OS (https://primeos.in) in virtual box and you can run those Android apps with low memory usage(I'm assuming that they offer the same experience in Mobile or that you are okay with limited functionality). I set this up for my wife as she kept complaining that her 8 Gb RAM was quickly consumed by Chrome, Slack, Spotify and other apps.
Now the virtual box memory limit is set at 3 GB and she has no complaints. Obviously this is not for power users but it helps a lot when there is a severe shortage in memory
I though about it, as a workaround. But realistically:
- my base ram consumption is 2Gb, so it would make 5gb with the VM, giving me 3gb for: firefox, and IDE, thunderbird, telegram, stremio, libreoffice, nautilus, veracrypt, liferea, gnome calendar, keypass, dev tools such as linter/dev servers/formatters, tilix, veracrypt, youtube-dl, jupyter, other VM I use for work... Even if I don't use them all at the same time, that's not a lot real estate. It used to be enough. When I used sublime instead of vscode, didn't have 4 communications apps and so on. You gotta hand it to the electron community: their software do bring good features.
- The ergonomics would be terrible for certain softwares. For chat, it would be alright (no notification is ok with me), but for stuff like dynalist, I need to be productive
- It's slow to use. You can feel the reaction time with every action. Android is slow in itself, but in an emulator, you want chain too many actions
Yes if people used it, but no because people would probably not.
One of the reason electron is so easy to package: it creates a big blog of statically linked everything. If you start having to play the packaging game correctly, you get back to the same problems other run time had.
Does it use a new instance for every app, or it loads the engine once and reuses some of it for every instance?
ie. can Electron be made to work like a system shared library, similar to GTK/Qt ?
The only improvement I see is to move away from electron. For alternatives everyone should take a look at Revery-ui written in Reasonml. Its starts in milliseconds, few megs of RAM usage, very low CPU usage and has most of the modern developer experience associated with Electron!!
MS probably knows. VSCode without any extension is pretty reactive and light. It becomes heavy when you have 20 tabs open with linters, languages servers, formatters and so on.
But your comparison is also not really fair, since you assume everything runs and is stored on your local computer. This is not the case anymore at all.
Plus, the web browser is probably the first application that is started by a user.
Following applications all run in my browser:
- email
- video conferencing with screen sharing
- (persistent) chatting
- Office applications (word processor, spreadsheet, ...)
- photo storage
- games
- development sandboxes
- ...
In fact most Apps I have on my phone could just be PWA's.
I'm not saying we should all go web, but I'm saying that most things where you want to use electron, you could let it run on the web.
In principle, there is no reason why Electron must be so memory inefficient, right? We could optimize it in a way that it only loads resources it really needs. So in case of a video chat app, it would need video, audio, web RTC, a bit of HTML and JS. That should be possible to fit in a few MB of RAM. Only because Electron supports much more doesn't mean it must take so much memory.
Maybe it would make sense that we just focus on optimizing Electron for this case. That might take a bit of effort, but that effort might be worth it.
Another route is to share the same resources between apps, i.e. make a progressive web app. I haven't used the Jitsi desktop app so I can't speak to it, but I'd be curious to know what features are missing from PWAs that mean a native wrapped Electron app is necessary.
But being more specific here: What exactly are the shared resources? The binaries? That could maybe save a couple of hundred MB but this is maybe still not the biggest part. The remaining memory is probably sitting there in memory allocations of JS or so, and I don't think that can be shared.
> The remaining memory is probably sitting there in memory allocations of JS or so
I'm not so sure about that. 5 Electron apps takes up far more memory than 5 tabs open in your browser because there are 5 copies of all the other browser resources. I don't know exactly what they are but anecdotal observation of using Slack and similar apps as browser tabs shows much less memory use. It makes sense: the browser rendering engine and JavaScript engine are going to occupy memory themselves.
Yes, as evidence for this web browsers sitting at an empty new tab page are generally still using at least 100-200mb to do nothing. The likelihood that most of that is not the part that's most vital and feature rich is low.
It's a excellent software for managing things to do, and I pay monthly for it. It is very efficient to use, works offline and on mobile seamlessly, use a JSON format for storage, and can export in a standard format to avoid locking (even on the free plan).
I use it to manage things to do, listing, etc., but I would not use it for taking notes, IMO. The format doesn't look great for it.
Anyway, the free plan is good enough to try it on, and the customer support excellent.
I quickly played with the demo. I'm more a note-taking kind of guy than a todoist. I love the UI but yeah, since everything is a list it's not for me. For my use, Google Tasks is enough for me.
I've tried Evernote, Boostnote, Simplenotes, Notion, even a bunch of markdown files inside a Github repo and so far nothing was 100% perfect for me. :)
- I can use whatever file format I want, mix in images, odt, pdf, md, etc
- I can backup and sync
VSCode is a pretty good editor to manage it all, and I played with the idea of creating an app with the new editor view feature of the last version just for that. Support some metadata, create an automatic encrypted sync server and that's it.
Most of the RAM usage when it comes to Telegram (and other IMs I guess) is media autodownload. Once you turn it off - the problem is solved (same for the battery life on mobile)
It wasn't anything like the original Slack app last I used it a few months back. Has this changed? It doesn't have a keyboard shortcut to jump between unread channels as a basic example. Or hiding read channels, so I've got a huuuge list.
Yup. Telegram Desktop[1] and the web client[2] are separate projects.
The desktop client is still quite heavy on resources on Linux, and needs a restart every now and then.
I have exactly one electron app (VSCode) that I need for my regular daily work. Everything else I shut down when I don't need it. Then I look at my coworkers who have dozens of apps running at the same time and complaining that their laptop is slow, and I only shake my head…
"Luckily, most of them are using the same version of lodash, which just needs one lodash to install inside node_modules. This is often not the case with real-world production projects. Sometimes, different packages require different versions of other packages."
Npm lets you install several versions of the same package. This has the advantage of saving the dev the testing of their lib with a wide range of dependencies versions: it almost always works. Unfortunately, that means most devs just choose one version and call it a day. They build libs like one would build a project: as you were alone in the world.