Hacker News new | ask | show | jobs
by kerkeslager 3953 days ago
Just from the perspective of mapping sentence meanings to bash commands, that's a difficult thing to do. But going beyond that, I think there are issues having to do with the ambiguity of language that just aren't solvable, period.

Take your example: "Show me all my files, including my hidden ones". That, to me, should show all the files on the entire system where I am the owner. Even as someone who ostensibly knows some bash, you missed that you dropped some pieces of data which are relevant in bash terms. "my" indicates ownership, and nowhere in your sentence did you say to limit the function to the current directory. If you're making that mistake as an experienced user, what hope does a beginner have?

`ls -a` actually encodes a fairly complex query, which only becomes apparent when you attempt to really nail down what it does in a natural language. To produce `ls -a`, you would really have to type something like "List the names of all the files, folders, and symbolic links in the current directory that are visible to the current user." You could, of course, start making assumptions about certain parts of this, similar to how `ls` does, but then you get into users guessing which part of the sentences they can elide (why wouldn't we assume that "List the names of the files, folders, and symbolic links in the current directory" wouldn't show us all the files, folders, and symbolic links?). At that point, the user must learn the idiosyncrasies of which exact sentence they have to type in to get what they want: i.e. when they have to say "all", when saying "my" matters instead of saying "the", etc. At that point the natural language stuff is no longer a learning tool, it's a separate, very complicated thing for the student to learn in addition to what they are trying to learn.

As another example of this: if you're willing to accept some ambiguity, why did you choose `ls -a` instead of `find .`? Recognizing that `ls -a` and `find .` do very different things.

To summarize: I don't think it's a bad idea, just an impossible one. :)

1 comments

I think there are issues having to do with the ambiguity of language that just aren't solvable, period.

This, absolutely. Once you've used a programming language enough, you'll find that natural languages are disturbingly ambiguous; it only works (most of the time, at least) for communicating with other humans because of implied context.