The business logic could run as a daemon in the background or a shared library and can be implemented in whatever language you're most proficient in for writing system services and that matches the performance requirements of the task, and the GUI can be written in whatever language you're most proficient with for GUIs (so you can start with Electron and switch down the line if needed).
I would've said Electron is a bad idea for this (for the reasons you mention in the post), but if the "business logic" is decoupled from it then Electron's task is to merely display information at which point it becomes more viable.
Some customers had problems because they had malware browser toolbars installed that rewrote/altered the HTML.
But it’s pretty annoying that even things like a file path picker would need to be custom made and done via the daemon.
The only major technical hurdle I can think of would be a way to locate and classify remote assets and resources, so one knows what belongs to what. We'd need to come up with an address system, something like a "universal resource locator" that could assign an app to a "domain" (think Java namespaces) that maps to one or more IP addresses. Instead of installing the app, you could just type the "domain" into the browser and access the application.
It could be a revolution in the way Electron apps are distributed. Someone write this down!
If only there existed a GUI library which did that for us ...
Admittedly, I don't currently know of any books that have been revised to cover version 2, but there is momentum on the desktop. For example, it will be the default framework on Ubuntu moving forward [1].
However they had some issues with Qt, and have been transitioning to Flutter.
Their technical blog discusses their issues and experiences. https://openprivacy.ca/discreet-log
I don't hear about this often, but I've heard that native apps are still common in China. I bet they don't have this problem.
I bring this up because I notice a lot of the time on HN this gets attributed to web UI people being easier to hire and unwilling to learn native UI.
Apparently electron enabled all of those companies to make those apps you use.
Electron has entire libraries that are portable cross-OS. It is literally write once, deploy on Ubuntu, Mac, Win10. I've never had an issue, even using serial ports and USB interfaces. Qt is just a GUI, you will still need to write native hardware interface code. As a bonus, with Electron you also get ALL of the modern frameworks and templates. If you choose Qt you will always feel "behind".
EDIT: Based on this thread I need to re-examine Qt. They now have cross-platform USB endpoint classes that are of interest. But I'm not giving up my frameworks.
Stuff like QSerialPort worked fine across platforms for my usage. YMMV
* Only very popular libraries actually available.
* Sometimes they break on package manager and no one notice for months since test coverage is often limited.
* Each extra library might cause tons of little issues and make your build system more and more complex.
* Libraries often don't support all OS equally well.
* Most of mature C++ projects avoid those libraries and package managers.
So much often than with npm you will have to test each library on your own and what worse you might only learn that something fundamentally broken (on specific OS or architecture) inside it much much later. And with C++ it's just harder to do refactoring to replace said library with something else.
Why would you dig your heels in if you've found a superior alternative fulfilling all your requirements?
I was being funny but you took it seriously.
You can write the cli in rust and the gui in html js css
Binary will probably end up around 6MB
[1]: https://www.bleepingcomputer.com/news/microsoft/microsoft-is...
Don’t be GUI-first or CLI-first; be API-first. You can get started by writing a test target. As soon as you need more than “edit tests, recompile, run, examine debug prints”, you can start on both the GUI and the CLI together.
Focusing on keeping a solid API makes things much simpler. And if you ever regret choosing Electron over Qt or vice-versa, having all the juicy parts behind an API makes it much easier to switch.
For examples, look at Git, the TypeScript compiler, and Everything [0] (closed source unfortunately).
There was a quick-search app for macOS that used V8-to-Rust asynchronous procedure calls as the API. It would make a great example, but I can’t remember it’s name.
(Love the app idea btw! I look forward to trying it on my mess of files for my small business.)
If you build it as a CLI, you can get the GUI for free via Gooey[0] (shameless plug)!
But then you've just added a dependency and, unless you vendor that thing, or don't update it in the future, you've no way to ensure it doesn't screw up your application at some point down the road.
Design the API, write the code, then have your front end(s) (cli, GUI, etc) call into it. Best of all worlds, no additional dependency.
This is very good advice for all systems. First try to describe the domain before implementing the user interface.
Qt is amazing due to much smaller memory footprint, but cross platform builds, packaging and CI still gonna take a lot more effort to maintain.
Some of the most performant products use it, like antivirus products. Yet, you see antivirus products have a nice GUI and that's the reason. You can see it in the showcase.
I know Sciter is not mainstream, but you don't have to deal with Qt's API nor with making your business logic in Javascript with Electron and shipping the greatest overhead that an embedded browser implies.
To me, it's the best of both worlds. Flexible do-as-you-see-fit GUI and native performance because of compiled languages.
[0]: https://sciter.com
You also neglected to mention that Sciter is closed source which is a pretty big turn off.
> antivirus products have a nice GUI
They do??
> deal with Qt's API.
Qt's API is one of the best designed that I've ever used.
Yeah, but most developers won't in the case of Electron. It's a source of CPU Perfomance abuse. Developers will take the shortest/easiest route, businesses will save costs on development at the expense end-user software performance. See [1].
It's almost always best if your framework protects you from shooting yourself in the foot. That's why some languages support Static Typing, Type Inference, Clear Inheritance rules, among other failsafes. In this case, Sciter protects you from bloat-by-default GUI code.
> You also neglected to mention that Sciter is closed source which is a pretty big turn off.
That's not true. The source code is available for review if you pay for the license. It's not a turn off for businesses that do need continued support and a contract to back it up.
There was an effort to open source it, but it didn't took off in the past year. See [2].
> Qt's API is one of the best designed that I've ever used.
Yes, it's nice and all. I've used it myself in about 5 projects. I didn't try to imply it's hard to use or somewhat cumbersome.
However, sometimes I prefer not to have to deal with Qt's Theming or I really need custom controls I'd rather develop with web technologies rather than with Qt, at the same time not bundling an entire Chromium + Node 300mb+ package.
Sciter does the job for less than 2 Mb, and to me that's unparalleled advantage over Electron.
[1]: https://www.ivanmontilla.com/blog/economics-of-software-perf...
[2]: https://www.kickstarter.com/projects/c-smile/open-source-sci...
EDIT: Typos and clarity.
1. Like Electron but uses the platform web view API - Edge on Windows, Safari WebKit on Mac and GtkWebkit on Linux.
2. Same but I think it uses GtkWebkit on all platforms and possibly bundles it (if their claim of zero dependencies is not a lie). Not so sure about this one.
QT has much less overhead to it, but it's not exceptionally difficult to create an optimized Electron app that people will enjoy using. Discord and (in my opinion) Visual Studio Code are good examples of well-optimized Electron apps.
All else held equal, I would personally choose Electron (or rather Tauri) if just by virtue of "you are forced to separate the display tier from the business logic."
You just have a powerful computer.
I switched from Slack / Discord to Ripcord and, even though the UI is not great, it's much cheaper to run. It's using 80mb of RAM with multiple slack organisations open and multiple discord servers.
Pritunl written in Electron is using more than 100mb or RAM, just to let me provide 2 factor auth and connect to my VPN.
I've been toying with the idea of writing a native app for Pritunl, but I don't work for Pritunl and I have 32GB of RAM. I'd love to rewrite Visual Studio in Qt, but I don't work for Microsoft.
The funniest thing is that the developer experience on Qt is years ahead frontend development in the browser and it's been like this for more than 10 years. You have a mature widget system and you even have native looking widgets.
I can see the appeal of Electron; if all you know is web development, you don't want to take the additional complexity of learning a new framework. Personally, I would definitely use Qt.
I definitely don't intend to imply that Electron apps aren't inherently heavier - they are, hence the second paragraph of my initial comment.
> I switched from Slack / Discord to Ripcord and, even though the UI is not great, it's much cheaper to run. It's using 80mb of RAM with multiple slack organisations open and multiple discord servers.
I actually switched to Ripcord for Slack myself! I find it doesn't provide a comparable experience to the first party Discord app, but it beats Slack all day every day. Slack is an excellent example of a poorly made and unoptimized Electron application, in my opinion.
However, recently Qt's own marketing people seem to be undermining it by incorrectly suggesting that all commercial development requires a commercial license. Which is not the case. Commercial developers can use the GPL or LGPL versions as long as they comply with the license terms. Complying with LGPL is generally quite easy.
Qt is amazing, though only downside is near absence of ready-made 3rdparty widgets. Which limits the development speed quite a bit, while in other technologies you have an option to throw $$$ at the problem at get a widget of ok quality to solve your problem, there is very little of that available for Qt. So before venturing there I would recommend checking if built-in are covering everything you need, otherwise be prepared for a long road of making native-feeling widget that works with all platforms UI guidelines.
I would give .NET ecosystem a try, they cover both developer velocity (coding in Rider is amazing) and 3rdparty widgets (plenty available), albeit it's not _that_ crossplatform just yet, .NET MAUI is only getting ready for .NET 6, so there be dragons :)
- GUI vs. CLI
Build command line tools first. Stick to the Unix philosophy of "Small is beautiful - do one thing and do it well" with each command program. Then build a GUI app for whatever platform you want to support.Why CLI first? Command line tools can be used independently in scripts to automate various tasks (often repetitive tasks). This also further decouples programming logic so that you can work separately on the CLI code and the GUI code. (Here's some good tips on how to create a GUI for a command line tool - https://softwareengineering.stackexchange.com/a/204316 ).
(Also keep in mind another Unix philosophy - "Reuse. Don't reinvent / rebuild". The GNU Coreutils command line programs that is available for multiple platforms can be a real asset for your project - https://opensource.com/article/18/4/gnu-core-utilities . SQLite is another software that can really make your project simpler).
- Language / UI Library Selection
For creating the command line tools, I'd recommend whatever language you are comfortable with, but I'd opt for something that can create a standalone executable.For creating the GUI, consider the free and lesser known gem Lazarus https://www.lazarus-ide.org/ - it can help you create native GUI for many platforms from one code-base (with some tweaks for each platform). A native GUI makes your application small, fast, and familiar to your users. The catch - you will have to learn Pascal to use it - if you are familiar with it, here's a good tutorial http://www.delphibasics.co.uk/Article.asp?Name=FirstPgm to help you get started. (Note: Lazarus is an open source fork of Delphi - https://www.embarcadero.com/products/delphi ).
Lazarus is better than QT because it uses the operating systems native GUI toolkit. You also don't have to worry about licensing issues with Lazarus and can even create commercial closed source applications with it for free.
Lazarus is better than Electron because Electron bundles another layer over the OS (the chromium browser framework) to render the UI. That's a lot of additional software just for a GUI, and will make your software big (50+ MB) and slower (chromium is a resource hog).
(But ... if time is a constraint or you don't have the inclination to learn yet another programming language, then go with what you are most familiar. If it is C++ choose QT. If it is HTML + CSS + JS, choose Electron.)
- Use Cases
I'd like it to be platform and filesystem agnostic - easily portable to another OS. Have fast indexing and search. Extensive tagging. (Using a database, like SQLite, can really help with all this).Is the point to build and support this project for the medium to long term? Choose the one with which you’re more familiar, or for which there is more available help and resources.
As a sub-consideration, do you expect others to work on this project with you? Choose the one with which contributors are more likely to be familiar.
Is the point to learn a new UI framework? Choose the one in which you’re most interested.
Is the point to burnish your résumé? Choose the one that is more in demand by the opportunities you’re seeking.
That’s assuming that both technologies can meet your requirements (e.g. if you might want to use this on resource-constrained devices, choose Qt; if you want a web version, choose Electron). But all else being equal, you need to figure out your goals before you can make this decision.
Then again mine is only a source included product, not a community effort.
I recently added a wgpu backend https://github.com/adamnemecek/femtovg.
Combine that with the Flutter layout (check out the Druid implementation), and you have a GUI framework.
Join the discord https://discord.gg/V69VdVu
git-annex manages (possible very large) files and helps you to copy/move them between different storage location, e.g. usb sticks or hard drives (actually it supports far more than those). In your proposed scheme when you copy a file to a new location you must also copy the UID. This means that when you copy a file by traditional OS commands, your system will will not be able to recognize that the copies are actually identical. git-annex uses a smarter system because the unique identifier for a file is a hash of its contents. This means that it can detect if two files are identical or not[1].
In your description of a bin you have a name, description and tags as information about the bin. You only really need tags because they could be used to implement name and description. With git-annex you can add tags as metadata to each file [2].
git-annex is a great solution if you have many files stored in different locations.
[0] https://git-annex.branchable.com/ [1] If you think that you can produce SHA-256 collisions, you should be writing a scientific article about it and not spend so much time on HN. [2] https://git-annex.branchable.com/git-annex-metadata/
Personally I'd go with almost anything that seems OK on Linux (e.g. GTK seems to be pretty mature and seems less susceptible to issues with the Qt company), and native on every other platform.
Funny, I have the same problem, and use a similar solution for a long time now.
> What we need is a cross platform, cross UI (GUI and CLI interface), and cross file system solution. It has to work on thumb drives with ExFAT filesystem.
Why cross platform and cross filesystem? Why specifically ExFAT? Is this a personal Project or something Community-driven?
> Bin Pointers - Pointers live in one part of the tree and point to a Bin in another part of the tree. Just like Aliases on MacOS, Shortcuts on Windows, or Soft Links on Linux, but cross platform and automatically self updating! If you move the target Bin, the Pointer will find where you moved it and update itself!
Many Buzzzwords. Also, are Windows-Shortcuts and Symbolic Links really the same? AFAIK Shortcuts are on desktop-level, while Symbolic Links are on Filesystem-Level. And Windows&MacOS have links on Filesystem-Level too.
> The base file organization unit in Bin Finder is a File Bin. A Bin is just a folder with a Bin Description File > Because a File Bin is just a special type of folder, it can contain any number of files and sub-folders inside of it, including other Bins and Pointers to other Bins! > If you need to tag or point to an individual file, it can be wrapped individually in a Bin. Since most human endeavors of any substance produce multiple files, this use case is relatively uncommon
Looks kind complicated... What's the point of nested bins?
My own solution is similar, but simpler. I use a central folder $HOME/HUB were I collect my sources (Local Drive, USB-Stick, NAS...). Each source has a subhierachy according to some personal reasons, with Content-Folders being on a fixed level. Each content-folder has #Tags in their name, and I use a simple script with rules to generate Hierachies of filesystem-links in my home-folder. I run the script occasionally when I change something, and thats it.
I also have a handful scripts and build a little GUI for managing code-projects, but overall it a very stable and straighforward solution. I mostly use a filemanager for 10+ years now, and overall it works very well. Though, I use it on Linux, were such things are common and easy. Having certain fixed paths for certain is also preferable, so my solution must be working on it's own, without a gui.
> When you click on a Pointer to the Project Bin you just moved, the system will first check where it has seen the bin last. If the system can't find the Bin in that location, it will quickly rescan all of your Trees. If the Bin is found in another location, the system will update the pointer and open the Bin
This is pretty much the same as what Windows Shortcuts are doing.
This overall reads like you reimplement Windows Shortcuts, but for Multi-sourcesand with a focus on Project-Workspaces-Handling? How would this work on CLI? You can't click them there?
> I have most of the UI and workflows worked out in my head pretty well, but I find myself in a "paralysis by analysis" situation.
So you have not used it yet? Then why not start using it? Start as simple as possible an experience the basic concept in your daily life. I know from my own system that things evolved over many years and adapted to certain demands from my own life and work. Organizing is very personal an i won't be always work as plannend.
> GUI vs. CLI - I want to support both. But should it be a CLI first application that's then wrapped with GUI?
What is the purpose of the GUI? How would you use it daily? What's the purpose of CLI, How do you aim to use that? Waht ability do you even have? Are you a coder and could implement something fast? Or would you start by zero and would invest a juge a mount of time for this?
> Language / UI Library Selection - Here the choices appear to be Electron with JS vs. QT plus either Python, C++, or Go.
I use Python and Qt. It's working well for this, as Python has a good focus on filesystem and cli-tooling, while PyQt allows fast growth into frontends. I would at least start with this for your first generation, till you have figured out what you really need. Start with cli, evolve into a lib, and build the GUI. Then you can still optimize with Go or Electron, depending on how it goes.