5 ms·
I don't understand why there are so many negative comments. Writing GUI in C looks like a stone age programming, and people are simply wasting their time to do
by codedokode 3y ago
I don't understand why there are so many negative comments. Writing GUI in C looks like a stone age programming, and people are simply wasting their time to do routine work that can be diminished by using another language. One might use Python, but it is slow and memory-hungry.
Isn't it good that now there is an alternative to C?
- diggan 3y ago> Isn't it good that now there is an alternative to C? It's not exactly the first alternative, GJS (Gnome JavaScript) have existed for a long time and is also a C-like language, so doesn't seem this would give too much value compared to just using GJS, unless you know Swift a lot better than JavaScript but the languages are similar enough that even that doesn't provide much value. AFAIK, GJS is an official Gnome project too, so there will be a vast difference in ecosystem support compared to Gnome apps written in Swift, which I'm not sure is so popular outside of Apple circles.
- codedokode 3y agoJavaScript is non static-typed and you'll spend time fixing bugs that can be prevented by static typing. Also, GJS is not well documented, as far as I remember.
- diggan 3y ago> JavaScript is non static-typed and you'll spend time fixing bugs that can be prevented by static typing. Use TypeScript if types are so important for you. Others find their own way of handling those issues without getting tripped up on it. Hardly a reason to completely switch between two languages in my mind, but of course it's alright if it's reason enough for you. Luckily there are acceptable workarounds for both groups of people :) > Also, GJS is not well documented, as far as I remember. What exactly is missing here? There are guides for the basics, API reference exists and there is a ton of apps you can look into for inspiration and/or figure out specific implementations. Is that really worse than what exists for writing Gnome apps with Swift? Seems like a really weak argument for using Swift instead of GJS.
- codedokode 3y agoSwift is compiled, static-typed language and without tons of legacy like JS (for example, it has real objects, not dictionaries). Doesn't require an interpreter. It seems to be better than JS in every aspect.
- diggan 3y agoOne mans gold is another mans trash :) Static typing seems to be a neat addition for lots of people, that's great! Doesn't mean it's a silver bullet that improves development for everyone, and that's OK. I still don't see how a language (GJS) with an already existing ecosystem of writing Gnome apps, lots of examples, API references and more is worse for writing Gnome apps than Swift, that seems to have been launched just some days ago? Edit: I realize now that the "Adwaita for Swift" this blogpost is about isn't even an official Swift project, is the output of a student interested in Swift and Gnome.
- Betelgeuse90 3y agoHonestly I used to think the same way about JS, because not having types allowed for very concise code sometimes. But the more I used Swift I realized how powerful type inference can be, and the difference in conciseness shrunk to basically nothing.
- diggan 3y agoHeh, yeah, everyone's journey is different :) I started out being a big fan of static typing but eventually found that I'm usually hit by different issues than "this was a int but I expected a string" that were more important to be solved, so I'm mostly using dynamic languages nowadays. But that's what so great with programming languages, there are so many that work so differently, so there is at least one language for everyone, no matter how different your brain works :) By the way, if you're a fan of "conciseness" you should give a lisp-type languages a try if you haven't before, will show you a completely different level of conciseness! Clojure is a great introduction to lisps. And if you still need validation of data somehow, clojure.spec et al works great and will introduce you to some cool new things you probably haven't come across before :)
- Chiba-City 3y ago[dead]
- mahkoh 3y ago>Isn't it good that now there is an alternative to C? Rust has had endorsed language bindings for GTK for a long time: https://www.gtk.org/docs/language-bindings/rust https://www.gtk.org/docs/language-bindings/rust Some official Gnome applications are written in Rust. Swift only supports a small number of linux systems (Ubuntu, CentOS, Amazon Linux) which makes unsuitable for general linux application development.
- machinekob 3y agoSwift run on almost every linux desktop (Arch, Debian, Ubuntu etc. have even their own packages) I hate when people are writing false information with such a confidence.
- mahkoh 3y agoSee https://www.swift.org/platform-support/ https://www.swift.org/platform-support/ for a list of supported distributions. You seem to have hallucinated that I said that swift cannot be made to run on other systems. You can even make windows-only games run on linux so that is not a surprise. What distinguishes swift from gcc, clang, python, bash, go, rust, and so on is that languages other that swift aim to support linux in general.
- machinekob 3y agoSwift only supports a small number of linux systems. which is at most half-truth cause this is just official installers and most likely you'll use some sort of rustup (rust wasn't working on every system few years ago if you use official installer not some sort of rustenv installer or building from source etc.) you can use https://github.com/kylef/swiftenv https://github.com/kylef/swiftenv you can use community packages https://wiki.archlinux.org/title/Swift https://wiki.archlinux.org/title/Swift etc. "and so on is that languages other that swift aim to support linux in general." -> again not true linux distro dosen't change swift usage it is just official build is run for few most popular distros and you can use prebuild swift-bin on any linux repo. (arch, debina, ubuntu, centos etc. etc.) You can say the same stuff about rust/nim/go every other language that didn't have official release for some niche linux distro.
- amon22 3y agoI used common lisp in the past to interface with GTK via the cl-cffi-gtk library. Performance was good I think (I did not benchmark but the UI was responsive and did not consume much resources) and dev experience was great because of the REPL. But it did take quite a bit of suffering to get the resulting artifact working on Windows which was a definite requirement sadly. It can be done though.
- poulpy123 3y agoto be fair and looking at how closed is the apple ecosystem, I would not put my open source eggs in swift
- tiny_ouch 3y agoMy feelings exactly! It's frustrating the lack of viable alternatives though. Just typing on my japanese flip phone is a pain and i think the T9 could be improved. That said i don't think adopting apple tech would help much as far as fixing any deficiencies in ui imho.
- t888 3y agoHow does the App Store affect Swift?
- sgjohnson 3y agoSwift is open source.
- steve1977 3y ago> Isn't it good that now there is an alternative to C? There’s this new kid in town, IIRC it’s called C++
- kevincox 3y agoYeah, I'll happily take GUIs written in a fairly fast and memory efficient language that are using a full GUI toolkit. It beats Electron, Python, Java or Go programs any day.
- deleted 3y ago[deleted]
- pjmlp 3y agoGtkmm exists since GNOME 1.0 days. As do bindings for Python, C#, Lisp, Scheme, Vala, JavaScript (since GNOME 3)...