ANN: A more fully-featured lein-vimclojure

224 views
Skip to first unread message

Daniel Solano Gómez

unread,
Apr 14, 2012, 9:20:12 AM4/14/12
to vimcl...@googlegroups.com, clo...@googlegroups.com
Hello,

I am happy to let you know I have published a new Leiningen plug-in for
VimClojure support.

I know there are already a number of VimClojure plug-ins out there, some
of them called lein-nailgun and others called lein-vimclojure. However,
most of them tend to be fairly minimal. In particular, most of them
lacked two key features:

1. Support for both Leiningen 1.x and Leiningen 2.x projects, and
2. The ability to run a standalone REPL in the same process as the
server.

I hope that this is will be useful for other VimClojure users. It's
available from Clojars as [com.sattvik/lein-vimclojure "0.9.0"]. Please
check out the README from GitHub for more detailed instructions on
configuration options at <https://github.com/sattvik/lein-vimclojure>.

Sincerely,

Daniel

signature.asc

Jim - FooBar();

unread,
Apr 14, 2012, 11:39:24 AM4/14/12
to clo...@googlegroups.com
good stuff...can i ask something completely irrelevant? is there any
chance the clojure repl for android will ever get support for loading
external libraries? also i run a tiny genetic algorithm on it only
showed all the output at the end of the simulation rather than going one
step at a time. is this expected?
thanks!

Jim

Evan Mezeske

unread,
Apr 14, 2012, 4:10:40 PM4/14/12
to clo...@googlegroups.com, vimcl...@googlegroups.com
Thank you!  In particular, the Leiningen 1/2 support is a huge win.  I'm really glad someone decided to tackle this!

I feel I should point out, though, that the name of the plugin is unfortunate.  There are already several plugins named "lein-vimclojure", so that when I google that term, the top couple of results are other plugins.  Picking the right lein-vimclojure plugin is *already* a PITA, because searching e.g. clojars.org for "vimclojure" returns like 20 results, and I can never remember which user's lein-vimclojure is the one I like.

Also, using the name "lein-vimclojure" is going to make it more difficult for me to recommend your awesome looking plugin to a friend.  I can't just tell them to google lein-vimclojure; I'll have to provide a bunch of context, and even then it will still be confusing.

-Evan

Evan Mezeske

unread,
Apr 14, 2012, 4:23:08 PM4/14/12
to clo...@googlegroups.com, vimcl...@googlegroups.com
I just thought of an additional disadvantage to overloading the lein-vimclojure name, which is that searching for troubleshooting purposes will potentially return misleading results.  E.g., I might search for "lein-vimclojure throws error", and click through to the first couple of results.  If I'm not very careful to notice that I'm reading about org.clojars.autre's version instead of com.sattvik's version, I'm liable to be very confused.  Even worse, if the result just refers to the plugin as lein-vimclojure without the group ID, I'm totally hosed.

Daniel Solano Gómez

unread,
Apr 15, 2012, 12:07:39 AM4/15/12
to clo...@googlegroups.com, vimcl...@googlegroups.com
Hello,

Thanks for your thoughts. After considering your points, I've decided
to rename the plug-in 'lein-tarsier', after the animal that appears on
the cover of 'Learning the vi and Vim Editors'.

As a result, I have bumped the revision number and created a new GitHub
repository. You can now get it using [lein-tarsier "0.9.1"] and the
repository is at <https://github.com/sattvik/lein-tarsier>.

Sincerely,

Daniel

> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

signature.asc

Daniel Solano Gómez

unread,
Apr 15, 2012, 12:20:13 AM4/15/12
to clo...@googlegroups.com
On Sat Apr 14 16:39 2012, Jim - FooBar(); wrote:
> good stuff...can i ask something completely irrelevant? is there any
> chance the clojure repl for android will ever get support for loading
> external libraries?

Yes, there is. I have not forgotten about the REPL, and there are many
updates that I would like to apply to it. For example, in addition to
loading scripts, there is converting the core of the REPL to an Android
service (so it won't get killed off), and perhaps saving the output of
the REPL session.

The main problem for me, unfortunately, is a lack of time. I have way
too many projects going on at the moment.

In the meantime, I have written about a way to load arbitrary scripts
into the REPL, but that's not quite the same thng as being able to
support libraries. If you haven't seen it, it's available at
<http://www.deepbluelambda.org/programs/clojure-repl/clojure-repl-tip--loading-scripts>.

> also i run a tiny genetic algorithm on it only showed all the output
> at the end of the simulation rather than going one step at a time. is
> this expected?

I think so. The processing all occurs in a background thread and the
output from the REPL is dumped into a string. It's a lot trickier to
show output as it is generated, as that would require not just getting
the result of the input, but also coordinating what output has been
produced and what has been consumed.

Sincerely,

Daniel

signature.asc

Evan Mezeske

unread,
Apr 15, 2012, 5:44:26 AM4/15/12
to clo...@googlegroups.com, vimcl...@googlegroups.com
On Saturday, April 14, 2012 9:07:39 PM UTC-7, Daniel Solano Gómez wrote:

Thanks for your thoughts.  After considering your points, I've decided
to rename the plug-in 'lein-tarsier', after the animal that appears on
the cover of 'Learning the vi and Vim Editors'.

Awesome choice.  A relevant, memorable name.  I see that you already switched to using lein-tarsier as the group ID as well, which makes it nice and easy to find the canonical version of the plugin.  (It always irked me that I never quite knew if I was using the "main" version of vimclojure.)

Thanks for putting the work into this plugin.  It makes me, as a Vim user, feel a little bit less left out in the cold... :)

Rostislav Svoboda

unread,
Apr 16, 2012, 6:21:18 PM4/16/12
to clo...@googlegroups.com
I just quickly tried out the lein-tarsier and I'm getting:

$ lein vimclojure
Starting VimClojure server on 127.0.0.1, port 2113
Happy hacking!

(now I open http://127.0.0.1:2113 in my browser)

java.lang.OutOfMemoryError: Java heap space
at vimclojure.nailgun.NGSession.run(NGSession.java:199)
java.io.EOFException
at java.io.DataInputStream.readFully(DataInputStream.java:197)
at java.io.DataInputStream.readFully(DataInputStream.java:169)
at vimclojure.nailgun.NGSession.run(NGSession.java:195)

Any idea what am I doing wrong? I use Leiningen 1.7.1

Bost

Rostislav Svoboda

unread,
Apr 16, 2012, 6:35:35 PM4/16/12
to clo...@googlegroups.com
FYI setting :jvm-opts ["-Xmx2672m"] in the project.clj produces the
same error and I can't set more than 2672 MB otherwise JVM complains
about "Error: Could not create the Java Virtual Machine."

Bost

Daniel Solano Gómez

unread,
Apr 16, 2012, 6:54:24 PM4/16/12
to clo...@googlegroups.com

Well, the VimClojure server is not a web server, and doesn't speak HTTP.
Instead, it uses the 'Nailgun' protocol. The general use case for it is
in conjuction with the VimClojure Vim plug-in
<http://www.vim.org/scripts/script.php?script_id=2501>. Using the two
together allows Vim to offer some nice features for Clojure editing,
such as completion ("intellisense"), docstring lookup, etc.

I hope this helps.

Sincerely,

Daniel

signature.asc
Reply all
Reply to author
Forward
0 new messages