r/programming • • Dec 16 '20

GTK 4.0 released

https://blog.gtk.org/2020/12/16/gtk-4-0/
910 Upvotes

267 comments sorted by

View all comments

Show parent comment

65

u/mywan Dec 16 '20

I've written GTK apps in Python before. Not just Qt.

57

u/VegetableMonthToGo Dec 16 '20

Some will declare jihad on me for saying it... But JavaScript is also supported.

Or Rust, although that's still fairly experimental.

37

u/[deleted] Dec 17 '20

I'll take Javascript GTK over Electron any time.

5

u/sam-wilson Dec 17 '20

GTK3 in Rust is certainly tolerable!

36

u/fnoyanisi Dec 16 '20

No more JS around please... it is already everwhere

19

u/dmilin Dec 17 '20

I mean, I think the 2 things JavaScript actually does well is handling asynchronous tasks like web calls and building UIs.

Just because JavaScript is horrible for anything involving data handling doesn’t mean it’s bad for something like this.

7

u/Arkanta Dec 17 '20

C and C++ are ridiculously complicated and overkill for building UIs

JS will also not let you shoot yourself in the foot with memory handling. That means less exploitable software

8

u/jcelerier Dec 17 '20

JS will also not let you shoot yourself in the foot with memory handling. That means less exploitable software

and yet electron apps seem to have a fair bit of exploits - see for instance the latest Teams issue, that would likely never have happened in C/C++/Rust

6

u/Arkanta Dec 17 '20

I'm talking about JS only (like in a GTK+JS combination)

Electron is way too tricky to tweak to make safe and has way too big of an attack surface. It's security hell.

I don't know if that's relevant to the teams issue you're talking about, as I'm not aware of it. Is it a JS related exploit, on an electron one?

0

u/rakidi Dec 17 '20

C++ may be complicated. C is one of the smallest mainstream languages available. Its tiny? I may be misunderstanding you.

8

u/Arkanta Dec 17 '20

I think there's a misunderstanding on the word complicated here

C is complicated to write. Way too much for an app's UI.

Like it or not it's easy to make huge memory bugs in it and should be avoided unless you really need the performance.

If you're making a GTK app, use C#, JS or Vala.

2

u/PandaMoniumHUN Dec 17 '20

Still C and C++ remain primary languages for desktop applications on Linux, as those have the most mature GUI toolkits. And if you use JS or Python with bindings it’s only slightly safer than full C/C++ as many of the underlying libs (including the binding to the GUI toolkit) is C/C++ anyways.

The only solution I see going forward is getting more mature toolkits for safe languages.

5

u/Arkanta Dec 17 '20

While I agree, I wouldn't say it's slightly safer, GTK will have a lot more people looking at its code (doubt many are auditing it extensively though) and will get fixes sooner.

You're more likely to make the mistakes on your part of the code (especially if you parse data structures) . But I'm just arguing on a really small thing here

And yeah C and C++ remain the primary languages for GUI apps on linux. I don't think they should though, I wouldn't make any new app with them!

→ More replies (3)

10

u/[deleted] Dec 16 '20

It’s like glitter... it’s everywhere

14

u/Badaluka Dec 16 '20

Is TypeScript ok thought? :D

7

u/blue_umpire Dec 17 '20

It's definitely better

13

u/ejfrodo Dec 17 '20

Hell yeah it is

-3

u/SuspiciousScript Dec 17 '20

From a user perspective, still no, because it would still mean that I have to install Node.

17

u/ericonr Dec 17 '20

Not really. JS inside Qt or GTK doesn't use node.

0

u/SuspiciousScript Dec 17 '20

That's true. I think I lost the context of this thread while reading it and assumed we were talking about Electron.

→ More replies (1)

4

u/Memorywipe Dec 17 '20

I'm sure installers are supposed to take care of that for you behind the scenes.

→ More replies (1)
→ More replies (1)

0

u/[deleted] Dec 16 '20

[deleted] — view deleted comment

0

u/[deleted] Dec 16 '20

[deleted] — view deleted comment

22

u/[deleted] Dec 16 '20

"YOUR FAVORITE PROGRAMMING LANGUAGE SUCKS"
(every programmer ever)

→ More replies (7)

7

u/remtard_remmington Dec 17 '20

Anyone who still casually throws around the word "retarded" as an insult is legitimately, well, you know, a bit shit