Live data from Hacker News

Awkward – A Node.js-based terminal emulator

github.com

21–30 of 64 posts

Re: Awkward – A Node.js-based terminal emulator

#21
The following comment could apply to hundreds of similar submissions to HN in recent years.

Many people -- many of them young people I suspect -- have invested a lot of time learning Javascript. It has become a very popular language.

But it remains to be seen whether Javascript will be as long lasting as the UNIX shell and standard utilties. Historically speaking, computer languages have been known to fall into and out of popular usage.

For people who invested a lot of time learning the shell and ubiquitous utilties such as AWK, it appears the investment has paid off. I'm not too worried about the terminal disappearing any time soon.

How long until the next submission that aims to abtract away the need to learn how to use a UNIX terminal -- directly.

There are probably hundreds more on Github alone. What if we conslidated them all in one place: 1001 attempts to abstract away the need to learn UNIX.

By no means am I suggesting these attempts have not been successful.

What I'm suggesting is that the need for them will not abate. It could be that UNIX terminals, and programs like AWK, are not just a fad.

Re: Awkward – A Node.js-based terminal emulator

#22
post #5

Like. But PowerShell still rules. Wish it was oss and x-plat

Microsoft seems to be working on porting PowerShell to Linux already [0] and there's a partial port using Mono [1]!

[0]: https://windowsserver.uservoice.com/forums/301869-powershell...

[1]: https://pash-project.github.io/

Re: Awkward – A Node.js-based terminal emulator

#23

Uh... ps | awk 'NR>1{ print $1, $4}' I'll give that the syntax of these shell programs take some work to understand but they're hard to beat for the purpose they serve. If you're parsing plenty of JSON these days I find 'jq' indispensable. It's basically awk/sed for JSON. I would just be sure to study those programs as they took quite a bit of effort to make them fast. And there are plenty of alternatives with extend…

I'm sorry but that seems to be some of the least intuitive code I have ever seen. What are the practical applications of knowing AWK over knowing JS? (Besides the shell voodoo). I'm not trying to start a language war, I just want to understand why learning a completely new set of grammars with a very limited domain would be worth the effort.

Well, not relying on npm would be one practical advantage of AWK. Left-pad types of fiascos and all that.

Re: Awkward – A Node.js-based terminal emulator

#25
post #21

The following comment could apply to hundreds of similar submissions to HN in recent years. Many people -- many of them young people I suspect -- have invested a lot of time learning Javascript. It has become a very popular language. But it remains to be seen whether Javascript will be as long lasting as the UNIX shell and standard utilties. Historically speaking, computer languages have been known to fall into and o…

They're going to continue to pop up, just like JavaScript frameworks will. Because they're not popping up due to any necessity, but because someone (1) learned JavaScript, (2) learned some shell commands, (3) had the epiphany that they could abstract shell commands away using JavaScript, and (4) isn't aware of the previous thousand attempts by others to do the same thing.

Re: Awkward – A Node.js-based terminal emulator

#27
post #21

The following comment could apply to hundreds of similar submissions to HN in recent years. Many people -- many of them young people I suspect -- have invested a lot of time learning Javascript. It has become a very popular language. But it remains to be seen whether Javascript will be as long lasting as the UNIX shell and standard utilties. Historically speaking, computer languages have been known to fall into and o…

Perhaps there are features from other programming languages that should exist in shell programming?

For example, I've always felt that the fact that almost everything in shell programming is a gigantic string is really bad. It would be much nicer if all commands had type signatures, and therefore piping commands into each other could throw type errors if it does not make sense.

This would also allow much better feedback when stringing together commands, since the shell IDE would be able to recommend commands that act upon a particular type. For example, if a command produces output that could be considered to be N > 1 lines long then `wc -l` would be available, however if this isn't the case it does not make much sense for it to be recommend to the user.

Re: Awkward – A Node.js-based terminal emulator

#28
post #21

The following comment could apply to hundreds of similar submissions to HN in recent years. Many people -- many of them young people I suspect -- have invested a lot of time learning Javascript. It has become a very popular language. But it remains to be seen whether Javascript will be as long lasting as the UNIX shell and standard utilties. Historically speaking, computer languages have been known to fall into and o…

Well, I think, trying to abstract something away does not mean it's a fad, but totally the opposite: It means it's something people think they'll have to deal with a lot, but for whatever reason find it too much of a burden to deal with it directly.

It's like the ORMs. None of them mean SQL is a fad, it's just that some people seem to dislike SQL in a programming context.

Re: Awkward – A Node.js-based terminal emulator

#30

Hey, This is very cool. It does remind me of powershell in it's aims & inspiration. But agree with nailer that using json (or javascript data structures) would hopefully end up with a better, more cohesive shell in awkward. I no longer use Powershell (I got sick of the microsoft ecosystem) I'm not sure what format Powershell uses to pipe structured data around, but it seemed to be some kind of ad-hoc 'whatever-they-c…

So Ive actually been looking through the source for awkward, and it led me down the rabbit hole to shelljs, and cash.

shelljs actually reimpliments alot of shell commands in javascript, eventually mutating the output of the functions into flat strings here: https://github.com/shelljs/shelljs/blob/master/src/common.js...

The point being that the outputs of each of these functions is available (technically, it may require refactoring to get at the output pre-stringified) without having to parse formatted text.

Alot of work has been done here.

Post reply on HN