librelist archives

« back to archive

Eclipse counterclockwise and trampoline

Eclipse counterclockwise and trampoline

From:
Laurent Petit
Date:
2012-11-20 @ 12:40
Hello,

Current status is developing general launcher for leiningen2 in Ccw.

If I don't implement trampoline, what will my users miss?

I'm asking because trampoline seems to be handled by the shell script that
I will make optional to use when lein will be called through CCW.

Thanks,

Laurent

Re: [leiningen] Eclipse counterclockwise and trampoline

From:
Phil Hagelberg
Date:
2012-11-20 @ 17:19
Laurent PETIT <laurent.petit@gmail.com> writes:

> Current status is developing general launcher for leiningen2 in Ccw. 
>
> If I don't implement trampoline, what will my users miss?

I believe trampoline should be considered an implementation detail of
the shell script. If you're launching from another context it just
doesn't make sense; you wouldn't want Eclipse to exit before launching
your project JVM. It's typically used in situations where you want to
save memory in production.

-Phil

Re: [leiningen] Eclipse counterclockwise and trampoline

From:
Laurent Petit
Date:
2012-11-20 @ 21:28
On Nov 20, 2012 6:22 PM, "Phil Hagelberg" <phil@hagelb.org> wrote:
>
> Laurent PETIT <laurent.petit@gmail.com> writes:
>
> > Current status is developing general launcher for leiningen2 in Ccw.
> >
> > If I don't implement trampoline, what will my users miss?
>
> I believe trampoline should be considered an implementation detail of
> the shell script. If you're launching from another context it just
> doesn't make sense; you wouldn't want Eclipse to exit before launching
> your project JVM. It's typically used in situations where you want to
> save memory in production.

Well, it's an implementation detail that the user is in control of, then ;-)

I'm working on the 'user triggers arbitrary lein2 commands from a
counterclockwise prompt', but that does not mean that CCW will use the
Eclipse  underlying JVM for this, its too risky. It's for  certain commands
for ccw's own need that sometimes the underlying JVM will be used for.

Still, if a user types 'trampoline cljsbuild rhino-repl' because this make
sense for her, I may have to rebind the trampoline task to the identity
operation ?
>
> -Phil

Re: [leiningen] Eclipse counterclockwise and trampoline

From:
Phil Hagelberg
Date:
2012-11-20 @ 22:12
Laurent PETIT <laurent.petit@gmail.com> writes:

> Still, if a user types 'trampoline cljsbuild rhino-repl' because this
> make sense for her, I may have to rebind the trampoline task to the
> identity operation ?

Yeah, this is probably the only thing that makes sense.

-Phil

Re: [leiningen] Eclipse counterclockwise and trampoline

From:
Laurent Petit
Date:
2012-11-20 @ 22:19
2012/11/20 Phil Hagelberg <phil@hagelb.org>

> Laurent PETIT <laurent.petit@gmail.com> writes:
>
> > Still, if a user types 'trampoline cljsbuild rhino-repl' because this
> > make sense for her, I may have to rebind the trampoline task to the
> > identity operation ?
>
> Yeah, this is probably the only thing that makes sense.
>

OK, thanks.


>
> -Phil
>

Re: [leiningen] Eclipse counterclockwise and trampoline

From:
Stuart Sierra
Date:
2012-11-20 @ 19:10
What about tasks that need to capture STDIN/STDOUT, e.g. the clojurescript
REPL? Last I saw that required trampoline.

S

Re: [leiningen] Eclipse counterclockwise and trampoline

From:
Phil Hagelberg
Date:
2012-11-20 @ 19:12
Stuart Sierra <mail@stuartsierra.com> writes:

> What about tasks that need to capture STDIN/STDOUT, e.g. the
> clojurescript REPL? Last I saw that required trampoline.

Actually I believe this is fixed in the master branch. But even so, if
you're launching from the context of Eclipse you're not going to get
stdin with or without trampoline unless Eclipse does something special
anyway.

-Phil

Re: [leiningen] Eclipse counterclockwise and trampoline

From:
Chas Emerick
Date:
2012-11-20 @ 21:15
On Nov 20, 2012, at 2:12 PM, Phil Hagelberg wrote:

> Stuart Sierra <mail@stuartsierra.com> writes:
> 
>> What about tasks that need to capture STDIN/STDOUT, e.g. the
>> clojurescript REPL? Last I saw that required trampoline.
> 
> Actually I believe this is fixed in the master branch. But even so, if
> you're launching from the context of Eclipse you're not going to get
> stdin with or without trampoline unless Eclipse does something special
> anyway.

The Eclipse console is a sad affair; any process that requires stdin in 
any significant way is going to end up being painful to work with.

The ClojureScript REPL is a special case insofar as, at least within the 
nREPL universe, all REPLs are remote.  It supports *in*, but each client 
must plumb that through to whatever makes sense locally; in this 
department, nREPL follows swank's lead, and CCW follows in SLIME's 
footsteps w.r.t. asking for input when it's demanded by some evaluation 
via a dialog.

