News for hackers. Stuff that matters.
Re:Why Remotion is a native macOS app, not Electron by criddell on Friday April 08, 2022 @10:47AM (#30957557)
It seems like macOS is the only desktop operating system that has anything interesting happening on it (I say that as a person who primarily uses Windows and Ubuntu on the desktop). Not a lot, mind you, but there appears to be at least some interesting new things popping up for macOS.

For Windows, I'm not counting games because that feels like its own thing.

Re:Why Remotion is a native macOS app, not Electron by city41 on Friday April 08, 2022 @11:06AM (#30957978)
Recently Flathub was posted here on HN. It looks like a decent attempt to inject some life into desktop Linux.

https://flathub.org

Re:Why Remotion is a native macOS app, not Electron by criddell on Friday April 08, 2022 @11:22AM (#30958305)
I don't think yet another way to install things is going to suddenly trigger a wave of new, native desktop Linux development.
Re:Why Remotion is a native macOS app, not Electron by rubyist5eva on Friday April 08, 2022 @12:23PM (#30959116)
Flatpak itself is kinda jank though, thing like: asking for root multiple times during installation, spewing out a bunch of CLI output I don't care about, not having ways to configure app permissions without using Flatseal.

I'll probably catch a lot of hate for this, but Snap is a much smoother experience and is well integrated with Ubuntu, even if the snap store kinda sucks...gnome software is worse.

Re:Why Remotion is a native macOS app, not Electron by smoldesu on Friday April 08, 2022 @05:55PM (#30962984)
Snap truly is awful. That's why I'm completely dumbfounded that the Flatpak developers found a way to make package management somehow more of a hassle...
Re:Why Remotion is a native macOS app, not Electron by smoldesu on Friday April 08, 2022 @11:18AM (#30958233)
Flathub is it's own can of worms, as is Flatpak. There's a number of "next-gen" Linux users who love to demonize people who are critical of new tech like Wayland, GNOME and the like, but I'm the most critical towards Flatpak. Linux doesn't need more hack-y ways to get bad software running: we need more robust ways to get software running well. Flatpak is a shotgun approach to getting an app working, where someone said "your app doesn't run? let's just containerize it!"

Needless to say, this is not a great idea in concept, practice, or it's current execution.

I think a much better idea would have been to copy what NixOS does. Yes, your developers have to do a little more work, but you can finally have reliable builds, fix your dependency graph, and actually run your software natively. I'd love for a more uniform "AppImage" style of installation, but Flatpak is definitely not it. Too many sharp edges.

Re:Why Remotion is a native macOS app, not Electron by codedokode on Friday April 08, 2022 @12:39PM (#30959344)
NixOS might solve dependency issues but it doesn't provide isolation. Currently in a one-user system every app has access to all of user's data and hardware serial numbers. And Linux was not built with a principle of minimum privileges in mind, so for example a PDF viewer can read browser cookies or stored passwords.
Re:Why Remotion is a native macOS app, not Electron by smoldesu on Friday April 08, 2022 @02:11PM (#30960571)
This is a problem that also exists in many Flatpaks: plenty of applications get carte-blanche access to the OS filesystem, and "breaking out" with symlinks or chained attacks has proven trivial over the years. There are so many of these exploits that they simply stopped patching them after a certain point. Isolation is much better provided by other tools like Firejail.
Re:Why Remotion is a native macOS app, not Electron by zozbot234 on Friday April 08, 2022 @12:09PM (#30958976)
Containers are a native technology in Linux. The issue with Flatpak is that it comes with its own bundles for underlying desktop components that add some duplication and overhead (in memory use and disk space) compared to what's provided out of the box, but that's a requirement if you want genuinely portable applications.
Re:Why Remotion is a native macOS app, not Electron by criddell on Friday April 08, 2022 @12:18PM (#30959069)
Which points to the root problem - unlike macOS and Windows, Linux has no native GUI. Ultimately, I don't think the options that you get with Linux help it.
Re:Why Remotion is a native macOS app, not Electron by deno on Friday April 08, 2022 @02:25PM (#30960736)
Linux is a kernel—like NT or Darwin. Better comparison is with KDE and GNOME and they both have native UI toolkits as well as look&feel and design guidelines. Only major Linux-based system without native UI is Chrome OS, but that’s rather intentional.
Re:Why Remotion is a native macOS app, not Electron by ryanmcbride on Friday April 08, 2022 @11:15AM (#30958174)
The last interesting thing I noticed for windows was powertoys
Re:Why Remotion is a native macOS app, not Electron by ninkendo on Friday April 08, 2022 @05:07PM (#30962538)
Agreed… macOS seems to have avoided the massive fragmentation problems plaguing Linux and Windows.

It’s not perfect… the iOS ecosystem is just different enough that common frameworks don’t always go up to the UI layer (UIKit and AppKit are different, although most of their dependencies are the available on both platforms), and that sometimes manifests itself in slightly odd behaving apps in macOS (Messages, News, Stocks, etc are just UIKit apps recompiled for the mac), but it still feels like the different stacks share enough similarities, that from a developer’s perspective it doesn’t feel too jarring.

I think this can be attributed to the fact that Objective-C was such a perfect design choice for its time. While Microsoft was busy being ashamed of COM and spent a lost decade chasing .NET as the New One Way to create windows apps, only to double back and shore up COM again through the WinRT stack, Apple (post-NextStep) had that problem fully solved with Objective-C. While MS’s environment needed a separate IDL and object model to allow ABI-resilient dll’s (C++ is not ABI stable, it needs COM to do that), Objective-C solves this problem naturally through its fundamentally dynamic nature.

Examples:

- In C++, you can’t just construct an object that’s defined in another .dll. You may know its size now, but you can’t be sure that its size won’t change in the future, and you may not be in a position to recompile your code (say, when a new windows version comes out and your customer tries to install your program.) So to allocate an object, you have to ask COM to do it, which means following the relevant conventions and using COM API methods to ask the remote class to create an instance of itself (CoCreateInstance, etc), and refcounting the resulting pointer with AddRef/Release. This isn’t a bad design choice, but it’s just different from how C++ programmers are used to constructing objects.

Contrast this with ObjC, where `[[SomeClass alloc] init]` is always the way you construct objects, and there’s no jarring change between “how you allocate objects defined in another framework” and “how you always allocate objects”. And refcounts are automatically managed by ARC, which is part of the ObjC compiler.

- COM works by having objects query each other’s interfaces and exchange vtables around so that the function offsets are known, which requires special calling conventions that are different from how normal C++ code works… You’d need to call QueryInterface on a COM object to get a pointer with the right vtable, so that you can call the right methods on it, etc. Various high-level wrappers (MFC, ATL, etc) abstract this from you, but they’re imperfect, and the right wrapper depends on the use case. Not to mention, you only get access to the COM APIs which are actually exposed via these wrappers, so they won’t help you with “general purpose” COM code. I have been out of that game for a while but I’m assuming WinRT has made a lot of this simpler.

Contrast this with ObjC, which simply always uses dynamic dispatch with objc_msgSend to actually invoke methods on objects. It’s “ugly” (`[[[lots of] brackets] etc];`), and “slow” (because the method dispatch is essentially passing a string around and dynamically discovering which code will handle it) but it’s at least uniform.

COM was unwieldy to non-microsoft engineers, but Microsoft mostly “solved” this by creating friendlier programming interfaces on top of it. They didn’t really want engineers being confronted with COM’s complexity, and so technologies like MFC, ATL, (OG) Visual Basic, and then later .NET were touted as solutions that had a better developer UX. But that’s just the problem… there are too many solutions to this problem in Windows, and nobody could agree on the “right” way to write windows apps, so everyone either did some flavor of either raw win32 programming (if you’re up for doing a lot of work yourself), or some rotating framework du jour which would hide the complexity for you.

But on Apple’s platforms there was no such awkwardness, and Apple just kept innovating. ObjC’s internals were not some implementation detail to be hidden but the fundamental way you do all object-oriented programming on the system, so there’s no reason to have different conflicting wrappers on top of it. Developing for AppKit was just plain old ObjC, and you get ABI resilience for free because of its dynamic nature.

Anyway this was a long rant but I really do feel like the lowest level technologies are to blame/praise for the situation with OS software in general, and COM was such a sore spot for microsoft that their attempts to paper over it just made the platform worse and fragmented things, leaving developers to fend for themselves with how to develop applications.

Addendum:

I’m actually sorta worried about Swift as the replacement for ObjC, because it’s not as “fundamentally dynamic” as ObjC is. Apple is aware of this, and has gone to great lengths to enable library evolution/resiliency in Swift frameworks, but they’re coming at it from a totally different place from how ObjC solved it. In ObjC, it’s just `objc_msgSend` all the way down. In swift you have value witness tables, protocol witness tables, reabstraction thunks, and all this massively complex infrastructure to make it feel like objects in another Framework are the same as the objects you define locally, and it all sorta works, but… it’s just not nearly as elegant. It’s technically faster though (since method dispatch through these witness tables is likely faster than objc_msgSend), so at least it was done for a reason. But I’ll always have a special place in my heart for ObjC due to just how perfectly it fits into the problem space.

Re:Why Remotion is a native macOS app, not Electron by musicale on Friday April 08, 2022 @08:51PM (#30964245)
Beautiful ObjC apologia. I think ObjC is brilliant, particularly once ARC simplified memory management.

I enjoy Swift but it feels like building on quicksand.

Re:Why Remotion is a native macOS app, not Electron by oscarmv on Saturday April 09, 2022 @06:39PM (#30972849)
I'm neutral about Swift vs. Obj-C, I can see the advantages in Swift (especially now that the language is starting to tackle concurrency and getting closer to solving its existential issues) but I miss just having a simple set of tools that would still let me do everything I needed without thinking too much about them. Too much time spent being precious when writing Swift code...

I'm more worried about Apple's mac approach becoming Windows circa 2005, currently you can develop a mac app using AppKit, which is slowly rotting away, or using either Catalyst of SwiftUI, both of which are playing catchup with iOS and not really getting there. Too many options, none that are truly polished up anymore.