You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Raymond Auge <ra...@liferay.com> on 2014/02/06 03:20:43 UTC

groovy REPL shell for gogo

Has anyone seen such a beast?

-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect
*Liferay, Inc.* <http://www.liferay.com> (@Liferay)

Re: groovy REPL shell for gogo

Posted by Raymond Auge <ra...@liferay.com>.
On Thu, Feb 6, 2014 at 7:31 AM, Chetan Mehrotra
<ch...@gmail.com>wrote:

> FWIW you can execute arbitrary code (groovy/ruby etc) within OSGi
> context using Felix Script Console [1]
>
> Chetan Mehrotra
> [1]
> http://felix.apache.org/documentation/subprojects/apache-felix-script-console-plugin.html
>
>
Yeah, there's that, and we also have our own UI scripting console.

However, it's just not the same level of utility as a real shell.



>
> On Thu, Feb 6, 2014 at 4:21 PM, Felix Meschberger <fm...@adobe.com>
> wrote:
> > Hi
> >
> > Am 06.02.2014 um 03:20 schrieb Raymond Auge <ra...@liferay.com>:
> >
> >> Has anyone seen such a beast?
> >
> > IIUIC this is a shell which is able to execute Java code as if it would
> be part of a bundle, right ?
>

>
> > This sounds terrficly interesting and no, I don't know of such a biest.
> >
> > But I would think that something could easily be implemented based on
> BeanShell ?
> >
> > Maybe along these lines:
> >
> >   * Start session -- installs and starts a pseudo bundle providing the
> context for execution
> >   * execute code in the context of the session bundle
> >   * End session -- uninstalls the pseudo bundle for cleanup
>


I was just thinking a command which starts a persistent subshell from the
gogo cli.

However, yes I suppose it would execute from within the bundle context of
the command's own bundle. You could allow that bundle to have access to as
much or as little as you like. It would be simple to allow it to get
everything with dynamic package imports.

I realize the gogo shell already has a pseudo Lisp like live scripting
ability, but it's very alien to work with. Since groovy and gradle are
becoming quite popular I thought it would solve some of my prototyping slow
downs if I could simply do lots of work from the command line. One could
even come up with a nifty DSL for working with the bundles & services.


>
> > Of course, this allows tons of nasty things to be done like starting
> threads etc. but testing and development, I could imagine it would be
> wonderful
>

Yeah, live scripting is always dangerous...

But don't they call that "Continuous Deployment" though these days? ;)


> >
> > WDYT ?
> >
> > Regards
> > Felix
>

I think I've peaked my own interest enough to want to at least try it. :)
Maybe over the weekend I'll try a POC.

Sincerely,
- Ray


> >
> >>
> >> --
> >> *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
> >> (@rotty3000)
> >> Senior Software Architect
> >> *Liferay, Inc.* <http://www.liferay.com> (@Liferay)
> >
>



-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect
*Liferay, Inc.* <http://www.liferay.com> (@Liferay)

Re: groovy REPL shell for gogo

Posted by Chetan Mehrotra <ch...@gmail.com>.
FWIW you can execute arbitrary code (groovy/ruby etc) within OSGi
context using Felix Script Console [1]

Chetan Mehrotra
[1] http://felix.apache.org/documentation/subprojects/apache-felix-script-console-plugin.html


On Thu, Feb 6, 2014 at 4:21 PM, Felix Meschberger <fm...@adobe.com> wrote:
> Hi
>
> Am 06.02.2014 um 03:20 schrieb Raymond Auge <ra...@liferay.com>:
>
>> Has anyone seen such a beast?
>
> IIUIC this is a shell which is able to execute Java code as if it would be part of a bundle, right ?
>
> This sounds terrficly interesting and no, I don't know of such a biest.
>
> But I would think that something could easily be implemented based on BeanShell ?
>
> Maybe along these lines:
>
>   * Start session -- installs and starts a pseudo bundle providing the context for execution
>   * execute code in the context of the session bundle
>   * End session -- uninstalls the pseudo bundle for cleanup
>
> Of course, this allows tons of nasty things to be done like starting threads etc. but testing and development, I could imagine it would be wonderful
>
> WDYT ?
>
> Regards
> Felix
>
>>
>> --
>> *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
>> (@rotty3000)
>> Senior Software Architect
>> *Liferay, Inc.* <http://www.liferay.com> (@Liferay)
>

Re: groovy REPL shell for gogo

Posted by Felix Meschberger <fm...@adobe.com>.
Hi

Am 06.02.2014 um 03:20 schrieb Raymond Auge <ra...@liferay.com>:

> Has anyone seen such a beast?

IIUIC this is a shell which is able to execute Java code as if it would be part of a bundle, right ?

This sounds terrficly interesting and no, I don't know of such a biest.

But I would think that something could easily be implemented based on BeanShell ?

Maybe along these lines:

  * Start session — installs and starts a pseudo bundle providing the context for execution
  * execute code in the context of the session bundle
  * End session — uninstalls the pseudo bundle for cleanup

Of course, this allows tons of nasty things to be done like starting threads etc. but testing and development, I could imagine it would be wonderful

WDYT ?

Regards
Felix

> 
> -- 
> *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
> (@rotty3000)
> Senior Software Architect
> *Liferay, Inc.* <http://www.liferay.com> (@Liferay)