106 points · by kiyanwang · 8y ago · 226 comments
First, the author is not doing this for his CV.
Second, the benefits of using electron are enormous for any JS developer and there are a lot.
Third, I also hate electron apps and wouldn’t use this app, but I’m not going to jump back to “why electron is bad” discussion, since I can’t suggest anything better in 2018.
I think they are still unmaintained and also are lacking the community around it. I think GitHub embracing Chrome-wrapped-apps was a significant move, since no other company did something similar for desktop javascript applications.
Maybe we will need to wait a bit more, until some of the big tech companies realises that having better QT / GTK bindings and build tools, examples, proper documentation will benefit a lot the company and the community around it. Until then, we are stuck.
well it might in relative terms, but a pyqt app is almost certainly going to be an order of magnitude faster than electron.
But pyqt apps are way faster than electron
This will allow you to fully interoperate Qml and .NET (Mono/.NET Core/Full Framework).
Qt had pretty good Java support with Qt Jambi. But nobody cared and they cancelled the product.
Disagree. I'd argue using Electron actually holds back developers, because they don't learn languages other than JS.
First of all, JS isn't a bad language. It's also a lot different in 2018 than at its worst in 1998. It's becoming so common because it is a pragmatic choice that is fine to work in in 2018.
Secondly, there is the giant ecosystem of transpile to JS languages: Typescript, CoffeeScript, PureScript, Elm, Haxe, Fable, etc.
If that doesn't count, Electron's duct tape itself and many Node packages are native code in C/C++.
Further beyond that, Web Assembly is already expanding the language diversity in the Node world. An immediate example is that the major source map processor used by a number of debugging projects (including VSCode) has already moved parts into Rust via Web Assembly: https://hacks.mozilla.org/2018/01/oxidizing-source-maps-with...
"Thing X is bad because it discourages people from learning about things which are not X."
I would argue that JS platforms actually make it much easier to try out other languages because change languages while keeping the rest the same. Tons of languages compile to and/or run on top of JS.
Not helping with my confirmation bias though.
We now have another 150MB/window application. Great. How about pushing the envelope further and using a Quake engine as the base (it has a console).
https://i.imgur.com/Q6307w3.jpg
The terminal has pretty good ANSI X3.64 support and can connect to a Linux box via telnet.
I mean HTML / JS based solution aren't all bad, it is just we have far too many baggage to carry in the current implementation.
Bold.
Hyper 2's primary focus appears to be features and extensibility.
I doubt they will be in the same ballpark.
https://drive.google.com/file/d/1eQJPan-hs4AgX1pK45WS2UNjjVg...
source: https://danluu.com/term-latency/
DT does not require Electron: There are also embeddings for Qt (using QtWebEngine), Atom, Theia - or you can use a desktop browser. If you use Electron, it is only used for the "chrome" (menus etc). The "backend" (server) is a C program. (It works great on Windows using WSL.) There is also a simplified pure-Java backend.
Hyper2 is clearly faster. Using canvas seems like a win in that respect, but I'm concerned this limits the ability to style the output using CSS. Using a more structured representation (e.g. DOM) also preserves valuable information about the output. The ideal might be to have a structured representation as "the truth" but render to a canvas. This might still be less flexible in terms of using CSS, but that might be an ok tradeoff.
Om H2, if you change the window width, wrapped lines are not re-calculated.
H2 does not "remember" tabs. I.e if you 'cat Makefile', and copy the output, you get spaces, not tabs.
H2 shows a lot more errors when running the vttest test suite.
DT supports hyper-links to file positions. For example clicking on FILENAME:LINE:COLUMN: (as produced by many compilers) will open a (customizable) editor and go to that position.
DT supports "printing" images, rich text, and general HTML.
DT supports tabs, draggable panes, detachable sessions (like tmux/screen), and a builtin input editor.
As far as I can tell, putting it in electron would mean that you could embed arbitrary HTML structures inside the terminal (like web page previews or something), but from what I've read, it doesn't look like that's the goal.
One thing that it’s amazing at, though, is taking promotional screenshots. It hides the OS bar by default, plus looks just generally great.
For instance: https://github.com/snapcrafters/fkill
- Makes it possible for people who don't know (and/or don't want to know) anything beyond the web stack to build "desktop" applications.
- Easy to make it look nice by default, because you can reuse all the work that went into building the browser as a runtime, + you have a ton of eyecandy JS libraries to choose from.
Longer-term: new generation of command-line tools with different ux paradigms for interactive use?
Like, <3 TERM=linux and "everything is text" but there are also a lot of possibilities here which would be interesting to explore.
Funny that people "get" jupityr notebooks but not this.
I've done a little bit of experimenting with "alternate UX and display paradigms" shall we say, and that is a long term goal of the project too. Right now the current implementation focus is on filling out the list of standard boring terminal features which everyone needs and expects, plus some more performance work.
The comparison with jupityr notebooks is a good one and it would be nice to support a richer experience while still being keyboard and command line focused.
Electron is just half remembered dream of flash, but without the efficiency or programming environment. That compiled once and worked the same everywhere.
We threw away flash because the iphone was underpowered, only for it to be replaced with the horror that is modern js centered webdev.
Like iTerm2? ;)
https://iterm2.com/documentation-images.html https://github.com/lunaryorn/mdcat
There are probably Linux terminals that can do the same.
Funny that people "get" jupityr notebooks but not this.
I think one reason is that Jupyter does not sell itself as a UNIX terminal, so people feel less strongly about it. Also, Jupyter uses a web browser that you probably have running anyway.
If your target machine can run an electron based shell, you can leave the shell alone and just run your web app.
>- Makes it possible for people who don't know (and/or don't want to know) anything beyond the web stack to build "desktop" applications.
Again, changing the shell does what exactly? Just build the web app you knew how to build...
With that said, first class integration around a shell could definitely make me change editors. As much as I like terminal editors, it's a very limited medium to write an editor. I imagine a Vim/Kakoune/Emacs/etc could be written in a GUI and have even more features yet still retain first class focus on keyboard UX.
Back to hyper. Hyper disappointed me.
1) Text wrapping is a such important feature in modern terminal emulators I cannot live without. They added text reflow in 2.0 as far as I checked. But when you use you would see it is complete disaster. Text does not wrap sometime. Sometime it completely erased. So long story short it is completely buggy.
2) Start up time is horrible. Electron based app should generally design a background service and a UI process. This way when you launch UI it would be way faster than cold start up. I do this for chrome, slack, discordapp, etc. I wish they had better architecture and was a option to enable background thread or service.
The CommandLine blog is a fascinating read of Microsoft's progress over the last three years:
https://blogs.msdn.microsoft.com/commandline/
They've delivered a lot (much of it WSL-driven now that Linux apps run inside it more often), even if they haven't added your particular wishlist items.
For revamping a part of Windows that had almost died on the vine, they seem to be doing a fascinating job, over the last few years, even within Windows' strong mandate to maintain backward compatibility at all costs.
"
I don't even know where to begin with this. So, the suggestion for "the stack for my thing is so large and deep that it takes forever to startup" is not "hey, maybe don't do that" or "hey, maybe we should find a way to optimize", it's "make sure it's always warm".
I don't even begin to understand why this is a world we want to live in.
I'm surprised to hear that there are people who fully close and quit their terminal emulator.
Oh maybe that's the whole point. They want "it's javascript all the way down".
I think I'd literally rather use a shell built on actual turtles. A turtle-shell, if you will.
Additionally, this annoyance probably has more to do with the fact that Electron is used by developers for other developers. If it would be used to replace Excel the rage would probably be less pronounced. I'm still wondering what would happen though, because of all the subtle ways in which the UI experience would be broken for someone who's used to Excel.
Its a clear example of "We can do it but should we do we?" The answer is NO!
I personnaly think a terminal based on web technologies is not something I would use, but if people are happy to use it, as soon as they are aware of the tradeoffs, why not?
This comment (though probably by mistake) manages to perfectly illustrate the "reinventing things that we don't even understand" mindset that's going on in most of tech.
(Also, there exist terminals written in C++ with Qt, and QtWidgets has had CSS support for custom styling for at least 10 years, probably much longer.)
macOS built-in Terminal.app has had transparency (even varying transparency for focused vs background windows) for years.
Edit: oh, maybe you were being sarcastic? It's been a long day.
That said, I have not disliked my experience with VS Code and Hyper. I like iTerm's performance better but I aesthetically prefer Hyper. I like Sublime Text's performance far more than VS Code, but VS Code has come a long way and is free, and I don't use it enough to justify paying for ST currently.
Some may argue that PowerShell fills that void. While it helps, it is not the same.
This is also fascinating: https://github.com/Microsoft/console/issues/57 - a proper PTY for Windows, implemented by Microsoft, with the ConEmu guy giving it a thumbs up.
I'm really looking forward to learning Flutter (https://flutter.io) so I can finally do some mobile based application development in a cross platform manner without having to use JavaScript. Prior to Flutter I was considering Swift and Kotlin and just maintaining two code bases (and two languages.) Hopefully I won't need to now.
On desktops I would just go native. Is it really that hard to maintain several code bases? Is there literally no other options at all? I'm considering Go + QT here, or something along those lines.
And Dart is about a million times better than JS for the way I like to think about code.
...god of bloated software and goddess of complex solutions of simple non problems got their blood sacrifice and the sun will rise again.
Why would you use a full web stack terminal emulator, over.. well a normal native and actually reasonably fast terminal emulator?
The trend is catching on, so maybe one day we can't even reach for a native email client because it will be unmaintained in favour of the hackable html webstack email client.
Congratulations on reaching v2 tho!
And I agree: Electron is horrible to deal with as an end-user. I've been using Vim for some time and then decided to use VS Code. The integrations, plugins, and everything else were awesome, but man the 3-4GB of RAM was just crazy. Despite the fact my machine has 16GB of RAM, I'm dealing with quite a few VMs and Docker containers locally, so actually 16GB isn't a lot.
What kind of files do you usually work with? Because I've currently got two 10000+ line python files open which are part of a project that is at least a million lines of code, and my VSCode instance is using less than 300 MB of RAM.
That also coincides with:
https://medium.com/@caspervonb/why-i-still-use-vim-67afd76b4...
And
https://github.com/jhallen/joes-sandbox/tree/master/editor-p...
Notice how those numbers don't add up to 100%. They let you pick multiple answers on the survey. Therefore, I would consider Vim percentage even lower in reality since many people would specify it on a survey since they basically have to use it while working on a server.
Vim is used by a small but very loud minority. Don't listen to them - they're optimizing for the wrong thing (keeping your fingers on the home-row of the keyboard) at the expense of just about every other aspect of computing.
The scary thing for me, even after getting used to navigation, was the lack of it feeling like an IDE - autocomplete, compile on save, etc.
After installing some plugins - it's now wonderful and I enjoy it much more than VSCode.
There's a ton of little extra benefits you get from the switch besides the usual - for example, when you use a mouse, the time you spend navigating visually is kinda wasted. With a keyboard, that time is spent thinking about "what's the next parenthesis" or "what's inside these quotes" which turns idle time into something more useful like getting more familiar with the code.
Correct indentation when pasting is a pain in my opinion.
And somehow I find the VSCode's multi-cursor feature so much more convenient than Vim's macros.
Aside from that, electron apps do not look, act or feel native.
It's reached a point where I use my iOS devices for Spotify and/or Slack just so my laptop can run whatever other crappy Electron app I need to use.
I find that VSCode is almost worth it, but that's perhaps one of the few exceptions (and I still go for Sublime Text most of the time).
Any app that needs to be persistent really has no business using Electron. It's a terrible waste.
What does this even mean? UTF-8 decoding is trivial. In fact it's designed to be simple: it's a prefix code that is self-synchronizing.
Rendering glyphs and composing characters is hard in comparison. But Cocoa, Qt, etc. have had great support for rendering unicode for ages now.
I have no recollection of having problems with iTerm, Terminal.app and many Linux terminals for rendering unicode the last decade or so. (Only with people setting their locales wrong.)
Being web-based gives you a standard way for fetching and displaying content. It's just a matter of time that the performance improves. Especially when many people are experimenting with it.
> maybe one day we can't even reach for a native email client because it will be unmaintained in favour of the hackable html webstack email client.
It's definitely possible, once the browser becomes the new OS.