Piggieback addresses the mismatched *in*/*out* expectations of nREPL and 
ClojureScript's REPL:

	https://github.com/cemerick/piggieback

As a nice side benefit, CLJS REPLs over Piggieback gain various nREPL 
features, like interrupts, multiple sessions, etc.  At some point, I hope 
to contribute much of Piggieback to CLJS, at least to eliminate its 
dependence on *in* and *out*.

- Chas

Re: [leiningen] Eclipse counterclockwise and trampoline

From:
Laurent Petit
Date:
2012-11-20 @ 22:18
2012/11/20 Chas Emerick <chas@cemerick.com>

> On Nov 20, 2012, at 2:12 PM, Phil Hagelberg wrote:
>
> > Stuart Sierra <mail@stuartsierra.com> writes:
> >
> >> What about tasks that need to capture STDIN/STDOUT, e.g. the
> >> clojurescript REPL? Last I saw that required trampoline.
> >
> > Actually I believe this is fixed in the master branch. But even so, if
> > you're launching from the context of Eclipse you're not going to get
> > stdin with or without trampoline unless Eclipse does something special
> > anyway.
>
> The Eclipse console is a sad affair; any process that requires stdin in
> any significant way is going to end up being painful to work with.
>

First of all, I totally agree that in the specific case of ClojureScript
REPL, nrepl+piggieback is the way to go with lein, from or not from CCW.

That said, in the general case of providing a generic launcher for Lein
commands from CCW, I do not share the point of view: the underlying
launched via Runtime.exec() will have stdin, stdout and stderr properly
wired to a fresh Console View in Eclipse, allowing the user to interact
with the process. Granted, it will not be a shell console, so I guess lots
of expected features will be missing, but as far as stding stdouting
stderring are concerned, this should work.


>
> The ClojureScript REPL is a special case insofar as, at least within the
> nREPL universe, all REPLs are remote.  It supports *in*, but each client
> must plumb that through to whatever makes sense locally; in this
> department, nREPL follows swank's lead, and CCW follows in SLIME's
> footsteps w.r.t. asking for input when it's demanded by some evaluation via
> a dialog.
>
> Piggieback addresses the mismatched *in*/*out* expectations of nREPL and
> ClojureScript's REPL:
>
>         https://github.com/cemerick/piggieback
>
> As a nice side benefit, CLJS REPLs over Piggieback gain various nREPL
> features, like interrupts, multiple sessions, etc.  At some point, I hope
> to contribute much of Piggieback to CLJS, at least to eliminate its
> dependence on *in* and *out*.
>
> - Chas
>

Re: [leiningen] Eclipse counterclockwise and trampoline

From:
Chas Emerick
Date:
2012-11-20 @ 22:33
On Nov 20, 2012, at 5:18 PM, Laurent PETIT wrote:

> The Eclipse console is a sad affair; any process that requires stdin in 
any significant way is going to end up being painful to work with.
> 
> First of all, I totally agree that in the specific case of ClojureScript
REPL, nrepl+piggieback is the way to go with lein, from or not from CCW.
> 
> That said, in the general case of providing a generic launcher for Lein 
commands from CCW, I do not share the point of view: the underlying 
launched via Runtime.exec() will have stdin, stdout and stderr properly 
wired to a fresh Console View in Eclipse, allowing the user to interact 
with the process. Granted, it will not be a shell console, so I guess lots
of expected features will be missing, but as far as stding stdouting 
stderring are concerned, this should work.

Right.  I wasn't meaning to say that the console isn't usable at all, just
that, for tasks that require significant interaction, switching to a shell
will likely be far more comfortable for most.  Thankfully, hardly any lein
tasks are more than trivially interactive, so I'm really looking forward 
to the results of your current work. :-)

- Chas

Re: [leiningen] Eclipse counterclockwise and trampoline

From:
Laurent Petit
Date:
2012-11-20 @ 22:40
2012/11/20 Chas Emerick <chas@cemerick.com>

> On Nov 20, 2012, at 5:18 PM, Laurent PETIT wrote:
>
> The Eclipse console is a sad affair; any process that requires stdin in
>> any significant way is going to end up being painful to work with.
>>
>
> First of all, I totally agree that in the specific case of ClojureScript
> REPL, nrepl+piggieback is the way to go with lein, from or not from CCW.
>
> That said, in the general case of providing a generic launcher for Lein
> commands from CCW, I do not share the point of view: the underlying
> launched via Runtime.exec() will have stdin, stdout and stderr properly
> wired to a fresh Console View in Eclipse, allowing the user to interact
> with the process. Granted, it will not be a shell console, so I guess lots
> of expected features will be missing, but as far as stding stdouting
> stderring are concerned, this should work.
>
>
> Right.  I wasn't meaning to say that the console isn't usable at all, just
> that, for tasks that require significan t interaction, switching to a shell
> will likely be far more comfortable for most.  Thankfully, hardly any lein
> tasks are more than trivially interactive, so I'm really looking forward to
> the results of your current work. :-)
>

Currently, everything's in small pieces on my laptop, trying to make sense
of all of this. Depending on how thursday's coming along, may have the
start of something to show ... Trying to find the balance between ease of
use and flexibility. I guess at first there will be no apparent associated
launch configuration (using the :private attribute one can use when
creating ILaunchConfigurations) and also not using the "Run as" menu but
just a specific contextual menu such as project > Leiningen > Run opening a
small prompt in the middle of the screen waiting for the user to input an
arbitrary command. And in the end a console will be started, etc.

But that's just a small portion of what I aim to accomplish,so "no fluff,
just stuff", I'll shut up now and go back to work :-)


>
> - Chas
>