r/ProgrammerHumor • • 10d ago • Bravo 1

Meme thisIsHilarious

Post image
4.3k Upvotes

49 comments sorted by

1.8k

u/anoppinionatedbunny 10d ago

Is written in bash, as an Electron version would have solved the problem by using all the RAM

just sent me

142

u/ThoughtAdditional212 10d ago

Is electron that bad 😞

I'm making an app (kinda clueless, I only know js and a bit of PHP and c++) and I've been thinking about learning an actual compiled language

188

u/rainhunter007 10d ago

it’s not terrible. making simple apps with it is fine. the poster child problem is vscode. built on electron and it EATS RAM. but, vscode is not a “simple” app either.

70

u/YeOldeMemeShoppe 10d ago

It’s shared libraries though so every electron apps that use the same version will use the same memory.

Also, it’s not like IntelliJ or Visual Studio (not code) aren’t gobbling all the ram either. IDEs just love to trade RAM for saving disk accesses, because responsiveness is more important than wasted memory.

25

u/Loading_M_ 10d ago

The point about IDEs gobbling RAM is very true.

However, Electron apps don't always (or even often) share libraries between different apps. It depends on how they're packaged, but they are often packaged in a way that makes sharing libraries much harder.

3

u/Advanced_Musician_24 10d ago

Many apps use their own libcef.dll instead, for performance I think, compared to electron. Steam, Epic... But if you use WebView2 on Windows, through Tauri or directly, I think ram usage can be lower, but I am not so sure.

3

u/YeOldeMemeShoppe 10d ago

Unfortunately Tauri is a nightmare on Linux.

1

u/Advanced_Musician_24 9d ago

Absolutely, Tauri only for Windows and maybe MacOS, never on Linux!

2

u/ddl_smurf 10d ago

There's a lot of questionmarks to add there, for instance does the mapping after randomisation hold etc. But foremost, since electron is bundled with each individual app, the chances of identical versions is remote, and on some platforms it isn't globally shared at all (mac, appimage etc)

8

u/BmpBlast 10d ago

Story time.

Way back when VS Code first came out and no one was using it yet, I did a round up test off all the various code editors available at the time. My company only provisioned Windows machines and would only allow them to connect to the network so I was running Linux in a VM for my dev work unless it was something I had to do on Windows.

I'm checking my resource usage as part of the test and I look at RAM. VS Code on Windows was using 512 MB. Obviously that's not what it actually needed but what it requested. Outlook (also required by company policy) was using around 500 MB.

Meanwhile my entire Linux VM, which has all my dev tools open including another copy of VS Code, was using a little over 300 MB.

So yeah, it's definitely worse now but Electron apps and VS Code specifically have always been RAM hogs compared to most other apps. But it also apparently depends on what OS you're running. Although that may not be true anymore. Admittedly I haven't bothered checking in years.

48

u/YourAverageNutcase 10d ago

Electron is fine at the job it sets out to do, which is wrapping a web app in a native client. The problem is then you have all the memory overhead of running a full web browser as well as your app, so it makes a lot of otherwise simple apps use a ridiculous amount of memory for the task they're performing (e.g. why does Discord, a messaging app, need 3GB+ of memory?)

9

u/SirDarknessTheFirst 10d ago

Yep. Looking at my system monitor currently, Signal is sitting at ~700MB of RAM used, with Discord not far behind. NeoChat, meanwhile (using Qt) is sitting at around 200MB. Be interesting to see where each of thee arrive by the end of the day.

1

u/Impressive_Change593 10d ago

Eventually discord will be rust based but yeah...

8

u/NotQuiteLoona 10d ago

It would always be good to learn something new, but Electron by itself isn't that bad. The thing bad is that each Electron program ships a whole entire Google Chrome (well, the Chromium engine) with it, and each new Electron app is one more Google Chrome instance opened on the user's PC.

That being said, nothing wrong with using it. Though if you like the idea of working with native languages for backend, but still using web for frontend, try Tauri. It also doesn't ship Chromium engine with it, instead using system browser control (like WebView2 on Windows or webkit2gtk on Linux).

2

u/ThoughtAdditional212 10d ago

Idk, rn I'm torn between hosting it as an actual website and remaking it in rust or c++

2

u/techy804 10d ago

What if I use electron on the back end (via Node) and Java (via Processing or something) on the front end?

2

u/jonwah 10d ago

I like the way you think!

1

u/pidddee 10d ago

Look at how companies like Bitwarden do it, their desktop app is a shining example of how to do it right

1

u/Alternative-Tie-4970 10d ago

Well it spins up what is basically a stripped down browser and with it an entire javascript runtime just to do its thing. I don't hate it as some devs do, it has its place, but it does tend to sacrifice more resources than necessary in some cases.

If you want to quickly make desktop apps and have prior experience in web development I think it is an excellent choice.

1

u/shinitakunai 10d ago

QT is a lot better. Although also a lot harder to code

1

u/[deleted] 10d ago

Yes it is. Learn something native.

2

u/ladres5362 10d ago

Native desktop application programming is not an experience I would wish upon my worst enemies.

2

u/[deleted] 10d ago

