News for hackers. Stuff that matters.
Re:HyperTerm – JS/HTML/CSS Terminal by rosalinekarr on Friday July 15, 2016 @01:02PM (#12102361)
This looks very well executed and really cool, but I'm honestly really tired of all the node/electron terminals. In its favor, this project looks a lot more clean and less opinionated than that 'Black Screen' monstrocity.
Re:HyperTerm – JS/HTML/CSS Terminal by michaelmior on Friday July 15, 2016 @01:10PM (#12102414)
I'm curious why there's so much node/electron negativity circulating. (Although I guess asking for positivity when it comes to electron is a bit of a stretch :P)
Re:HyperTerm – JS/HTML/CSS Terminal by jackmott on Friday July 15, 2016 @03:39PM (#12103314)
Well for instance, Atom and VSCode have ~50ms (or ~49x) more input latency than editors written in C (source: https://pavelfatin.com/typing-with-pleasure/ )

But maybe we are willing to accept 50x worse performance and higher memory requirements and slower startup time because the language is nice and guarantees correctness....Well no, it is javascript, not Haskell or Lisp. So, what is the win here? Why have we collectively decided javascript is a good tool for making applications for the desktop?

Re:HyperTerm – JS/HTML/CSS Terminal by codemonkeymike on Friday July 15, 2016 @03:57PM (#12103423)
I can't agree more, There is no reason that editing text files would need a full web browser which is buggy and slow. Many of these javascript apps which are replacing native apps use 500mb of ram, at some point you will have 5-10 of these things churning memory and consuming battery life and cpu cycles. (Note Atom, HyperTerm, Chrome, Slack, and Kitematic is already 5 browser apps)
Re:HyperTerm – JS/HTML/CSS Terminal by johnfn on Friday July 15, 2016 @07:15PM (#12104397)
* We've decided to use JavaScript because the community is there. Go ahead and write an IDE in Haskell - have fun rewriting all the libraries that already exist in JavaScript and soliciting for open source contributions when a tiny fraction of all programmers can understand it.

I love Haskell and lisp, but you have to face the facts.

* TypeScript is actually a good language, and gives pretty darn good correctness guarantees.

* Your benchmark does not test against VSCode, which is much faster than Atom.

Re:HyperTerm – JS/HTML/CSS Terminal by stymaar on Saturday July 16, 2016 @04:23AM (#12105671)
> * TypeScript is actually a good language, and gives pretty darn good correctness guarantees.

TypeScript's main focus is IDE tooling, not correctness. Here is an example on how generics are unsound in TypeScript: http://djcordhose.github.io/flow-vs-typescript/2016_hhjs.htm...

If you want to write JavaScript with a type system focused on soundness, you should give [flow](https://flowtype.org/) a try.

Re:HyperTerm – JS/HTML/CSS Terminal by johnfn on Saturday July 16, 2016 @01:42PM (#12107165)
I don't think that anyone argued TypeScript is 100% sound, nor is that a meaningful goal to hit. I find TS to be a solid language that gives me reasonable confidence in my code. (The tooling is also great!)
Re:HyperTerm – JS/HTML/CSS Terminal by Azkar on Friday July 15, 2016 @03:43PM (#12103341)
Well now when someone removes left pad from npm your whole terminal can break.
Re:HyperTerm – JS/HTML/CSS Terminal by joshmanders on Saturday July 16, 2016 @11:22AM (#12106632)
No it can't. After that whole fiasco npm has made it so packages once published cannot be removed after a 24 hour window without npm manually doing it on your behalf, that is to make sure this instance never does happen again.
Re:HyperTerm – JS/HTML/CSS Terminal by random28345 on Friday July 15, 2016 @01:36PM (#12102591)
> I'm curious why there's so much node/electron negativity circulating.

"There are only two kinds of languages: the ones people complain about and the ones nobody uses".

--Bjarne Stroustrup

I'm pretty sure that applies to language runtimes as well.

> Although I guess asking for positivity when it comes to electron is a bit of a stretch

I like to stay current, and in this charged environment, I'd be shocked if anode runtime wasn't at the nucleus of every accelerator.

I'm sure Dijkstra is half-spinning in his grave.

Re:HyperTerm – JS/HTML/CSS Terminal by pbiggar on Friday July 15, 2016 @10:36PM (#12104999)
Your puns are glorious!
Re:HyperTerm – JS/HTML/CSS Terminal by sehr on Friday July 15, 2016 @01:27PM (#12102534)
They're slow, big, and outrageously inefficient. Most electron apps also come with this weird web influenced "I'm kinda native y'all trust me" UI design which makes it even worse. My battery and eyes simply can't stand the things.
Re:HyperTerm – JS/HTML/CSS Terminal by michaelmior on Friday July 15, 2016 @02:02PM (#12102754)
Interesting. I haven't experienced the slowness of Electron apps. And outrageously inefficient doesn't really matter to me if it's efficient enough for me not to notice any slowdown.
Re:HyperTerm – JS/HTML/CSS Terminal by jackmott on Friday July 15, 2016 @03:45PM (#12103355)
But if we are going to accept the computational inefficiency, what do we gain for it?

If our only answer, collectively, as developers, is the richness of the ecosystem, then perhaps we should be moving our time and energies to make a rich ecosystem in either a language/runtime environment that performs better (C/Rust/OCaml/Whatever) or one that encourages correctness and/or speed of development.

I know some people think javascript is the latter, and I can't prove them wrong, but I suspect that is not true.

Re:HyperTerm – JS/HTML/CSS Terminal by nojvek on Sunday July 17, 2016 @09:24PM (#12112758)
Electron means your app runs on Mac + Win + Linux without much effort. It could also potentially run on the web browser.

That is a huge sell.

Re:HyperTerm – JS/HTML/CSS Terminal by elmigranto on Friday July 15, 2016 @03:19PM (#12103211)
I think he meant inefficient in terms of battery power.
Re:HyperTerm – JS/HTML/CSS Terminal by ank_the_elder on Monday July 18, 2016 @01:24AM (#12113356)
I have tried to edit a file with a little bit of long JSON that came from a server (less than 50K) and atom completely froze trying to display it. This was two weeks ago. I've ditched Atom entirely.
Re:HyperTerm – JS/HTML/CSS Terminal by teamhappy on Friday July 15, 2016 @01:24PM (#12102509)
Trivial apps depending on 14+ million lines of code is not a good thing.

Edit: @michaelmior I think you know what I mean.

Re:HyperTerm – JS/HTML/CSS Terminal by michaelmior on Friday July 15, 2016 @01:26PM (#12102527)
I think a good terminal emulator is far from trivial.

Edit: I'm not sure I do know what you mean. I agree that building trivial apps in Electron probably doesn't make sense. But my terminal emulator is something I spend most of my day using. If building that on top of 14 million lines of C++ gives me a better piece of software, I'm all for it.

Re:HyperTerm – JS/HTML/CSS Terminal by Jtsummers on Friday July 15, 2016 @01:49PM (#12102679)
https://www.openhub.net/p/putty

Perhaps not as feature comlpete, and not my daily use terminal emulator, but it's only 110k lines of code. And it's not just a terminal emulator, that's just one thing it does in that 110k lines of code.

EDIT: I was going to look up others but I'm distracted by other obligations. My point being: Terminal Emulators aren't actually that complex.

Re:HyperTerm – JS/HTML/CSS Terminal by destructionator on Friday July 15, 2016 @07:10PM (#12104374)
I wrote a terminal emulator <https://github.com/adamdruppe/terminal-emulator> and use it daily so it is good enough for me at least... clocks in at ~15k lines (including the gui helper lib).

The biggest complexity is dealing with legacy terminals... and you can really just target the handful of xterm features programs actually use and get something working without a huge amount of code.

Re:HyperTerm – JS/HTML/CSS Terminal by alaroldai on Friday July 15, 2016 @01:53PM (#12102704)
Does it though? iTerm2 is the most feature-rich terminal I've ever used, and even then it's several orders of magnitude smaller then Electron (cloc says it's around 111K lines of Objective-C, with around 38K more lines split across Python and C++).
Re:HyperTerm – JS/HTML/CSS Terminal by michaelmior on Friday July 15, 2016 @02:05PM (#12102771)
Maybe it's not better. That wasn't really my point though. I'm just saying that LOC is a fairly useless metric for evaluating software. Especially from an end user perspective.
Re:HyperTerm – JS/HTML/CSS Terminal by tomc1985 on Friday July 15, 2016 @11:19PM (#12105096)
How so? It affects load time, understandability, binary size, dependency payload...

I personally hate the load times. Node apps always seem to need to think for a second or too. Sublime Text v VSCode is pretty bad. Sublime Text v Atom is even worse.

When you're moving fast and in your flow, it gets to be really annoying.

Re:HyperTerm – JS/HTML/CSS Terminal by michaelmior on Saturday July 16, 2016 @01:13AM (#12105323)
I was talking more about how it affects end users. Understandability of the code and dependencies are irrelevant in this case. Load time is important, but LOC is only a proxy for that metric. It's not totally unreasonable to imagine a well-written app with twice the code start faster than a poorly written one.
Re:HyperTerm – JS/HTML/CSS Terminal by themartorana on Friday July 15, 2016 @02:38PM (#12102953)
I agree with you, with regards to the end user caring or not, but there aren't many tech-unsavvy people using terminal emulators on the regular. So when Putty and iTerm2 both weigh in between 100-200k LOC and this is in the 14m LOC space, it's difficult to not make the presumption that that's a lot for a terminal emulator.
Re:HyperTerm – JS/HTML/CSS Terminal by teamhappy on Friday July 15, 2016 @03:21PM (#12103225)
> I'm just saying that LOC is a fairly useless metric for evaluating software.

That's just not true.

Most open-source people want to be able to read, audit, fix, and (if it comes to it) maintain other people's code. 14+ million lines of code make this virtually impossible. (To be fair: Electron-based apps aren't the best example for the point I'm trying to make.)

Rate of change is another very useful metric.

Re:HyperTerm – JS/HTML/CSS Terminal by e12e on Saturday July 16, 2016 @12:39AM (#12105263)

  git clone git://git.suckless.org/st
  cloc --quiet st
  http://cloc.sourceforge.net v 1.60
  T=0.09s
  (45.8 files/s, 56588.2 lines/s)
  ------------------------------------
  Language   files blank comment code
  ------------------------------------
  C            1      497  253    3654
  C/C++ Header 2       40  124     313
  make         1       13    2      45
  ------------------------------------
  SUM:         4      550  379    4012
  ------------------------------------
[ed: Actually, this get even more extreme for the terminal I actually use everyday, sakura[1]:

  apt-get source sakura
  (cloc sakura)
Gives a total of 2490 lines of code, of which 2380 are C, the rest is CMake, make and Bourne Shell... that is cheating of course, as sakura uses libvte: which clocks in at ~45K lines of C - and a total of ~103K loc all together. Still a far cry from millions of lines of code...

[1] https://bugs.launchpad.net/sakura ]

Re:HyperTerm – JS/HTML/CSS Terminal by michaelmior on Saturday July 16, 2016 @01:02AM (#12105305)
Sure. I wasn't arguing that millions of lines of code are necessary for a terminal. Thanks for the pointer to Sakura though! I quite like it and I might have to give it a try :)
Re:HyperTerm – JS/HTML/CSS Terminal by sgrove on Friday July 15, 2016 @01:36PM (#12102590)
I agree, but I'd take it a step further - the 15+ million Lo(memory-unsafe!)C for the unix kernel other (all?) trivial apps sits on is also not a good thing.
Re:HyperTerm – JS/HTML/CSS Terminal by teamhappy on Friday July 15, 2016 @01:49PM (#12102683)
I agree with your larger point (I think) but for what it's worth: Most of those 15+ million lines are drivers you don't use.
Re:HyperTerm – JS/HTML/CSS Terminal by jahewson on Friday July 15, 2016 @01:32PM (#12102571)
How many lines is the JDK? or .NET, or libcpp?
Re:HyperTerm – JS/HTML/CSS Terminal by teamhappy on Friday July 15, 2016 @01:46PM (#12102665)
LLVM: 1.5 million (I assume libc++ is less than 500k)

OpenJDK: 6.8 million

.NET: 10.5 million

Source: https://www.openhub.net/

Re:HyperTerm – JS/HTML/CSS Terminal by Zolomon on Friday July 15, 2016 @01:25PM (#12102518)
I believe it has to do with the amount of performance lost in the overhead with the electron stack versus a native implementation.

Please correct me if I'm wrong.

Re:HyperTerm – JS/HTML/CSS Terminal by michaelmior on Friday July 15, 2016 @01:30PM (#12102556)
For the majority of applications, I'd imagine there's a negligible performance difference. Besides, any app built on Electron will run infinitely faster than one which wasn't built at all since the developer didn't want to learn another language. I'm not saying Electron is suitable for everything, but I think it has its place.
Re:HyperTerm – JS/HTML/CSS Terminal by asdf1234 on Friday July 15, 2016 @02:03PM (#12102762)
> negligible performance difference

Using Atom or VS Code instead of Emacs cuts my battery life by a few hours. The Spotify desktop app that uses a ton of JavaScript is also horribly inefficient and has a big impact on battery life.

None of this is negligible.

Re:HyperTerm – JS/HTML/CSS Terminal by klibertp on Saturday July 16, 2016 @12:57PM (#12106976)
On the other hand, my Emacs starts up in more than thirty seconds. To fully start up it needs to read some 2k loc of my own ELisp code and hundreds of thousands loc of required libraries.

I use Emacs as a Jabber client, Python and Clojure development environments, file manager, image and pdf viewer, HTTP server, spreadsheet and note-taking app and (polyglot) Literate Programming environment. And that's just the beginning of what it can be used for.

In other words, giving Emacs as an example of small and fast, natively written application is a bit unfortunate. Not to mention most of Emacs is written in ELisp, so the "natively" part is not even factually correct.

Re:HyperTerm – JS/HTML/CSS Terminal by mitchty on Friday July 15, 2016 @02:54PM (#12103066)
On top of this, chrome/chromium versus safari is another 1-2 hours of battery. I think people vastly underestimate the energy requirements of web technologies.
Re:HyperTerm – JS/HTML/CSS Terminal by woah on Friday July 15, 2016 @10:05PM (#12104910)
On which OS?
Re:HyperTerm – JS/HTML/CSS Terminal by city41 on Friday July 15, 2016 @01:52PM (#12102692)
I still question Electron for "commercial quality" apps. The Electron runtime by itself is about 100mb. I've built an internal Electron app for work and for that it's absolutely fantastic.
Re:HyperTerm – JS/HTML/CSS Terminal by mej10 on Friday July 15, 2016 @01:22PM (#12102501)
There are more and more applications based on it -- negativity increases along with popularity.
Re:HyperTerm – JS/HTML/CSS Terminal by Sir_Cmpwn on Friday July 15, 2016 @01:09PM (#12102405)
I'm tired of node/electron anything.
Re:HyperTerm – JS/HTML/CSS Terminal by codezero on Friday July 15, 2016 @01:10PM (#12102418)
I use two tools daily that are built on Electron and they are great. Not only that, but it's never obvious they run on Electron. I'm curious, what do you hate so much about it?
Re:HyperTerm – JS/HTML/CSS Terminal by Sir_Cmpwn on Friday July 15, 2016 @01:20PM (#12102488)
How about the fact that your computer now has three enormous copies of chromium on it for no good reason?
Re:HyperTerm – JS/HTML/CSS Terminal by michaelmior on Friday July 15, 2016 @01:27PM (#12102537)
If you have the RAM for it and the software works well, who cares? Plus, it seems potential improvements are coming in this area.

https://github.com/electron/electron/issues/673

Re:HyperTerm – JS/HTML/CSS Terminal by danieldk on Friday July 15, 2016 @01:47PM (#12102669)
On the one hand side people complain that Turbo Pascal and WordPerfect (or even UNIX for that matter) worked extremely fast on an 386SX with 4MB RAM and that modern software eats hundreds of megabytes of memory and seems slower, without providing much new functionality.

This attitude (replacing a lean and fast terminal, by one rendered using a web browser engine) is exactly why modern machines that are 1000x faster and with 1000x the memory still seem to be slow for basic tasks.

Of course, it's a free choice. You can waste resources by replacing small programs by browsers ;). But it's reasonable that many people find it a waste.

Re:HyperTerm – JS/HTML/CSS Terminal by castis on Friday July 15, 2016 @01:41PM (#12102621)
> no good reason.

Well thats subjective. I might not be as cool as you but I get my work done using these tools.

Re:HyperTerm – JS/HTML/CSS Terminal by teamhappy on Friday July 15, 2016 @01:55PM (#12102716)
I think he's saying you only need one version of Chromium on your machine to run all these tools.
Re:HyperTerm – JS/HTML/CSS Terminal by untog on Friday July 15, 2016 @01:45PM (#12102660)
My Visual Studio Code app is 138MB. On the grand scale of things, I'm not that worried about multiple copies of Chromium.
Re:HyperTerm – JS/HTML/CSS Terminal by city41 on Friday July 15, 2016 @01:55PM (#12102714)
Electron by itself weighs in around 100mb. iTerm2 is a packed to the gills with features terminal that is 13mb.
Re:HyperTerm – JS/HTML/CSS Terminal by Klathmon on Friday July 15, 2016 @04:12PM (#12103504)
I can honestly say that I have never been inconvenienced even slightly by an application that takes up between 0 and 500mb on disk.

If it starts to get into the multi-GB range it can hurt to download, but below that it's all identical to me. If it means that i don't need to run a specific version of a library installed globally on my machine, and i don't need to manage a big chain of dependencies myself, and it runs on multiple platforms, i don't care if it's 1mb or 500mb, and i don't care how many copies of it I'm running.

My ssd has 60gb remaining on it after a few years of daily use and i haven't needed to worry about program space yet.

Re:HyperTerm – JS/HTML/CSS Terminal by codezero on Friday July 15, 2016 @02:02PM (#12102759)
My iTerm process is using about 170mb of memory, though that's admittedly less than half of what Slack is using. Big picture, with 8gb of ram, this is not a problem.
Re:HyperTerm – JS/HTML/CSS Terminal by Sir_Cmpwn on Friday July 15, 2016 @02:27PM (#12102884)
I have 6 terminals open right now and that's my baseline. I often go up to 12-15 terms.
Re:HyperTerm – JS/HTML/CSS Terminal by woah on Friday July 15, 2016 @10:09PM (#12104923)
Presumably, multiple tabs in this browser based terminal would only use one chrome process
Re:HyperTerm – JS/HTML/CSS Terminal by Sir_Cmpwn on Friday July 15, 2016 @11:29PM (#12105117)
Talking about seperate windows here.
Re:HyperTerm – JS/HTML/CSS Terminal by codezero on Friday July 15, 2016 @02:00PM (#12102740)
On my system, a long running Slack process uses about as much memory as a Finder window.
Re:HyperTerm – JS/HTML/CSS Terminal by pablovidal85 on Friday July 15, 2016 @07:23PM (#12104429)
On mac, slack uses macgap, not electron.
Re:HyperTerm – JS/HTML/CSS Terminal by joshmanders on Saturday July 16, 2016 @11:27AM (#12106650)
Was this a recent change? Because electron's homepage[0] still shows that Slack was built on it.

[0]: http://electron.atom.io/

Re:HyperTerm – JS/HTML/CSS Terminal by pablovidal85 on Saturday July 16, 2016 @04:40PM (#12107808)
On windows (and I guess on linux) they use electron.
Re:HyperTerm – JS/HTML/CSS Terminal by wtetzner on Friday July 15, 2016 @03:40PM (#12103320)
But what about power usage? Battery life is important.
Re:HyperTerm – JS/HTML/CSS Terminal by codezero on Friday July 15, 2016 @04:28PM (#12103615)
I can't say I've measured it quantitatively, but it doesn't appear to have a huge effect, but I also don't need to be untethered all day long.

When I check the battery status on my Mac, only Chrome is listed in the "Apps that use significant energy" list.

Re:HyperTerm – JS/HTML/CSS Terminal by beefman on Friday July 15, 2016 @01:42PM (#12102633)
How many copies of unix (partitions, vms, containers) do you have on your computer?
Re:HyperTerm – JS/HTML/CSS Terminal by danieldk on Friday July 15, 2016 @01:52PM (#12102693)
TinyCore Linux is 12 MB. A fully functional Unix(-like) system, including an X server.

So, for one Javascript-written terminal app, you can install a full Linux system with X and a window manager 10 times (Hyperterm.app is 122 MB).

Re:HyperTerm – JS/HTML/CSS Terminal by Sir_Cmpwn on Friday July 15, 2016 @01:50PM (#12102686)
One?
Re:HyperTerm – JS/HTML/CSS Terminal by malka on Friday July 15, 2016 @02:40PM (#12102969)
Same as java maybe ? Lot of bad apps that make you feel the engine underneath
Re:HyperTerm – JS/HTML/CSS Terminal by hugozap on Friday July 15, 2016 @02:21PM (#12102854)
you can always ignore those projects if they make you so tired.
Re:HyperTerm – JS/HTML/CSS Terminal by mej10 on Friday July 15, 2016 @01:04PM (#12102373)
I haven't even looked at "Black Screen", but what makes it a monstrosity? It is just a piece of open source software, after all.
Re:HyperTerm – JS/HTML/CSS Terminal by rosalinekarr on Friday July 15, 2016 @08:25PM (#12104627)
In my experience, it's very slow and clunky, but the real problem is that it attempts to impose a lot of styling and decoration _on top_ of the terminal.

For example, the command prompt isn't just a command prompt, it has this silly chevron decoration with autocomplete functionality. It can probably be turned off in the settings, but I find it to be a really annoying default. It just assumes I don't have my own prompt how I want it or my own autocorrect system.

I have to explicitly disable half the 'features' before I get anything actually useful to work with.