Live data from Hacker News

Betty – English-like interface for the command line

github.com

21–30 of 84 posts

Re: Betty – English-like interface for the command line

#22
post #13
post #2

I like this idea a lot. But why on earth it is written in ruby?! - I know the answer and it is "ok". But it is probably the reason why it won't never gain huge momentum, prove me wrong :)

I knew my reply will be heavily hammered by rubyists. There is nothing wrong in the language but I think that shell tools should be written in C or in some other low level language without complex dependencies over ruby or java or python etc. or any other non-default installation stuff

You're not only being down-voted by Rubyists. For something that deals heavily with string manipulation and isn't speed-sensitive, C is most definitely not the best language to use.

Re: Betty – English-like interface for the command line

#23
post #5

Earlier quoted context omitted.

From what I gather the developer is allowing users to use natural language so they won't have to remember arcane commands. I have looked up how to do _____ multiple times because I don't remember the command or syntax. Creating an alias is nice but then I still have to remember my own alias or look it up. This tool makes it so you don't have to remember anything. Assuming it works well it will yield a great user-expe…

It's some pretty basic regex, so you're going to have to remember the correct phrasing anyway,

For now. The idea seems to make it English-like so that could simply be a matter of time.

Re: Betty – English-like interface for the command line

#26

A cute tool, but seems incredibly limited. Why would I use any of these commands more than once if I can just alias them? While some of them might be useful I really just don't see myself using a tool like this.

And just for the kicks: function genie(){ query=`printf "%s+" $@` echo $query result=`curl -s " https://weannie.pannous.com/api?out=simple&input=$query"` echo $result say $result 2>/dev/null } alias hey=genie alias how="genie how" alias what="genie what" alias when="genie when" me:~$ what is the root of pi It is approximately 1.7725 me:~$ how old is obama Barack Obama is 52 years old

A PR implementing that for Betty: https://github.com/pickhardt/betty/pull/4

Re: Betty – English-like interface for the command line

#27
This is an interesting idea, but I'm not sure it has much use outside of proof of concept. Most people don't need to use the command line, and those who do don't find it that difficult.

In fact, for the most part the command line is very usable once you've learned the philosophy behind it. I remember reading something about the BSD flavors of UNIX along the lines of "BSD is very user friendly, just not for inexperienced users". I see the command line as being similar. It's very powerful when you understand it, but a bit opaque when you're learning it. Fortunately, you can learn the basics in an afternoon.

Now one useful aspect of this is that it makes commands that would require a long command line much simpler than they would otherwise be. However, I find that whenever I have a long command line that I use repeatedly I just write an alias for it and add it to my .zsh-aliases file. I like this solution better because it is more customizable for my workflow.

Re: Betty – English-like interface for the command line

#28
post #19
post #18

Earlier quoted context omitted.

That would be cool indeed and I hope my comment didn't sound too negative. And you should definitely take a look at Inform (and similar), it's amazing what they can do. I think some interpreters are open source (edit: it seems it's not, I remembered incorrectly).

Ironically, with version 7, Inform itself switched to natural language syntax. The following is valid Inform 7 source code: `The iron-barred gate is a door. It is north of the Drawbridge and south of the Entrance Hall. It is closed and openable. Before entering the castle, try entering the gate instead. Before going inside in the Drawbridge, try going north instead. Understand "door" as the gate.` However, what makes…

Unfortunately, as I understand it, while the "old" v6 toolset is open, the "in" tool that takes "regular" text and turns it into v6 "code" is gratis, but not open sourced:

https://groups.google.com/forum/#!topic/rec.arts.int-fiction...

Some more on how inform7 differs from more traditional interactive fiction systems:

http://www.onlamp.com/pub/a/onlamp/2006/06/08/inside-inform-...

As for this tool: I like it. I like the idea that it's simple, and that the author didn't let details like it being difficult to do "well" or "better" stand in his way. I've thought along the same lines many times, not so much "how did I do _ (solution often involves awk, sort, uniq et al) -- I'm too familiar with the command line for that, but rather: Jeez, you've got a smart phone. The one guaranteed interface that works is audio in/out. How hard could it be to deploy solid limited domain voice control coupled with a dead simple state-machine for doing stuff like "next song", "stop", "play", "accept call".

I wonder if these projects (there must have been projects, right, ever since the first uptake of mp3s) get the first part working, then some moron suggests that the user will expect to be able to do "play song such-and-such by such-and-such" -- and then it's no longer (strictly) limited domain, and that doesn't work, so the scrap the whole thing.

[edit: Some more on "newstyle" inform vs traditional IF:] "A Comparison of TADS 3 and Inform 7" http://brasslantern.org/writers/iftheory/tads3andi7.html

Re: Betty – English-like interface for the command line

#29

This is an interesting idea, but I'm not sure it has much use outside of proof of concept. Most people don't need to use the command line, and those who do don't find it that difficult. In fact, for the most part the command line is very usable once you've learned the philosophy behind it. I remember reading something about the BSD flavors of UNIX along the lines of "BSD is very user friendly, just not for inexperien…

Well, an argument could be made for having the alias-file be something like:

    alias ll="ls -l"
      doc = """List files -- long list format"""
      natural_match = "list all files long size date owner group"
And have:

    "list all files by size"
match this (as betty does now: running ll "docstring". Then, when you realize that "list all files by size", really is "ls --sort=size", possibly with "-l", you could just add another definition:

    alias lss="ls -l --sort=size"
      doc = """List files -- sorted by size, long list format"""
      natural_match = "list all files sort by size long format"
      natural_exact_match "list all files by size"
And now have:

    "list all files by size"
Score higher for lss than for ll (the scoring function is assumed to be some combination of tag count, proximit match, substring match etc, a so-called hard problem, but only needs to match over defined aliases -- and trying hard to first match the "exact_match" part...).

Of course, it should all be paired by a define-command or something that autmatically saves these monstrosties to a file or other db. So that you could do:

     # Lots of head scratching and experimentation, until:
     nmcli dev wifi list |sort -k8 -n # list wifi access points by
                                      # signal strength

     # define prev as "list wifi access points by signal strength"
     > displays commmand and prompt for tags etc, then on "y" at y/n
       prompt saves definition to "alias" file.

Come to think of it, it's a little like mandating/recommending users to document their aliases, and to have the shell automatically suggest from the docstrings. I guess zsh actually does a bit of this already (I'm still sticking with bash, it's gotten good enough for me over the years, and I'm always terrified by something, that if it isn't posix/ksh also isn't bash -- as that just makes scripts brittle...).

Re: Betty – English-like interface for the command line

#30

A cute tool, but seems incredibly limited. Why would I use any of these commands more than once if I can just alias them? While some of them might be useful I really just don't see myself using a tool like this.

The idea is awesome though.
Post reply on HN