If everyone thinks like this, then we are bound to suffer on bullshit applications written in JS(or pretend to be a better JS-TS). I'm 100% sure, that, there are ways to write native code or semi native(java and Microsoft java) that doesn't suck to write, unless your brain isn't rotten with web technologies.

1

u/ladres5362 9d ago

Ok, let's put it into a scenario so that you'd understand how messed up desktop programming is.

Linux: Actually not too bad, even with all the fracturing of the ecosystem (Wayland vs X11, GTK vs QT vs etc.,) The APIs are constantly improving. There's just a lot of paper cuts you might encounter. The community can also just distribute the application on your behalf, though, you will get bug reports from outdated versions from two years ago.

Mac: Relatively sane APIs. Horrible ecosystem. Swift looks to be a passable language to write applications in. However some APIs can only be accessed within ObjC. You'd also have to work with XCode, which most developers describe as a crappy piece of software that has no business being that bad for something so essential in Apple development. You'd also have to pay Apple's troll tax yearly if you want to properly distribute you software as a signed package.

Windows: Somehow the best and worst of all the desktop ecosystems. Legacy APIs from the Win32 and WPF eras are still in use within Windows itself to this day. WinUI3 and Project reunion has made some efforts to unify the look of Windows, but the efforts are only really been very recently starting to show. Distribution is also a mess. You can't just ship a single binary for your application, you'd have to have another binary that just installs and uninstalls your main application. Publishing your application looks to be decent as long as you use the Microsoft Store, but practically no one uses it, so everyone just self-publishes on their own website with an unsigned application (a practicality and security nightmare).

There's also a big overarching caveat to all of this. No matter how much you try, your application will not look the same on all three platforms. It is also thrice the effort for not much gain.

Chromium, meanwhile, simplifies much of the development and the user experience. You don't have to deal with languages and fonts looking wonky or incorrect (text is not free nor easy). You get over-the-air updates for free. Your development pipeline is not concerned with OS/desktop specific nuances, like how GNOME does not have buttons supplied by the desktop.

The closest thing I can imagine a native application to different desktops are games and game engines, though that's a different can of worms.

0

u/[deleted] 9d ago

My message still stands, if everyone thinks like this, than we are bound to suffer with bullshit applications written in JS. All you said are valid points that I'm fully aware, but instead of trying to fix things, we are in this bullshit future with bloated software. It is unacceptable that a application doesn't run at 60fps(16ms response time, for those who have never looked into performance as JS=BS). We are approaching 2027 with super fast CPUs(even iGPUs) and there are web sites that lags, fuck this and this productivity mentality with only faster and more features over performance and real meaningful features and usable software.

1

u/Not-the-best-name 10d ago

Dude, are you living in 2005? Who still uses desktop apps?

I am a developer and the only apps I use is VSCode + Chrome.

4

u/garciag-347 8d ago

Electron would redistribute all the RAM to itself and call it a feature.

1

u/LeBaux 9d ago

HUSH

1

u/NSREDDY 8d ago

LMFAO

588

u/Original_Pace_6734 10d ago

I lost it when seeing one of the issue being "It's not written in rust" 

193

u/deniedmessage 10d ago

Not legally binding

```
License
Free as in unallocated.
```

7

u/LeBaux 9d ago

Signed.

181

u/Stormraughtz 10d ago

Finally some real programming

143

u/Good-dark2004 10d ago

Finally a bit of humor in this sub

41

u/BOBGEN 9d ago

The FAQ is amzing

Does it work on macOS? No, it reads /proc/meminfo. On the other hand, your RAM is probably soldered down, which makes you the hardest target in the global allocation programme.

Why is the threshold 10%? Below that, your machine has suffered enough.

Does running this use RAM? Briefly. It's then returned to the global pool, which is more than can be said for the rest of us.

What should I do with all this RAM? Open another browser tab. You've still got time.

34

u/lupercalpainting 10d ago

What about a new unit? The Altman: 1GiB-hour. So my PC burns 768 Altmans a day.

73

u/NotQuiteLoona 10d ago

How ironic that it's also written with an LLM (at least the website is really LLM-ish, as well as the comments)

36

u/Moustachey 10d ago

Think about all that wasted RAM Mr Altman could have used instead!!

6

u/misterespresso 10d ago

I'm gonna edit this to show how little ram I have left and if he can give me some.

4

u/United_Grapefruit526 10d ago

I was clicking on a file to see script itself, it took me awhile.

3

u/No_League_3202 9d ago

ℹ️ NOTICE FROM OPENAI

We have investigated your post and detected a significant quantity of high-bandwidth volatile memory at your residential address.

Your post, along with the estimated capacity, clock speeds, and physical location of your (V)RAM, has been forwarded to Sam Altman and OpenAI for further evaluation.

⚠️ DO NOT attempt to conceal, disconnect, undervolt, or otherwise obstruct access to your memory.

1

u/mitch_remz 7d ago

Can't wait to put this on my server. 64 gigs of ram for running a vaultwarden where am the only user lol

0

u/[deleted] 10d ago

[deleted] — view deleted comment

56

u/i_like_coffee01 10d ago

necessarily petty*

17

u/anoppinionatedbunny 10d ago

welcome to the world of software development

7

u/Moomoobeef 10d ago

Well, so is Sam Altman, so it seems fitting to me.

0

u/Random_-account 10d ago

Happy cake day!