Live data from Hacker News

CoreUtils implemented in pure JavaScript

github.com

91–100 of 128 posts

Re: CoreUtils implemented in pure JavaScript

#91
post #66
post #55

Earlier quoted context omitted.

> They're not that bad (GNU coreutils is generally pretty good) and you usually remember the edge cases fairly quickly (eg `dd`). Sadly you get inconsistencies in all coding frameworks, whether it's semantic, function names in the core libraries or whatever. Generally this is all awful and low-level. Just see the UI interface difference between 'dd' and 'Copy File' on a Lisp Machine. The UI is worlds away. > UNIX she…

I suspect your argument is now more about personal preference than anything. So I'll just address a few specific points you've raise: > Generally this is all awful and low-level. Just see the UI interface difference between 'dd' and 'Copy File' on a Lisp Machine. The UI is worlds away. Well yeah, I did already example `dd` as an inconsistency. :) > You can do that on a Lisp Machine, too. With the difference that no p…

> I'm sure lisp does it better

Lisp does nothing. It is a programming language.

> Just that I believe Bash et al to have a lower barrier of entry than Lisp

I doubt that, given how horrible Bash as a language and as a shell is. There is no reason why there can't be more sane command systems and better shell languages.

See the zsh documentation on completion:

http://zsh.sourceforge.net/Guide/zshguide06.html

This is all totally over the head of the average user.

     _perforce_revisions() {
        local rline match mbegin mend pfx
        local -a rl

        pfx=${${(Q)PREFIX}%%\#*}
        compset -P '*\#'

        # Numerical revision numbers, possibly with text.
        if [[ -z $PREFIX || $PREFIX =  ]]; then
            # always allowed (same as none)
            rl=($rl 0)
            _call_program filelog p4 filelog \$pfx 2>/dev/null |
               while read rline; do
                if [[ $rline = (#b)'... #'()*\'(*)\' ]]; then
                    rl=($l "${match[1]}:${match[2]}")
                fi
            done
        fi
        # Non-numerical (special) revision names.
        if [[ -z $PREFIX || $PREFIX !=  ]]; then
            rl=($rl 'head:head revision' 'none:empty revision'
                    'have:current synced revision')
        fi
        _describe -t revisions 'revision' rl
      }
Tell me that this piece of code has a 'low barrier of entry' or even a 'lower barrier of entry'. It's just that a generation of experts has been self selected to find that usable.

> but I was never arguing that UNIX shells are better Lisp to begin with

I was not talking about Lisp. I was talking about software. One could write much better command shells in C than what Unix shells offers. I understand that certain people find Unix like shells attractive. From a general user interface perspective they are horrible.

Re: CoreUtils implemented in pure JavaScript

#92
post #48
post #42

Earlier quoted context omitted.

If you like PowerShell, try using jq in your Unix shell pipelines. Ingesting data into json is still a bit finicky, but once you know the patterns you need to use with cut and a csv-to-json tool things become much faster.

I do love jq :) Hadn't thought of chaining that with a csv-to-json workflow, that's a neat idea -- but if that's the easiest way out, that's clearly a symptom of the problem I'm describing, isn't it?

Quite possible. I will say that I'd much prefer structured text that I can massage to my liking over an actual object model. Having things print and read JSON streams is just as good as having cmdlets push and pull .net object, except that we can write our programs in languages that aren't .net-aware. And it makes it way easier for the system to interact with systems that don't speak interchange data format, including things like filesystems and websites.

One of the things I've been trying to figure out for a while is a way to build a trivial adapter for the csv-to-json | jq pipelines I've been building, something sufficiently easy to use that I could bake it into a |-equivalent extension to something like zsh.

Re: CoreUtils implemented in pure JavaScript

#93
post #30
post #7

Earlier quoted context omitted.

> UNIX shells suck. Javascript sucks. How could one implement a UNIX shell in Javascript and have it not suck? What do you mean by "UNIX shells suck"? I'm fairly sure most people would consider UNIX shells to be one of the bigger revolutions in computing.

Perhaps it's my own shortcoming, but for any given script I write, I find that, say, 20% of all my code is productive, and the remaining 80% is massaging the output of one tool into a shape that's compatible with the input of the next tool. Compare with the exprience of using Windows PowerShell where cmdlets return objects and you can grab precisely the fields you want with minimum ceremony. Things are better now wit…

Heh kids these days, I bet the next thing you're going to demand is a consistent configuration format that all aplications will use! (a man can dream)

Re: CoreUtils implemented in pure JavaScript

#94
post #88

Earlier quoted context omitted.

You already have a processor too, and something running directly on that is, in fact, more simple.

It's more simple from the point of view of the processor, I suppose, but that's not a useful metric for me.

Is your unit of simplicity really "I already have this installed"? Because then this hello world line I just wrote is more complex than your OS.

Re: CoreUtils implemented in pure JavaScript

#95
post #76

Earlier quoted context omitted.

Lots of vitriol because it's yet another "I took something that works and rewrote it to be slower, less functional, and JavaScript" Making computing worse, one fork at a time.

This is the attitude that drives people away from working on open source.

It's better to say nothing so people can be happy with what they've just done and continue to make the same mistakes in the future?

Re: CoreUtils implemented in pure JavaScript

#96

Earlier quoted context omitted.

This is the attitude that drives people away from working on open source.

It's better to say nothing so people can be happy with what they've just done and continue to make the same mistakes in the future?

So I guess no one should write a toy kernel again the future, because it won't be perfect? What kind of logic is that?

Re: CoreUtils implemented in pure JavaScript

#97

It's always mind blowing how when someone makes a neat project like this and the comments are nothing but complaining, vitriol, etc.

To me the problem with this project is more the puffed up description than anything else. Lots of "awesome" "wow" "woah" type self praise for their project, and a lot of "without the suck" "ugly DLLs" etc. for other solutions.

If it were described as just a simple humble Node.js shell without the puffery and unnecessary bash at Cygwin, I doubt you'd see the same vitriol.

(Personally, I could use a little less of this trend in computing for everything to be awesome and everyone to be rock star ninja guru superstars. For reasons like the responses here show.)

Re: CoreUtils implemented in pure JavaScript

#98

Earlier quoted context omitted.

It's more simple from the point of view of the processor, I suppose, but that's not a useful metric for me.

Is your unit of simplicity really "I already have this installed"? Because then this hello world line I just wrote is more complex than your OS.

From the point of view of the user, yes.

Re: CoreUtils implemented in pure JavaScript

#99

Earlier quoted context omitted.

It's more simple from the point of view of the processor, I suppose, but that's not a useful metric for me.

Is your unit of simplicity really "I already have this installed"? Because then this hello world line I just wrote is more complex than your OS.

Maybe simplicity isn't exactly what I'm talking about, but yes. In fact, I couldn't run your hello world without running my OS. So from a practical point of view, me running your hello world has a dependency on my OS. From that perspective, it's easier for me to run my OS than your hello world.

Re: CoreUtils implemented in pure JavaScript

#100

Earlier quoted context omitted.

node.js is not simple or even simpler

However, I already have it.

Yes, but - when you hit some bug or just need some specific combination of commands, there would be thousands posts on the web that explain how to do on unix that will work in Cygwin. Will they work in this environment?
Post reply on HN