ai newsDo., 15. Okt.
EilmeldungMeta and Apple team up to make Muse AI models run better on Macs

When you just need to build a tiny desktop app: TinyJS

DevClassDienstag 10:12 · 13.10.3 Min. Lesezeit
Bild: DevClass

As the world’s billionaires anxiously plot datacenters to run trillions of lines of AI-generated slop code, one software engineer has zagged in a completely different direction: building an ecosystem for writing and running small apps that run on desktop computers, like it was 1992 all over again.

The trick to TinyJS’s frugality is that it uses the WebView window of each OS, utilizing the built-in browser engine to visually render the app, rather than implementing a UI layer from scratch. It uses WebKit to run apps in this fashion on macOS, WebView2 for Windows, and WebKitGTK for Linux.

TinyJS’s approach is starkly different from using the Electron framework, which bundles a Chromium open source browser core with each desktop app. But whereas Electron promises an identical look-and-feel of an app across all platforms, TinyJS apps will have slight visual variances when run on the different platforms, owing to minor differences in how each OS’s rendering engine works.

The Electron app pays for this cross-platform uniformity: with Electron, even the most basic application can weigh 150MB.

Stroh-Spijer also simplified the development process by using the OS’ interprocess communication mechanisms for handling data transfer, eliminating the need to bundle an HTTP server for each app, along with all the security headaches that entails.

The Tauri project has a similar aim of creating the tiny apps, and can deliver a desktop app in 10MB, but that framework has some drawbacks, Stroh-Spijer noted on the TinyJS website. The main one is that you have to write applications in Rust – which requires learning Rust, among other drawbacks.

Also, TinyJS hands over a lot of the app’s substrate to the OS – such as dialogs, menus, tray, clipboard, auto-updates – that with Tauri would have to be imported one plugin at a time.

You can also use TinyJS to wrap a Webpage, by pointing the window to a URL. Imagine having your favourite site as an app on your desktop.

With TinyJS, Stroh-Spijer created an “app store” that can be run, natch, from the desktop (the zipped Windows version can be downloaded here ). As of press time, it indexes 25 sample apps he wrote.

The example apps, all free, vary in utility and whimsy. The shelf includes a world clock (which ships as a 3.8MB zip file), a clipboard history app (3.7MB), a markdown editor (4.9MB), a desktop ghost (3.8MB), a SQLite browser (4.1MB) and, most impressively, a clone of the iconic Winamp music player, which demands only 7.4MB from your hard drive.

Once you convince Windows Defender to trust the launcher, you can download and open the app of your choice directly from the shelf.

In my tests, the copy-and-paste app, clearly written for Mac hotkeys, was still too buggy for Windows, though the world clock ran just fine and consumed only 15.5MB of RAM on my box. (Caveat emptor: the launcher checks the hash to ensure the validity of downloaded apps, though you’re trusting that Stroh-Spijer harbors no evil intent here).

Or, just skip the examples and build your own test apps.

Today’s personal computers are powerful, but there are still many good reasons for building apps that would be petite even by last century's standards. Commercial applications (those still around anyway) and Web browsers are voracious RAM consumers, so adding more tools to the desktop with little overhead is a positive. Plus, unlike the bloaty apps, minuscule apps start fast, and, in theory, draw less power on laptops.

And just like the TikTok meme of the woman who insists on bringing her dog on the plane because it’s just “a tiny dog,” users may want to add these apps to their desktops, because, well, they’re tiny. ®

Quelle: DevClass (DevClass). Original öffnen