You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@esme.apache.org by Vassil Dichev <vd...@apache.org> on 2009/04/30 08:49:05 UTC

ESME as a Scala console

>   - A guide to how to use ESME to learn Scala -- (@Vassil - do you have
>   ideas?)
>   - A few tips to try out on a local ESME installation to learn Scala.
>   "Hello World" experience with ESME.

Here's a cool idea: ESME, with its near real-time responsiveness, can
serve as a command-line. We can adapt it to react as a Scala console,
similar to what is done http://lotrepls.appspot.com/, but adapted to
the instant messaging interface of ESME.

Re: ESME as a Scala console

Posted by Vassil Dichev <vd...@gmail.com>.
> Now I understand. A Scala bot that uses ESME. Users send their scala code to
> bot, it answers the "question" and sends back the answer.

Exactly.

> Since LotREPLs is powered by Google App Engine, maybe it already has a
> REST-API that you could use

My idea is not to depend on external services. The bot could be
running inside the ESME instance as a plugin (until we have a plugin
manager, maybe just an actor started from Boot.scala). It already has
access to the Scala Interpreter, as it's probably loaded in the JVM.

This is of course insecure, but if an ESME instance configured like
this is deployed on GAE as a demo, the platform will provide enough
security.

Re: ESME as a Scala console

Posted by Richard Hirsch <hi...@gmail.com>.
Now I understand. A Scala bot that uses ESME. Users send their scala code to
bot, it answers the "question" and sends back the answer.

Since LotREPLs is powered by Google App Engine, maybe it already has a
REST-API that you could use

D.



On Thu, Apr 30, 2009 at 9:53 AM, Vassil Dichev <vd...@apache.org> wrote:

> > I looked at it but didn't quite understand it. Do you mean that we could
> > have a console-based interface to the REST-API?
>
> No, sorry. I meant that you send a Scala command as a normal message.
> The message is sent to a Scala interpreter, evaluated, and the result
> is sent back. In this way you can try out different Scala commands and
> learn Scala.
>
> For instance, I send a message:
>
>    println(List(1,2,3).filter(_ % 2 == 0))
>
> as a reply to, say, user "ScalaConsole". It evaluates the result and
> returns:
>
>    List(2)
>
> We could expand this and create a bot, which acts as an interface to
> the OS shell, or telnet to a Cisco router, etc., etc. But the point
> was to have a way to learn Scala *and* try the benefits of ESME. I
> think we can use the responsiveness of Comet messages to our advantage
> here.
>

Re: ESME as a Scala console

Posted by Vassil Dichev <vd...@apache.org>.
> I looked at it but didn't quite understand it. Do you mean that we could
> have a console-based interface to the REST-API?

No, sorry. I meant that you send a Scala command as a normal message.
The message is sent to a Scala interpreter, evaluated, and the result
is sent back. In this way you can try out different Scala commands and
learn Scala.

For instance, I send a message:

    println(List(1,2,3).filter(_ % 2 == 0))

as a reply to, say, user "ScalaConsole". It evaluates the result and returns:

    List(2)

We could expand this and create a bot, which acts as an interface to
the OS shell, or telnet to a Cisco router, etc., etc. But the point
was to have a way to learn Scala *and* try the benefits of ESME. I
think we can use the responsiveness of Comet messages to our advantage
here.

Re: ESME as a Scala console

Posted by Richard Hirsch <hi...@gmail.com>.
I looked at it but didn't quite understand it. Do you mean that we could
have a console-based interface to the REST-API?

D.

On Thu, Apr 30, 2009 at 8:49 AM, Vassil Dichev <vd...@apache.org> wrote:

> >   - A guide to how to use ESME to learn Scala -- (@Vassil - do you have
> >   ideas?)
> >   - A few tips to try out on a local ESME installation to learn Scala.
> >   "Hello World" experience with ESME.
>
> Here's a cool idea: ESME, with its near real-time responsiveness, can
> serve as a command-line. We can adapt it to react as a Scala console,
> similar to what is done http://lotrepls.appspot.com/, but adapted to
> the instant messaging interface of ESME.
>