
Hyper 2, Electron based terminal - kiyanwang
https://zeit.co/blog/hyper2
======
drinchev
Wow so much hate in this thread.

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.

~~~
sakuronto
What about good ol' QT?

~~~
sime2009
The problem is that your language choice is very limited. You can choose C++,
no thanks, or Python which is very slow. There are no good options for
languages or VMs on Qt in the Java/C#/VM/Jit range of the language performance
spectrum.

~~~
sametmax
Python and js apps have the same order of magnitude of speed.

But pyqt apps are way faster than electron

~~~
sime2009
No they don't. JS running on a modern engine like V8 are easily 10x faster
than CPython which PyQt uses.

If you think Python and JS are about the same speed then it is because of Qt
itself, but certainly not because of CPython.

~~~
sametmax
I have coded with both, and practically, yes, they are. The only place where
JS would beat Python would be a big loop with number crunching, which you
would do with numpy anyway. Or pypy, which is 50 times faster than V8.

A desktop app would not see any difference. A sysadmin script neihter. Data
analystics is made using numpy/scipy/pandas. Web sites bottleneck are
incredibly rarely the server side scripting language, and when it is, you go
rust/go.

But for our current debate, electron VS PyQT, well yes, the C++ does the heavy
lifting and you get to use Python only for the stuff it is good at. Win-win.

The problem with using PyQT is making an exe or making fancy graphics is
harder than in electron.

Everything else, and I do mean everything else, is easier and more performant
with PyQT.

~~~
foldr
> pypy, which is 50 times faster than V8.

Ehhh V8 is pretty competitive with C for number crunching. Where are you
getting that 50 times figure from?

~~~
KaiserPro
threads.

