← Back to team overview

opencog-dev team mailing list archive

Re: OpenCog Shell

 

2008/5/22 Joel Pitt <joel.pitt@xxxxxxxxx>:
>
> Hi all,
>
> While in Maryland to discuss PLN and attention allocation with Ben in
> OpenCog [1], we discussed the idea of a OpenCog shell.

I've been using "telnet localhost 17001" and it works
fine ...well, I miss not having the up-arrow key work to
get to previous commands, but I think I could get that
to work in a few hours.

You can use the scripting language of your choice
if you want to run scripts .. e.g.
cat somefile-with-commands | telnet localhost 17001
to issue a bunch of commands.  With perl, you can be
a lot more clever ...

>  However, this implementation is currently difficult for
> introducing new commands.

Yeah, but its not that hard, not really, and with a bit of
refactoring, it could be very easy.

...  how many new commands do you really need?
You need commands to start, stop mind-agents,
alter the (non-existent) scheduling ...

.. it would be nice to examine sub-graphs, but it
would be even nicer to examine these graphically,
and not by shell...

> One idea, brought up in conjunction by
> myself and Moshe, was to use Swig [2] bindings to create a direct
> foreign library interface.

Careful ...
You loose what little multi-threading there is ... I really
like being able to issue commands while the thing
is running.

I've used swig in the past, but have been generally
unsatisfied with results. It sounds good in theory, and
works great for hello-world tests, but fails to  bind
correctly to language features -- its not transparent,
its very much in-your-face.  I remember spending
many, many days writing swig binding code trying to
get a C-language linked list converted to an ordinary
perl array, and back. I eventually gave up when it became
clear that swig simply didn't have enough of its guts
implemented to make stuff like this transparent.

> Thoughts?

Myself, I'm partial to scheme+guile.  Quite unlike swig,
the interface is very, very transparent.  ...although you do
have to write glue code for every function you want to
export, it beats the pants off of trying to diddle swig-internal
crap to accomplish the same thing --  swig is not transparent.

On the other hand, I was expecting some sort of Combo
thing from moshe ...

--linas



References