Live data from Hacker News

Awkward – A Node.js-based terminal emulator

github.com

41–50 of 64 posts

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

#41
post #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.

You missed the point. The comment suggests the opposite of what you think it suggests. I guess I need to work on my communication skills.

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

#42
post #37

Earlier quoted context omitted.

It's irrelevant given TypeScript and ES2015+.

I'd say it's far from irrelevant. The fact that it uses whitespace instead of braces is a big plus for people used to that, and generally you write less coffeescript compared to TS or ES. Plus it has things like switch expressions, list comprehensions, chained comparisons, the safe nav operator, and a ton of other little features that either don't show up in TypeScript or ES. And it's very simple (no configuration ne…

Well, its declining popularity makes it irrelevant.

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

#43
post #5

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

I am gonna try PowerShell now. Never used it.

It's really nice, althought you have to like it's syntax.. Google some cheatsheets, will be helpful

Its Object Oriented approach it's what many try to emulate in mac/linux. This new hype of improving the CLIs is exciting!

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

#44

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.

> that seems to be some of the least intuitive code I have ever seen

There's nothing intuitive about programming. A pencil is intuitive. Learning how to program gives us advantages but it requires effort.

The real problem here is that you don't want to learn. You'll be repeating the same mistakes.

> What are the practical applications of knowing AWK over knowing JS?

It's fast, has a small memory footprint, and plays well with unix pipes.

> Besides the shell voodoo

It's not voodoo. It's a useful programming environment for getting work done.

> I just want to understand why learning a completely new set of grammars with a very limited domain would be worth the effort.

It's a specialized language for extracting data from delimited byte-streams. It's not a big language and not a lot of effort is required to benefit from it.

Where the domain is well-understood it's great to have a domain-specific language with short-hand syntax that abstracts away the unimportant details. I don't have to define functions or call any methods. I just get some variables because I know awk just takes a pattern and splits it on a separator... it saves me a bunch of work. Once I understand the language I can manipulate field-delimited byte-streams with little ceremony.

The bonus is that awk plays well with the *nix environment. Anonymous and named pipes, etc are really useful.

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

#45

Earlier quoted context omitted.

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.

That's incredibly dismissive. AWK isn't perfect (nothing is). So that means that there are still improvements that can be made to it. One of the improvements to AWK (or something awk-like) would be to make it have a more familiar syntax to those who don't already know awk. I'll admit, the only thing I use awk for currently is to pull out columns of the output to pass on to the next tool. I know it can do more, but I…

Just gonna leave this here. https://github.com/synacor/dtk

Its filter functions are Perl, but you could do something similar with JS if you were a masochist. No need to build a new shell, though.

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

#46
post #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 feedb…

I'd suggest reading http://www.catb.org/esr/writings/taoup/html/ to better understand why UNIX is the way that it is.

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

#47
post #27

Earlier quoted context omitted.

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 feedb…

I'd suggest reading http://www.catb.org/esr/writings/taoup/html/ to better understand why UNIX is the way that it is.

I've read it before.

So I know that:

> Write programs to handle text streams, because that is a universal interface

But I also think that:

> To build it out of simple parts connected by well-defined interfaces.

Many text representations are vastly different, and neither simple or well-defined.

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

#48
post #47

Earlier quoted context omitted.

I'd suggest reading http://www.catb.org/esr/writings/taoup/html/ to better understand why UNIX is the way that it is.

I've read it before. So I know that: > Write programs to handle text streams, because that is a universal interface But I also think that: > To build it out of simple parts connected by well-defined interfaces. Many text representations are vastly different, and neither simple or well-defined.

The interface is not necessarily the content of the message conveyed by the interface. Lines of text std(in|out) is a well-defined interface. Some programs may go further and specify the format of messages passed on that interface. https://github.com/synacor/dtk is one such system that specifies (for most of its commands) tab-delimited records as the message format. It interfaces well with other elements of the UNIX ecosystem, however, because its interface is simply lines of text on std(in|out).

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

#49

Earlier quoted context omitted.

Ah, put the whole command in parens! It might make sense to put a note in the README about that, unless it's already there and I missed it somehow...

I am sorry, it slipped from my mind. I will add it now.

Just a note, _iostreamer_, you can use `command.parse` in Vorpal to pre-append parens to every command before it's evaluated (your project is written in Vorpal).

BTW, love this idea.

- the Vorpal guy

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

#50
Normally I have a severe allergic reaction to anyone trying to do anything serious with Javascript, but this looks like a legitimately good idea and a decent innovation on how shells work.

I'm beginning to think that it isn't Javascript that I hate, it's the way people use it (i.e. to build bloated, slow, terrible webapps). But this is actually pretty cool. JS is shockingly decent at text processing so repurposing it as a shell language kinda makes sense.

Post reply on HN