~~~
foldr
[http://doc.pypy.org/en/latest/faq.html#does-pypy-have-a-
gil-...](http://doc.pypy.org/en/latest/faq.html#does-pypy-have-a-gil-why)

If you're using parallelism for non-IO-related reasons, then in either
language, you'll probably end up using multiple processes rather than multiple
threads.

------
anotherevan
Honestly, I only clicked on this page to read all the comments hating on
electron.

Not helping with my confirmation bias though.

~~~
noxecanexx
Came here for the same reason. Although I am more interested in what @rauchg
is doing

------
mchan
Interested to see how this compares in performance and resource usage with
Alacritty[1]

[1]:[https://github.com/jwilm/alacritty](https://github.com/jwilm/alacritty)

~~~
sanjeetsuhag
Rust Evangelism Strike Force to the rescue.

~~~
moistoreos
I laughed real hard at this phrasing: > Alacritty is the fastest terminal
emulator in existence.

Bold.

~~~
whyever
Depends what you mean by "fast". It seems to have the highest stdout
throughput, but that is not necessarily the most important metric:
[https://danluu.com/term-latency/](https://danluu.com/term-latency/)

------
smolsky
Oh, great, people are still latched onto the Electron hype.

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).

~~~
seba_dos1
Wouldn't a Quake engine based terminal emulator actually be way lighter? :P

~~~
nineteen999
I know you're joking, but I did one in Unreal Engine 4, although it's attached
to a Z80 CPU emulation for running CP/M (and hopefully FUZIX later on).

[https://i.imgur.com/Q6307w3.jpg](https://i.imgur.com/Q6307w3.jpg)

The terminal has pretty good ANSI X3.64 support and can connect to a Linux box
via telnet.

~~~
tluyben2
Ow that is pretty cool! Can we play around with that somewhere?

~~~
nineteen999
Hopefully by the end of the year. It's one of those situations where the
emulator works great, but there's no game as such for it to interface to yet,
and I'm sort of struggling to come up with basic gameplay mechanics.

~~~
techdragon
I would LOVE to play around with that in the unreal engine editor just to see
what cool stuff I can do with it. Please release it as a component somewhere
by itself without the rest of the game. So much retro <3 for this little
console you built.

~~~
nineteen999
I have considered that it could be useful for other people just as a
component, yeah. I'm still working on the SDK to go with it (a C library and
some example programs). Work has gotten really busy lately so I don't know
when I'll get it done, but I do really want to finish it off.

------
Per_Bothner
Some comments comparing DomTerm ([http://domterm.org/](http://domterm.org/))
and Hyper2 (H2):

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.

------
i_dont_know_
Maybe I'm missing something... is there a benefit to this over a normal
terminal/terminal emulator? (eg xterm, mac terminal etc)?

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.

~~~
jhanschoo
I've always wanted a terminal with bloom effects and it seems that Hyper 2
might be able to provide that. But I haven't found a theme that does that, and
I haven't wanted it enough to look into that.

~~~
movedx
Bloom effects? As in, glowing and stuff?

~~~
Y_Y
I think he means it becomes covered in algae

------
muzzio
I used Hyper for a little while a few months ago and thought it was okay.
Still prefer iTerm for daily use.

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](https://github.com/snapcrafters/fkill)

------
solarkraft
Uses weird window decoration, uses a weird type face, doesn't support tabs ...
And hell, it's Electron. I'll stay with the few-kb, vala[C]/gtk elementary
terminal.

~~~
vittore
Although it does support tabs and you can use any decoration/type face you
want.

------
ricardobeat
With rendering moved to canvas, does it still make sense to use Electron? A
lightweight drawing surface + js bindings could do the same in a much lighter
package.

------
wishinghand
While everyone fights about Electron I have a slightly off topic question- why
are programs like these called a terminal emulator (emphasis on emulator)?

~~~
jowiar
A physical "terminal" is a piece of hardware:
[https://en.wikipedia.org/wiki/VT100](https://en.wikipedia.org/wiki/VT100)

~~~
pknopf
I think people also refer to a "terminal" as one of the virtual terminals
(CTRL+ALT+F[1-9]) that Linux provides.

But yeah, people use the term to mean different things.

~~~
tinus_hn
These “virtual” terminals of course are also emulations of the original
hardware terminals.

------
riobard
If it's just drawing pixels… what's the benefit of the web stack?

~~~
TeMPOraL
\- Easier to make a multiplatform application, compared to alternatives.

\- 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.

~~~
zxcmx
Also you can have interesting rendering possibilities like in-line display of
images, charts, tables.

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.

~~~
KaiserPro
jupityr notebooks provides something that is difficult to get else where:
multiplayer interactive programming sessions. its also not overly heavy.

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.

~~~
TeMPOraL
> _We threw away flash because the iphone was underpowered, only for it to be
> replaced with the horror that is modern js centered webdev._

Also a sad thing: Flash sucked for building UIs, because it did not have a set
of standardized elements and interactions built in. I'm thinking of all the
trivial details like mouse pointer changing when you hover over a text field,
or a text field that supports arrow navigation, selection, copying and
pasting, a context menu, etc.

Now the browser, as a runtime, has all those expected UI interactions built
into all the standard HTML components. And what does the web crowd do? _They
throw it all away_ by building their own half-assed reimplementations of every
UI element. There's lots of man-hours being wasted replicating the _problems_
of Flash.

------
SnowingXIV
My gripe was always having a terminal not blend in with the editor which makes
this nice but vscode essentially does that out of the box for me. Now if I
ever need the terminal and I'm not looking to code anything, I just use the
native terminal. I can see why some people might like this if they are using
sublime, atom, etc other editors that don't have terminal included but that
was the only void this somewhat filed. (And yes, you can edit up the native
terminal but you still get a different looking top bar).

~~~
tbodt
I solve this problem by using vim, so my terminal _is_ my editor.

~~~
notheguyouthink
Agreed (though I use Kakoune).

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.

~~~
Siilwyn
Check out Oni: [https://github.com/onivim/oni](https://github.com/onivim/oni)
It's under heavy development, wouldn't recommend it at the moment but it looks
promising.

~~~
notheguyouthink
Wow that is amazing looking!

Makes me want to make something like that for Kakoune! Wonder if Oni will ever
get to the state where you could write different backends for it; ie emacs,
kakoune, etc.

------
Rjevski
Oh great, a terminal emulator using 100+ MB of RAM. Just what I needed.

------
0xFFC
I had high hopes for this project. Particularly considering the fact default
terminal in Windows is a total crap and it seems Microsoft is not interested
at all to fix the problems (yeah, I know, they are saying they are working on
it but they haven’t delivered in 3 years, how hard it is to add unlimited
scroll bar option? Or hide scroll bar?. I wish I could’ve run gnome-terminal
in Windows.)

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.

~~~
WorldMaker
> they are saying they are working on it but they haven’t delivered in 3 years

The CommandLine blog is a fascinating read of Microsoft's progress over the
last three years:

[https://blogs.msdn.microsoft.com/commandline/](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.

------
LinaLauneBaer
I am using Hyper 2 since the beta and I really like it. It has replaced iTerm
for me. Performance may still be an issue for some people. For example,
printing to stdout seems slower on Hyper than on, let's say iTerm. To me it is
noticeable but still feels nearly instant.

~~~
emadb
Why did you choose Hyper? IMVHO iTerm2 is still far way better as a terminal.

~~~
LinaLauneBaer
Purely due to aesthetic reasons. I am not using the terminal for any complex
stuff and this allows me to use the terminal which looks the best to my eyes.
If my requirements change I may go back to iTerm but for now: something simple
and nice looking is okay.

------
stephenr
Pop quiz: what's more ridiculous, nodejs based command line utilities that do
the same thing as two existing shell utilities and a pipe or a while loop etc;
OR, an electron "shell"... which can then run those same nodejs "utilities"...

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.

~~~
jitix
The whole electron stack disgusts me. Mainly because of battery usage on my
laptop and my phone!

Its a clear example of "We can do it but should we do we?" The answer is NO!

~~~
agumonkey
hey, how else can I change the transparency of my shell with css ?

~~~
majewsky
You can't. You can only change the transparency of the terminal.

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.)

~~~
btrask
This is a great "well actually" that also manages to be technically incorrect.
If you change the styling in your _terminal emulator_ , it changes the
transparency of your _shell_ (and other terminal programs).

------
_pmf_
When you absolutely need that "tar xf" to take 23900 times longer.

~~~
cdelsolar
why would it take 23900 times longer

~~~
tonyarkles
`tar xf` probably wouldn't take longer, but `tar xvf` might, depending on how
good/bad the stdout performance is.

------
kup0
I'm somewhat on the fence when it comes to Electron applications, because I do
tend to prefer everything to be "lightweight" even if the machine it is on has
a ton of performance overhead.

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.

------
bojanvidanovic
For something so essential in my daily work as terminal, I'd rather stick with
iTerm or similar. However, it's an interesting project and congrats to the
author on v2.

------
btlr
On my Mac I still prefer iTerm, but I really like using Hyper on my Windows
box.

~~~
cozuya
Really looking forward to trying this out on my Windows box at home. About
twice a year I look for good terminal programs for it and it seems nearly
impossible. To this day I just have a bunch of Git Bash windows running...

~~~
Per_Bothner
Have you tried DomTerm ([http://domterm.org](http://domterm.org))? It works
great on Windows, though it requires WSL: [https://dzone.com/articles/running-
domterm-terminal-emulator...](https://dzone.com/articles/running-domterm-
terminal-emulator-on-windows-using)

------
reneberlin
When the aliens will slurp up our "latest advancements in technology" they
will have a huge clusterfuck and some serious hickups. Maybe we should put
warning-stickers upon some stuff.

------
sbr464
tried it for a bit, moved back to iterm2

------
reneberlin
While it was thinkable all the time, it renders me speechless, that finally
somebody has put that stack under a terminal. The next big thing will be
electron-based smooth-scroll, mouse-animation and finally: a 70mb beep.

~~~
cozicoolmail
I also don't get it. Why would I want a full web browser to power my terminal?
Just because we can, doesn't mean that we should...

~~~
matlk
Windows?

~~~
aandrieiev
why bother with a cross-platform framework, then?

------
pattisapu
No operating-system specific bar on the top of the window is kind of nice for
screen casting.

------
domenukk
Hyper is the only proper terminal emulator on Windows. Time to upgrade.

~~~
nonintuitive
Have you tried ConEmu? That's definitely my favorite.

~~~
partycoder
ConEmu makes Windows a bit more palatable. But the lack of a "UNIX philosophy"
(everything is a file), makes the CLI less powerful on Windows.

Some may argue that PowerShell fills that void. While it helps, it is not the
same.

------
hestefisk
Interesting experiment, but I think I will stick to rxvt.

------
kyriakos
Why would anyone pay for a terminal?

------
s73v3r_
Why does everything have to be built on HTML/CSS/JS nowadays? What happened to
the days when people would learn new languages that were appropriate for the
project they were taking on?

------
movedx
I just can't stand Electron based applications at all. I can't stand
JavaScript actually, but that's something different entirely.

I'm really looking forward to learning Flutter
([https://flutter.io](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.

~~~
mathw
I've been playing with Flutter and it seems pretty good. Dart isn't too hard
to get your head around and isn't too annoying, although I do find myself
disappointed that I have to learn yet another language for it. I don't have a
particular problem with learning languages, but it's another speedbump on the
way.

And Dart is about a million times better than JS for the way I like to think
about code.

~~~
movedx
Glad to hear it! I'm looking forward to giving it a try, but right now I'm
hooked on Lua and Corona! Ha! :)

------
_o_
I think that electron desperately needs boot loader and own kernel, then they
will be able to reimplement whole operating system in js.

...god of bloated software and goddess of complex solutions of simple non
problems got their blood sacrifice and the sun will rise again.

------
caspervonb
Like I've said a million times, [https://medium.com/p/electron-is-
cancer-b066108e6c32](https://medium.com/p/electron-is-cancer-b066108e6c32)

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!

~~~
movedx
Good read. Thanks.

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.

~~~
fbnlsr
I've been using VSCode for years and it's been great, but I'm always looking
for learning something new. I keep reading about Vim and last time I checked
it seems SO complicated to use. I don't understand how it's so popular. Is it
because it's blazing fast?

~~~
jannes
You can use vim keybindings in VSCode. It mostly works, except for more
advanced stuff.

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.

~~~
SPBS
> And somehow I find the VSCode's multi-cursor feature so much more convenient
> than Vim's macros.

That’s not an unpopular opinion, I suspect it’s because multiple cursors
provide an extremely tight visual feedback loop (feedback after every action)
as compared to macros where you kind of just shove actions into a black box
and pray it works correctly for the next location you test it on

