A newbie's summary - what worked, what didn't

201 views
Skip to first unread message

ultranewb

unread,
Mar 26, 2011, 1:24:10 PM3/26/11
to Clojure
NetBeans w/ Enclosure -
Could get a REPL, couldn't figure out how to do anything else. Result
- uninstalled.

IntelliJ w/ La Clojure -
Could get a REPL, couldn't figure out how to do anything else. In
particular, I followed some specific instructions from somewhere
(can't remember where) for how to set up a project, edit a source file
(hello world or whatever), and "run" that source file. All I got was
some kind of error. Result - uninstalled.

Configuring already-owned version of Emacs -
Followed varying instructions from various websites and how-to's -
mostly using elpa to download this and that. Used elpa, but could
never successfully get anything to work afterwards. Result - kept the
install for other projects I am using Emacs for.

Clojure Box -
Could get a REPL, couldn't figure out how to do anything else (i.e.
Leinegen blah blah). Result - kept the install, as this was the 2nd
most promising solution tried thus far.

ClojureW -
So far, this is the only thing that "just works" for me. Just
download, add the path to the bin directory, DONE. Can get a REPL,
but more importantly, can easily "run" a source file by doing "clj
sourcefile." The only thing that didn't work was the jline thing
(tried clj -jl per the instructions, and also clj -jline just for the
heck of it, both fail).

ClojureW UPDATE: Out of the blue, tried clj jline and that seemed to
work as far as running this jline thing. In other words, it didn't
give an error, and when I hit the up arrow, it shows historical
commands. To run a file like this (although in hindsight, I don't
know what that gives you), do: clj cljfile.clj jline

I guess the optimum solution I see for myself at this point is getting
Clojure Box to talk to ClojureW (i.e. editing a source file with
Clojure Box, then "running" that source inside some Emacs window by
running clj). I'm guessing this would be trivial for the Emacs
experts out there, but if someone wants to point me to a quick
resource on it, I'll try it.

For the time being, my personal suggestion to any newbs coming along
is to try ClojureW:

https://bitbucket.org/kasim/clojurew

Perhaps the link should be posted more prominently somewhere, if it
isn't already? A further suggestion - perhaps Clojure Box could be
rigged to use ClojureW "out of the box." This would give a working
IDE by simply downloading the package and running it.

Mark Engelberg

unread,
Mar 26, 2011, 1:35:36 PM3/26/11
to clo...@googlegroups.com
On Sat, Mar 26, 2011 at 10:24 AM, ultranewb <pineapp...@yahoo.com> wrote:
> Clojure Box -
> Could get a REPL, couldn't figure out how to do anything else (i.e.
> Leinegen blah blah).  Result - kept the install, as this was the 2nd
> most promising solution tried thus far.

If you don't care about building projects into self-executable jars,
try the following in Clojure Box:

After starting Clojure Box, use "Ctrl-x 2" to split the window. The
keystroke "Ctrl-x o" moves you back and forth between the two panes
(or click with the mouse within the pane that you want to have the
focus). In one of the panes, create a new file with "Ctrl-x Ctrl-f"
and name it with the .clj extension. The other pane should still show
the REPL.

Type some Clojure code into the file you created. Save periodically
with "Ctrl-x Ctrl-s". When you want to try out your code, type
"Ctrl-c ctrl-k" and all your code will be evaluated and those
definitions will now be available for interactive use in your REPL.

I used Clojure for many months in this manner before I started caring
about project files and such.

ultranewb

unread,
Mar 26, 2011, 7:29:17 PM3/26/11
to Clojure
On Mar 27, 12:35 am, Mark Engelberg <mark.engelb...@gmail.com> wrote:
> Type some Clojure code into the file you created.  Save periodically
> with "Ctrl-x Ctrl-s".  When you want to try out your code, type
> "Ctrl-c ctrl-k" and all your code will be evaluated and those
> definitions will now be available for interactive use in your REPL.

Everything works up until C-c Ck, where I get a "C-c C-k is undefined"
error :-(

Mark Engelberg

unread,
Mar 26, 2011, 7:40:45 PM3/26/11
to clo...@googlegroups.com

Make sure the pane with your code is the active pane when you type
Ctrl-c Ctrl-k. It won't work if the focus is on the REPL.

Daniel Bell

unread,
Mar 26, 2011, 8:42:03 PM3/26/11
to Clojure
I'm sure you're sick of how-to's by now (I was), but I took the
trouble to write down EXACTLY what I did for an Ubuntu/emacs/swank/
SLIME/leiningen set-up.

On Mar 26, 5:40 pm, Mark Engelberg <mark.engelb...@gmail.com> wrote:

ultranewb

unread,
Mar 27, 2011, 2:21:21 AM3/27/11
to Clojure
On Mar 27, 6:40 am, Mark Engelberg <mark.engelb...@gmail.com> wrote:
> Make sure the pane with your code is the active pane when you type
> Ctrl-c Ctrl-k.  It won't work if the focus is on the REPL.

Nope, it doesn't work, no matter where the focus is.

Shantanu Kumar

unread,
Mar 27, 2011, 3:29:14 AM3/27/11
to Clojure
I'm curious - did/could you give Eclipse and Counter-ClockWise plugin
a try?

Regards,
Shantanu

ultranewb

unread,
Mar 27, 2011, 4:45:37 AM3/27/11
to Clojure
On Mar 27, 2:29 pm, Shantanu Kumar <kumar.shant...@gmail.com> wrote:
> I'm curious - did/could you give Eclipse and Counter-ClockWise plugin
> a try?

I did not try Eclipse. I had a bad experience before with it. It
seems to be the worst to deal with as far as all the project and
dependency garbage, and none of that garbage was automatic, it seemed
to be manual. So unless you would say that Counter-ClockWise is
supposed to automatically deal with the garbage (would you say that?),
I'll steer clear.

ultranewb

unread,
Mar 27, 2011, 4:59:15 AM3/27/11
to Clojure
For newbs, I did not see this anywhere, but just discovered it, and it
is of immense value. In a REPL, you can just (load-file "path/to/
filename") to load the code you typed into an editor.

Shantanu Kumar

unread,
Mar 27, 2011, 5:56:12 AM3/27/11
to Clojure
As of current stable (0.64), CCW can automatically add Clojure and
Contrib JARs to your project and to the project classpath. After
installing Eclipse and the CCW plugin, all you need to do is
1. create a "Clojure project" (File-->New-->Clojure Project)
2. create a "Clojure file" (File-->New-->Clojure File)
3. Right click on the file you created and in the context menu, click
on the menu item that says "New Project's JVM, load selected file,
with a REPL"

I have found Eclipse/CCW to be a good combo.

Regards,
Shantanu

Luc Prefontaine

unread,
Mar 27, 2011, 12:09:29 PM3/27/11
to clo...@googlegroups.com

What version of Eclipse ? We have been using it with ccw for more
than a year. Very stable.

As far as "dependency garbage" there is no free lunch in any tool.
What I can suggest is that you build your code with Leiningen first.

Leiningen will pull all the related dependencies at once for a given
artifact defined in your project.clj. After a successful build by Leiningen
(use :aot to force compilation), you can look at the content of the lib folder in your project.
You then have the list of all the direct and non-direct dependencies of your project.
You can then copy this folder elsewhere to freeze them.

With most IDEs (including Eclipse) it will then be trivial to replicate the dependencies
of your project using that frozen snapshot. Of course you could also use a Maven plug in in your IDE
but that may be complex to setup for a single pass. Leiningen simplifies it a lot.

You cannot expect a tool to "guess" your project dependencies.
Dependencies are a fact of life and cannot be avoided in any significant project.
It's not "gargage"...

--
Luc P.

================
The rabid Muppet

ultranewb

unread,
Mar 27, 2011, 2:52:52 PM3/27/11
to Clojure
On Mar 27, 11:09 pm, Luc Prefontaine <lprefonta...@softaddicts.ca>
wrote:
> You cannot expect a tool to "guess" your project dependencies.
> Dependencies are a fact of life and cannot be avoided in any significant project.
> It's not "gargage"...

Anything I have to do besides what I should be doing is "garbage," but
I'm well-aware that one man's garbage is another man's treasure trove.

At any rate, the poster above you says (or, at least the way I
interpret him) that CCW "automates the garbage" (cough). I believe
you are stating it does not. If it does, I'll try it. If it doesn't,
I won't. Any definitive "yae" or "nae" here?

Laurent PETIT

unread,
Mar 27, 2011, 3:01:33 PM3/27/11
to clo...@googlegroups.com, ultranewb
2011/3/27 ultranewb <pineapp...@yahoo.com>
This is crazy.
You did not ask permission to try all the other alternatives ...

Shantanu Kumar

unread,
Mar 27, 2011, 3:39:55 PM3/27/11
to Clojure
As long as your code depends *only* on Clojure and Contrib JARS, CCW
will automatically include them on the classpath. Make sure you add
the source file under "src" and restart the REPL every time you make
modification to the source. If you need any 3rd party JAR (open source
or otherwise) you will have to do dependency management manually
through the menu options (dont forget - getting those dependency JARs
would still be another problem.)

As you said you are a newbie, I guess Eclipse+CCW should serve you
well. When you need to use 3rd party JARs, consider Luc's advice.

Regards,
Shantanu

Chas Emerick

unread,
Mar 27, 2011, 8:12:54 PM3/27/11
to clo...@googlegroups.com

On Mar 27, 2011, at 2:52 PM, ultranewb wrote:

> On Mar 27, 11:09 pm, Luc Prefontaine <lprefonta...@softaddicts.ca>
> wrote:
>> You cannot expect a tool to "guess" your project dependencies.
>> Dependencies are a fact of life and cannot be avoided in any significant project.
>> It's not "gargage"...
>
> Anything I have to do besides what I should be doing is "garbage," but
> I'm well-aware that one man's garbage is another man's treasure trove.

Dependency management and other garbage are definitely garbage, but I know of no nontrivial programming language that doesn't have its share of it. If you know of any magical environments that eliminate such administrivia, do share.

- Chas

Lee Spector

unread,
Mar 27, 2011, 8:51:43 PM3/27/11
to clo...@googlegroups.com

On Mar 27, 2011, at 8:12 PM, Chas Emerick wrote:
>
> Dependency management and other garbage are definitely garbage, but I know of no nontrivial programming language that doesn't have its share of it. If you know of any magical environments that eliminate such administrivia, do share.

A lot of the programming I've done in a variety of languages hasn't required me to deal with dependency management but that was mostly because there weren't any dependencies except the language itself (e.g. in Common Lisp), the language's own libraries which it knows how to find (e.g. standard C libraries), or my own code (which would be in the same file or the same directory). So the issue didn't arise. In other environments I've used "dependency management" is just a matter of putting libraries in single right folder; while that may be awkward for large, complicated projects at least it's clear how to make it work.

In more general, flexible, and modern environments I see that there's a real issue there that has to be solved somehow, but I think the problem that the OP raised (or at least the one that resonated with me :-) was that the ways to deal with this in the Clojure world seem to be either complicated to set up and use or not well integrated into the other tools that a newcomer has to deal with.

Leiningen seems to be a relatively painless way to do dependency management in Clojure but as far as I know it doesn't play nicely with any similarly painless Clojure-aware editing systems (I mean painless to setup/configure and to use, for newbies). Maybe Clojure Box fits this bill -- but since I don't do Windows I don't know. There are a lot of near misses -- e.g. lein+emacs but emacs is no fun to configure or learn, Eclipse/CCW but then you can't use lein unless you learn some weirdly crufty magic, textmate-clojure except it has some bugs and doesn't seem to be actively supported, etc. I was recently excited by the prospect of a lein+Bluefish combo, but Bluefish doesn't yet have Clojure auto-indenting which I think is one of the minimal required features. (Actually there's a draft of an auto-indent feature in the Bluefish SVN but I haven't had a chance to build and try it yet.)

What I heard the OP saying, which I agree with wholeheartedly, is that it would be really swell if there was a package with a trivial installation process that could do all of the necessary things -- editing (with a basic level of Clojure support), dependency management (with defaults that just work for simple newbie projects) and running. This issue has been raised (by me among others) for months or years, and it seems to me that most of the well-seasoned folks around here think it's solved but really it's only something like 90% solved if you're a newbie, and that last 10% makes a big difference.

-Lee

ultranewb

unread,
Mar 28, 2011, 12:30:54 AM3/28/11
to Clojure
On Mar 28, 7:51 am, Lee Spector <lspec...@hampshire.edu> wrote:
> > Dependency management and other garbage are definitely garbage, but I know of no nontrivial programming language that doesn't have its share of it.  If you know of any magical environments that eliminate such administrivia, do share.
>
> A lot of the programming I've done in a variety of languages hasn't required me to deal with dependency management but that was mostly because there weren't any dependencies except the language itself (e.g. in Common Lisp), the language's own libraries which it knows how to find (e.g. standard C libraries), or my own code (which would be in the same file or the same directory). So the issue didn't arise.

This.

I am not an expert in the term "dependency management" because I don't
want to be an expert in it. So for these purposes I will define the
term as "a bunch of bureaucratic crap I have to do that actually has
nothing to do with programming." Anyway, the only place I ever
experienced it before was a job I took once where they had Microsoft
Visual C++ Studio or something like that. This thing sure was
ridiculous, and after two days of trying to figure out how to get it
to use it's OWN libraries (never once writing a single line of code),
I threw it out the window, told the boss "I'm using something else,"
and that was that. I've worked at large operations (IBM, AT&T) but
never had to do any of this "dependency management" crap (I don't
doubt that somebody, somewhere, might have had to do it - probably a
full time employee PAID to do it - but I didn't have to do it).

But with any other language I've ever used, at most I include a
library I need in a directive at the top, or I include my own code in
a similar directive. For instance, with Erlang you just say
"module(whatever)" at the top. I mean, that's ALL you do. And the
documentation for the function you are using tells you the "whatever"
to put in. And to tell you the truth, I thought THAT was a load of
B.S... until I dealt with Java, heh. With J I either say "load
'whatever'" or "require 'whatever'" and that's it. It knows where to
go and find the 'whatever'. With APL and Prolog, I don't think I had
to ever declare anything. I've used dozens of languages, and this is
the pattern with any language I've chosen to use of my own volition.
The one exception was the Visual C++ crap (something I wasn't using of
my own volition), but I threw it out the window. Another exception
WOULD have been Java, except that I decided I wouldn't even do it for
money.

One pattern I've noticed is that the more a language requires you to
do "dependency management" garbage OUTSIDE the code, before you even
get to the code, the more it also requires cruft INSIDE the code. For
instance, look at a Java program sometime, with REAMS and REAMS of
declarations like "public.static.void.main.blah.blah...." First time
I saw that, my jaw just hit the floor, and I said "you mean people
actually sit there and code in this garbage?" I guess more than 50%
of the code in a language like this is cruft?

At any rate, I will give Shantanu Kumar's recommendation a try, and
report back to here if it works or not (my idea for this thread was to
compile a list of things that worked or didn't work for future
reference for newbs).

Kasim

unread,
Mar 28, 2011, 1:46:28 AM3/28/11
to clo...@googlegroups.com, ultranewb
Hi,

I am the guy who did ClojureW. I just updated the instruction to get a REPL with Jline. Thank you for reporting. I am also working on a "Just Works" emacs setup for all platforms and would be happy to hear your opinion. I really want to make it as simple as ClojureW.

Have fun,

Kasim

Mike Meyer

unread,
Mar 28, 2011, 2:15:32 AM3/28/11
to clo...@googlegroups.com
On Sun, 27 Mar 2011 21:30:54 -0700 (PDT)
ultranewb <pineapp...@yahoo.com> wrote:

> But with any other language I've ever used, at most I include a
> library I need in a directive at the top, or I include my own code in
> a similar directive.

Question: how did you find the library you were going to use? If you
only searched your local system, then yeah, a well-designed
system/language/etc. installed by somebody competent will do that for
you And I agree with you - to the best of my knowledge, Java (and from
what I can tell, pretty much anything based on the JVM) fails at this.

But this also means you're liable to be missing a large chunk of the
tools available for the language. These days, most languages have
contributed code libraries large enough that installing them all is
impractical on most systems. Searching those for things requires
accessing a database of some sort over the network. Installing them
involves downloading the library from some network site and doing
whatever needs to be done to install it.

So, assuming you found a library you really needed that wasn't already
locally installed, how did you deal with that? If you could add a
"require library" to your source and your language would go find it,
download it and install it, I'd like to know about that language.

If you had to ask someone else to install it for you, then you're
probably right that someone else was paid to deal with these
issues. Having been that person, I'll let you know that you had it
*really* easy if you didn't have to specify what version of a library
you wanted as well as the name.

<mike
--
Mike Meyer <m...@mired.org> http://www.mired.org/consulting.html
Independent Software developer/SCM consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Mark Engelberg

unread,
Mar 28, 2011, 2:31:43 AM3/28/11
to clo...@googlegroups.com
On Sun, Mar 27, 2011 at 11:15 PM, Mike Meyer <m...@mired.org> wrote:
> So, assuming you found a library you really needed that wasn't already
> locally installed, how did you deal with that? If you could add a
> "require library" to your source and your language would go find it,
> download it and install it, I'd like to know about that language.

Racket does exactly this. All the libraries live at
http://planet.plt-scheme.org/. If you see something you want to use,
you just need to add a corresponding line to your program, for
example:
(require (planet dherman/memoize:3:1))

If the library's not already on the system, when you run the program,
Racket automatically downloads it for you and puts it in the right
place (and even installs the documentation to the built-in, searchable
help desk!), and then the program executes.

The beauty of this approach is that it makes your programs truly
portable. I can send my program to someone, even if it involves
libraries, and trust that it will just run with no fuss, because all
the libraries auto-install.

Shantanu Kumar

unread,
Mar 28, 2011, 2:57:56 AM3/28/11
to Clojure


On Mar 28, 11:31 am, Mark Engelberg <mark.engelb...@gmail.com> wrote:
> On Sun, Mar 27, 2011 at 11:15 PM, Mike Meyer <m...@mired.org> wrote:
> > So, assuming you found a library you really needed that wasn't already
> > locally installed, how did you deal with that? If you could add a
> > "require library" to your source and your language would go find it,
> > download it and install it, I'd like to know about that language.
>
> Racket does exactly this.  All the libraries live athttp://planet.plt-scheme.org/.  If you see something you want to use,
> you just need to add a corresponding line to your program, for
> example:
> (require (planet dherman/memoize:3:1))
>
> If the library's not already on the system, when you run the program,
> Racket automatically downloads it for you and puts it in the right
> place (and even installs the documentation to the built-in, searchable
> help desk!), and then the program executes.
>
> The beauty of this approach is that it makes your programs truly
> portable.  I can send my program to someone, even if it involves
> libraries, and trust that it will just run with no fuss, because all
> the libraries auto-install.

This approach won't work if you "purchased" a 3rd party Scheme library
to do something, because it won't exist on planet.plt-scheme.org -- I
guess other language environments that transparently "manage garbage"
presume too much about availability, versioning, sourcing and
licensing of dependency modules.

Regards,
Shantanu

Luc Prefontaine

unread,
Mar 28, 2011, 5:16:55 AM3/28/11
to clo...@googlegroups.com
Given the huge number of libraries/projects available these days
and the diverse profile of library maintainers, a totally automated/transparent
dependency manager is not for today. It would require a crystal ball to cope
with a number of situations.

That "garbage" has to be dealt with in day to day use by most of us.
You should get used to it or live as an hermit on some far away mountain.
Which I am tempted to do from time to time but for real bureaucratic
issues like income tax reports :)

Life can be hard...

Luc

--

Lee Spector

unread,
Mar 28, 2011, 8:51:18 AM3/28/11
to clo...@googlegroups.com

On Mar 28, 2011, at 5:16 AM, Luc Prefontaine wrote:

> Given the huge number of libraries/projects available these days
> and the diverse profile of library maintainers, a totally automated/transparent
> dependency manager is not for today. It would require a crystal ball to cope
> with a number of situations.
>
> That "garbage" has to be dealt with in day to day use by most of us.
> You should get used to it or live as an hermit on some far away mountain.
> Which I am tempted to do from time to time but for real bureaucratic
> issues like income tax reports :)
>
> Life can be hard...

Luc's response here and also Shantanu's on the same thread have inspired me to coin a new word, "FANPERV," for someone who Fails to Appreciate the Newbie's PERspectiVe.

Fanpervs typically make two moves in response to confused newbies:

1. Explain (correctly) why the perfect solution requires complexity, and then assert (incorrectly) that newbies (and others with simple needs) should or must deal with that complexity from the start.

2. Provide a (correct) solution to the newbie's problem while asserting (incorrectly) that the solution is simple or obvious, thereby implying that nobody should bother to provide a truly simple or obvious solution to future newbies.

Fanpervs are often really smart and hard-working and kind and well intentioned, but for some reason or another -- probably usually because they know too much -- they just don't see how the newbies see things.

In the present discussion I don't think that newbies are asking for "totally automated/transparent dependency management" but rather for a way to avoid the issue entirely for simple projects that just use core and contrib (yes that can be a challenge if you're new to java classpaths, and for many other languages it's simpler because you just have to put the library in the same directory as your source code) or maybe a few other libraries that they could just download (yes that can be a challenge e.g. if the library's instructions just say how to do it from lein but you're using some other dependency management system because you want a Clojure-aware editor that doesn't require you to go down an emacs configuration and learning-curve rabbit hole).

I guess maybe I'm not quite a newbie any more, but for whatever reason -- maybe just a thick skull -- I still have the newbie perspective and I totally sympathize with people who are exasperated with the process of setting up a basic Clojure programming environment. As I said before I think there are several projects that get the newbie 90% of the way there, but the last 10% can be rough. I know that there are many on this list who could provide 100% solutions but perhaps haven't done so because they have fanpervish tendencies... But I think that these can be overcome, if people realize that there is really an issue here.

-Lee

Ken Wesson

unread,
Mar 28, 2011, 9:18:02 AM3/28/11
to clo...@googlegroups.com
On Mon, Mar 28, 2011 at 8:51 AM, Lee Spector <lspe...@hampshire.edu> wrote:
>
> On Mar 28, 2011, at 5:16 AM, Luc Prefontaine wrote:
>
>> Given the huge number of libraries/projects available these days
>> and the diverse profile of library maintainers, a totally automated/transparent
>> dependency manager is not for today. It would require a crystal ball to cope
>> with a number of situations.
>>
>> That "garbage" has to be dealt with in day to day use by most of us.
>> You should get used to it or live as an hermit on some far away mountain.
>> Which I am tempted to do from time to time but for real bureaucratic
>> issues like income tax reports :)
>>
>> Life can be hard...
>
> Luc's response here and also Shantanu's on the same thread have inspired me to coin a new word, "FANPERV," for someone who Fails to Appreciate the Newbie's PERspectiVe.
>
> Fanpervs typically make two moves in response to confused newbies:
>
> 1. Explain (correctly) why the perfect solution requires complexity, and then assert (incorrectly) that newbies (and others with simple needs) should or must deal with that complexity from the start.
>
> 2. Provide a (correct) solution to the newbie's problem while asserting (incorrectly) that the solution is simple or obvious, thereby implying that nobody should bother to provide a truly simple or obvious solution to future newbies.

You left out

3. Flame the newbie, call him stupid, condescend.

4. Give a correct-but-incomplete solution assuming the newb can fill
in the blanks or will even be aware that there are blanks to fill,
etc.

5. Create software systems that newbs basically cannot use due to a
ridiculously steep learning curve accompanied by a dense and technical
manual full of neologisms unrelated to the terms used for similar
things in similar, competing software systems, also making UI
conventions utterly at odds with the ones in those same systems, up to
and including the UI used to access, browse, search, and exit the
help.

For item 3, I note that there seems to be little flaming here --
thankfully. Usenet newsgroups on the other hand are rife with it, and
comp.lang.java.programmer, which a lot of us being JVM-targeting
developers probably follow, is a particular culprit at times.

For item 4, I seem to recall having had a TeX problem one time and
asking in comp.text.tex about it. There was a swift response with a
hunk of code to copy and paste into my document's preamble, which made
the compiler barf. I came back with a reply to the effect of "that
didn't work", and the swift response to this boiled down to "you
needed to put \makeatletter ... \makeatspecial around it, stupid" or
words to that effect. Actually, I guess that's a combination of 3
*and* 4. With the added two lines of code, it did work as desired. But
the responder could have actually included them in the first place
instead of assuming that they went without saying. Most TeX users,
including me, aren't also TeX hackers that delve deeply into the guts
of the thing; beyond the odd \newtheorem or \newcommand use to macro
automate something, we don't tend to do much more than write our
documents.

As for item 5, the most egregious culprit I can recall encountering in
that regard is a piece of software that gets mentioned daily around
here, is not Maven, and we'll just leave it at that. ;)

> Fanpervs are often really smart and hard-working and kind and well intentioned, but for some reason or another -- probably usually because they know too much -- they just don't see how the newbies see things.

I think this may be true even of the ones guilty of flaming; the
flaming stems from frustration and impatience instead of genuine
malice. On the other hand, there's a definite contingent that do hold
newbs in low esteem and are deliberately rude to them, regarding them
as low-status individuals on the techno totem pole. Why does this type
bother to reply to newbie questions at all? As near as I can tell they
break down into two subtypes: 1. hate seeing newbie questions, the
group has a mix of newbie questions and more advanced topics instead
of separate lists/groups for each, and they refuse to ignore/killfile
these; and 2. gets off on being the superior smarmy know-it-all. The
latter, especially, are deserving targets of snarky responses if you
catch them in a serious error or omission.

This list seems to mostly lack the genuinely newbie-hostile
contingent. On Usenet, though, they tend to be a very vocal minority
in every unmoderated technical group, usually with significant overlap
with the contingent (one of which is found in *every* unmoderated
group that gets nonzero levels of nonspammer traffic) of
self-appointed moderators (who invariably are the #1 source of
off-topic traffic themselves, usually in the form of flames, in-jokes
among their own cliques, and complaints about other posters' off-topic
traffic).

> In the present discussion I don't think that newbies are asking for "totally automated/transparent dependency management" but rather for a way to avoid the issue entirely for simple projects that just use core and contrib (yes that can be a challenge if you're new to java classpaths, and for many other languages it's simpler because you just have to put the library in the same directory as your source code) or maybe a few other libraries that they could just download (yes that can be a challenge e.g. if the library's instructions just say how to do it from lein but you're using some other dependency management system because you want a Clojure-aware editor that doesn't require you to go down an emacs configuration and learning-curve rabbit hole).

FWIW, my own position here is that we should have a Clojure
environment that can be used out of the box to produce usable jars
with little mess or fuss if there are no uncommon dependencies (and
java.*, javax.*, clojure.*, and clojure.contrib.* together cover a
great deal of territory already). The language has matured enough that
we need such a thing now; its lack will be an increasingly serious
impediment to wider adoption of Clojure and thus to Clojure's future
as a language. We may be near a critical point that will decide if
Clojure is going to become a big deal on a par with Python, perl, or
ruby, or just remain another obscure niche language tucked in with the
likes of F# and Scala.

Tim Webster

unread,
Mar 28, 2011, 10:48:34 AM3/28/11
to Clojure
On Mar 28, 9:18 am, Ken Wesson <kwess...@gmail.com> wrote:

> On the other hand, there's a definite contingent that do hold
> newbs in low esteem and are deliberately rude to them, regarding them
> as low-status individuals on the techno totem pole. Why does this type
> bother to reply to newbie questions at all?

(Almost) All tribal initiation rites are painful. Since it is not
possible with current technology to hit people with sticks via the
internet, rudeness is the next best thing. I am not suggesting my
implicit approval, just saying that what you are describing is bigger
than usenet tech groups, or usenet, or the internet.

ultranewb

unread,
Mar 28, 2011, 11:46:20 AM3/28/11
to Clojure
Fantastic! Hope to see your "just works" emacs.

On Mar 28, 1:15 pm, Mike Meyer <m...@mired.org> wrote:
> Question: how did you find the library you were going to use?

By looking at the documentation for the system. I guess I was mostly
referring to libraries which come with the system. I think your
comments are more about using third party libraries or other libraries
not included with the system. But heck, at this juncture I'm just
trying to use plain Clojure! Just seems to me that I should be able
to type some code in an editor within an IDE (not the REPL), push some
button called "run" or "compile and run" or "build and run" or
whatever, and get it to run. But nope. None of those major projects
I tried (NetBeans, IntelliJ, etc) will do this, or at least I couldn't
get them to do it.

About libraries not included with the main system, one poster here
spoke of how Racket does things. I use another programming language
which does a similar thing. It has a "package manager" (called
pacman) built right into the IDE. I haven't had a need to use it much
(the default language comes with a ton of stuff already working) but
apparently this pacman thing goes out onto the internet, downloads the
package you select, installs it in the right location, then does all
the "dependency garbage" for you.

Reminds me, btw, of installing ports on FreeBSD. There's an automated
thing I've used many times that just goes out, grabs what you need,
and installs it. I'm not saying it's the same thing as what we are
talking about here (maybe it is, maybe it isn't), but it sort of
reminds me of it, anyway.

Luc Prefontaine

unread,
Mar 28, 2011, 12:19:38 PM3/28/11
to clo...@googlegroups.com

"But with any other language I've ever used, at most I include a
library I need in a directive at the top, or I include my own code in
a similar directive. For instance, with Erlang you just say
"module(whatever)" at the top. I mean, that's ALL you do. "

This is what the poster expects. So much for "not asking for a totally
transparent solution"...

I remember an environment meeting the above expectations
many years ago were the linker would use missing references by itself
and automatically add necessary libraries.

There was only a single drawback. A developer seat cost was around 20,000$ US.
Single vendor, absolute mouse trap.

The simple answer (your # 1) was already provided by Shantanu.
Install Eclipse and CCW and you can start simple Clojure projects.
No immediate dependency issues until you need something from Clojar.

Clearly the above did not ring a bell.

Hence the expectancy reset. Learn to live with it because there will not be a
solution as simple as the one you expect in the near future.

So much for FANPERV.. We should call this FAMUNE (FAilure to Meet Unrealistic Newbie's Expectations :)

Luc

--

Lee Spector

unread,
Mar 28, 2011, 12:39:07 PM3/28/11
to clo...@googlegroups.com

On Mar 28, 2011, at 12:19 PM, Luc Prefontaine wrote:
> "But with any other language I've ever used, at most I include a
> library I need in a directive at the top, or I include my own code in
> a similar directive. For instance, with Erlang you just say
> "module(whatever)" at the top. I mean, that's ALL you do. "
>
> This is what the poster expects. So much for "not asking for a totally
> transparent solution"...

There's some ambiguity here about what kind of libraries we're talking about and where they come from. I think the poster is asking for a totally transparent way to do the stuff at the simple end of the spectrum (e.g. for built-in stuff -- which is generally straightforward although some getting-started instructions won't get you contrib -- or libraries that one can download once and stick in an obvious place), and may or may not be asking about any way to do the more exotic stuff (e.g. automatically updating miscellaneous 3rd party libraries).

>
> I remember an environment meeting the above expectations
> many years ago were the linker would use missing references by itself
> and automatically add necessary libraries.
>
> There was only a single drawback. A developer seat cost was around 20,000$ US.
> Single vendor, absolute mouse trap.

At least for my expectations every other programming language/environment I've used over the decades has met my ow expectations (at the simple end of the spectrum) better than Clojure, although Clojure is such a great language that I'm willing to put up with more (and nudge the community to make it better, hopefully in the nicest possible way :-).

>
> The simple answer (your # 1) was already provided by Shantanu.
> Install Eclipse and CCW and you can start simple Clojure projects.
> No immediate dependency issues until you need something from Clojar.
>
> Clearly the above did not ring a bell.

I agree that Eclipse/CCW is one of the best 90% solutions out there, and it's what I use (and teach with). But it's not completely easy to set up (I frequently have students with messed up installations that require tinkering) and you do fall off a bit of a cliff as soon as you try to go beyond core & contrib; It can be hard to figure out what to download (since often one finds just lein instructions), and confusing to figure out where to put things or how to get Eclipse to find them. Better integration with lein (which I know is being discussed and worked on in the CCW community) would push it much closer to 100%


> Hence the expectancy reset. Learn to live with it because there will not be a
> solution as simple as the one you expect in the near future.
>
> So much for FANPERV.. We should call this FAMUNE (FAilure to Meet Unrealistic Newbie's Expectations :)

Yeah, well what's realistic and reasonable are influenced by one's perspective...

-Lee

ultranewb

unread,
Mar 28, 2011, 1:45:21 PM3/28/11
to Clojure
On Mar 28, 11:39 pm, Lee Spector <lspec...@hampshire.edu> wrote:
> There's some ambiguity here about what kind of libraries we're talking about and where they come from.
> I think the poster is asking for a totally transparent way to do the stuff at the simple end of the spectrum (e.g. for built-in stuff....

Yes, this basically.

David Nolen

unread,
Mar 28, 2011, 1:48:19 PM3/28/11
to clo...@googlegroups.com
On Mon, Mar 28, 2011 at 12:39 PM, Lee Spector <lspe...@hampshire.edu> wrote:

On Mar 28, 2011, at 12:19 PM, Luc Prefontaine wrote:
> "But with any other language I've ever used, at most I include a
> library I need in a directive at the top, or I include my own code in
> a similar directive.  For instance, with Erlang you just say
> "module(whatever)" at the top.  I mean, that's ALL you do. "
>
> This is what the poster expects. So much for "not asking for a totally
> transparent solution"... 
 

1) Install JEdit for your platform, start JEdit
2) Install Clojure and Clojure Shell plugins via Plugins menu
3) Start the Clojure Shell from the Plugins menu.
4) Write some Clojure source in a file, save it.
5) Send file to Clojure Shell

David 

ultranewb

unread,
Mar 28, 2011, 1:50:03 PM3/28/11
to Clojure
On Mar 28, 11:19 pm, Luc Prefontaine <lprefonta...@softaddicts.ca>
wrote:
> The simple answer (your # 1) was already provided by Shantanu.
> Install Eclipse and CCW and you can start simple Clojure projects.
> No immediate dependency issues until you need something from Clojar.

Oh, there have been lots of "simple answers." The problem is, none of
them have worked.

Either way, I said that I would download and try this Eclipse thing in
the next few days, and I will. I don't have high hopes for it,
because I've already "been there, done that" with these other big,
glamorous IDEs, but I'll do my due diligence and give it a shot. If
I'm a betting in Vegas, I'll bet that it doesn't "just work," but
we'll see.

Larry Travis

unread,
Mar 28, 2011, 2:27:36 PM3/28/11
to clo...@googlegroups.com, Larry Travis
Kasim:
I just discovered ClojureW, and it looks promising. I will report my reaction after I get time to thoroughly test it for the kinds of things I am doing.

In the meantime, a request:

When you work 'on a "Just Works" emacs setup' for Mac Os X consider whether you can create such a setup for the Aquamacs version of emacs that many of us Mac Os X users prefer (because it gives us the power and versatility of emacs without having to learn dozens of non-obvious key chords).

Thanks.

  --Larry

Ken Wesson

unread,
Mar 28, 2011, 2:32:28 PM3/28/11
to clo...@googlegroups.com
On Mon, Mar 28, 2011 at 2:27 PM, Larry Travis <tra...@cs.wisc.edu> wrote:
> Kasim:
> I just discovered ClojureW, and it looks promising. I will report my
> reaction after I get time to thoroughly test it for the kinds of things I am
> doing.
>
> In the meantime, a request:
>
> When you work 'on a "Just Works" emacs setup' for Mac Os X consider whether
> you can create such a setup for the Aquamacs version of emacs that many of
> us Mac Os X users prefer (because it gives us the power and versatility of
> emacs without having to learn dozens of non-obvious key chords).

That reminds me: why do MacOS users get an Aquamacs like that, but the
rest of us don't get a corresponding Kmacs, Gnomemacs, and Winmacs? :)

Lee Spector

unread,
Mar 28, 2011, 2:53:49 PM3/28/11
to clo...@googlegroups.com

On Mar 28, 2011, at 1:48 PM, David Nolen wrote:
> 1) Install JEdit for your platform, start JEdit
> 2) Install Clojure and Clojure Shell plugins via Plugins menu
> 3) Start the Clojure Shell from the Plugins menu.
> 4) Write some Clojure source in a file, save it.
> 5) Send file to Clojure Shell

I've played with this, but am I missing something or does it not provide language-aware auto-indenting? I think that's a minimal requirement for editing in any Lisp-like language.

There's google group traffic that implies that auto-indenting was added to the jEdit Clojure mode a couple of years ago (e.g. http://groups.google.com/group/clojure/browse_thread/thread/399ba47336c5660f), but after following the directions above I don't see how to get auto-indenting. Tab doesn't do it, and neither does Edit>Indent>Indent Lines -- actually that does something but it's nothing like standard Lisp-style indentation. The google group discussion also indicates that there were several versions of this plugin floating around... Perhaps I'm getting an old one for some reason?

BTW I also didn't see how to affect the class path, so that I could refer to one file from another (or use a library from somewhere else, but in my case I was just trying to run a program with code in two files). Is there a way to do that?

I didn't find answers to these questions in the built-in help, or via web searches... Is there a site dedicated to this plugin?

Thanks,

-Lee

Lee Spector

unread,
Mar 28, 2011, 2:56:46 PM3/28/11
to clo...@googlegroups.com, Larry Travis

On Mar 28, 2011, at 2:27 PM, Larry Travis wrote:
>
> When you work 'on a "Just Works" emacs setup' for Mac Os X consider whether you can create such a setup for the Aquamacs version of emacs that many of us Mac Os X users prefer (because it gives us the power and versatility of emacs without having to learn dozens of non-obvious key chords).

inc!

-Lee

Timothy Baldridge

unread,
Mar 28, 2011, 2:57:29 PM3/28/11
to clo...@googlegroups.com
> Either way, I said that I would download and try this Eclipse thing in
> the next few days, and I will. I don't have high hopes for it,
> because I've already "been there, done that" with these other big,
> glamorous IDEs, but I'll do my due diligence and give it a shot. If
> I'm a betting in Vegas, I'll bet that it doesn't "just work," but
> we'll see.

At some point, you'll need to just pick a version and go with it. Once
you reach a point where you're about to give up, email a stack trace
to this list and we'll try to help. Until then simply giving a list of
"this didn't work". Isn't really going to help, since there could be
any number of things wrong.

In my case, my failure to get started with Clojure ended up being
because my machine redirects My Documents to a remote share on the
network. There probably wasn't much wrong with the IDE I was using,
it's just a miss-configuration on my part. Unless you pick something
and try to stick with it for more than a few hours, you're not going
to really get anywhere.

Timothy

David Nolen

unread,
Mar 28, 2011, 3:02:55 PM3/28/11
to clo...@googlegroups.com
On Mon, Mar 28, 2011 at 2:53 PM, Lee Spector <lspe...@hampshire.edu> wrote:

On Mar 28, 2011, at 1:48 PM, David Nolen wrote:
> 1) Install JEdit for your platform, start JEdit
> 2) Install Clojure and Clojure Shell plugins via Plugins menu
> 3) Start the Clojure Shell from the Plugins menu.
> 4) Write some Clojure source in a file, save it.
> 5) Send file to Clojure Shell

I've played with this, but am I missing something or does it not provide language-aware auto-indenting? I think that's a minimal requirement for editing in any Lisp-like language.

Auto-indenting is achieved via the JEdit Clojure mode. You just need to drop it into your JEdit modes folder (platform dependent location). https://github.com/djspiewak/jedit-modes/blob/master/clojure.xml. I don't consider it critical for newcomers.
 
BTW I also didn't see how to affect the class path, so that I could refer to one file from another (or use a library from somewhere else, but in my case I was just trying to run a program with code in two files). Is there a way to do that?

I would use load-file in these cases. It's a limitation, but a reasonable one for newcomers.

David

Lee Spector

unread,
Mar 28, 2011, 3:31:44 PM3/28/11
to clo...@googlegroups.com

On Mar 28, 2011, at 3:02 PM, David Nolen wrote:
>
> Auto-indenting is achieved via the JEdit Clojure mode. You just need to drop it into your JEdit modes folder (platform dependent location). https://github.com/djspiewak/jedit-modes/blob/master/clojure.xml. I don't consider it critical for newcomers.

I do consider this critical, especially for newcomers. I already had the Clojure edit mode that could be installed from the Plugins menu, and my buffers say "clojure" at the bottom so I assume it is working. (And I can also execute Clojure code via the Plugins>Clojure Shell menus.)

But following your advice I downloaded the mode file you linked, found a modes directory (on Mac OS X within the application package and a couple levels down), replaced the clojure.xml that was there with the new one, quit and restarted jEdit, and... it seems to behave the same as it did previously :-( Was one of these steps incorrect?

>> BTW I also didn't see how to affect the class path, so that I could refer to one file from another (or use a library from somewhere else, but in my case I was just trying to run a program with code in two files). Is there a way to do that?
>
> I would use load-file in these cases. It's a limitation, but a reasonable one for newcomers.

I disagree. The preferred ways to include code from libraries/files are require or use (preferably in ns forms) and these should work. Ideally they would find things in some obvious location (like the location of the source file you're executing) by default, and ideally there'd be a simple way to customize this. I think that having no way to go beyond code in a single file, aside from using load-file, would prevent anyone from using this as platform for more than a quick experiment.

-Lee

Sean Corfield

unread,
Mar 28, 2011, 4:01:52 PM3/28/11
to clo...@googlegroups.com
On Sun, Mar 27, 2011 at 11:31 PM, Mark Engelberg
<mark.en...@gmail.com> wrote:
> (require (planet dherman/memoize:3:1))
>
> If the library's not already on the system, when you run the program,
> Racket automatically downloads it for you and puts it in the right
> place (and even installs the documentation to the built-in, searchable
> help desk!), and then the program executes.

As someone who had studiously avoided maven all my career before I
started to use Clojure, I will admit (grudgingly) that maven comes the
closest to making the above a reality for Java systems compared to
other build tools I've used so far. I still think maven is utterly
horrible so I'm glad Leiningen and Cake exist so I can mostly ignore
maven and just use a project.clj file to state what versions of what
libraries I need and have the build tool go find them, download them
and put them in the right place.

On Eclipse + CCW, much as I like CCW and use it most every day I'm
working with Clojure, I don't find it's 'magic' for the Clojure
libraries to be very appropriate since I rely on Leiningen for
dependencies and would rather CCW worked with Leiningen rather than
just dropping Clojure JARs into my Eclipse project (but I realize this
is at least partly Eclipse's "fault" for the way it expects you to
dance around and configure Java-based projects). I'll probably have
more useful feedback over the next month as we start to integrate
Clojure into our production code base at work, rather than it being an
independent set of utility programs I've been working with alone...

Certainly, a new-to-Java-bie is going to find Eclipse and its projects
and build paths to be a royal PITA above and beyond the already
annoying "DLL hell" that Java already foists on us. For me, I came
from a C / C++ background where builds and dependencies were pretty
hairy already so Java wasn't really any worse than what I'd grown up
with since the mid-80's. On the other hand, I can't think of a single
mainstream language that is widely used in and industry that doesn't
make you do some sort of "dance" to get this crap done so someone who
has successfully managed to have a career in IT while avoiding such
things has to be admired (albeit with raised eyebrows :) I sympathize
with ultranewb's experience and position (to some extent) but can't
help feeling their expectations are a little unrealistic in the modern
world of programming (sorry dude, no offense intended).

So far, I've found Leiningen to be far and away the easiest way to
introduce Clojure - and dependencies - to programmers with no
nuts'n'bolts Java experience but I haven't really found an IDE that
also makes sense for such folks (there's more uptake of Eclipse
amongst the programmers I deal with so CCW is the natural path to
take, despite the slight conflict with the Leiningen approach right
now).
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
Railo Technologies, Inc. -- http://www.getrailo.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

David Nolen

unread,
Mar 28, 2011, 4:37:41 PM3/28/11
to clo...@googlegroups.com
On Mon, Mar 28, 2011 at 3:31 PM, Lee Spector <lspe...@hampshire.edu> wrote:
I do consider this critical, especially for newcomers. I already had the Clojure edit mode that could be installed from the Plugins menu, and my buffers say "clojure" at the bottom so I assume it is working. (And I can also execute Clojure code via the Plugins>Clojure Shell menus.)

Using that clojure.xml, auto-indent works just fine for me.
 
I disagree. The preferred ways to include code from libraries/files are require or use (preferably in ns forms) and these should work. Ideally they would find things in some obvious location (like the location of the source file you're executing) by default, and ideally there'd be a simple way to customize this. I think that having no way to go beyond code in a single file, aside from using load-file, would prevent anyone from using this as platform for more than a quick experiment.

 -Lee

The Clojure plugin comes with a Commando script under the Plugins > Console menu that does what you want.

David 

daly

unread,
Mar 28, 2011, 4:48:09 PM3/28/11
to clo...@googlegroups.com, da...@axiom-developer.org

It helps to think of Java as "the new Cobol". :-)

Cobol programs were nothing more than a single class object
with a data section and a code section. Java just adds more
pain because it ties programs to their disk layout and forces
you to say everything in triplicate, in tiny files, as though
we still only have 4k of memory. Java changed nothing from
Cobol except the syntax.

Maven and Leiningen are really just "JCL reborn". About the
only advance is that you don't have to specify the cylinders.

Twenty years from now you can get a corporate job maintaining
legacy systems in "that mainframe language Java", most likely
working for Google maintaining their dying code base.

>
> So far, I've found Leiningen to be far and away the easiest way to
> introduce Clojure - and dependencies - to programmers with no
> nuts'n'bolts Java experience but I haven't really found an IDE that
> also makes sense for such folks (there's more uptake of Eclipse
> amongst the programmers I deal with so CCW is the natural path to
> take, despite the slight conflict with the Leiningen approach right
> now).

IDEs are just a fancy tool for looking up programs in the "system
catalog" on the "library pack".

If you're going to really be a lisper and use Clojure for more
than a "Java scripting language" then you might want to invest
effort in using emacs. You don't even need slime. Just use a
*shell* buffer. Lisp and emacs are made for each other and you'll
find that you get a much better understanding of where things are,
why it works, and how it is put together.

This won't get you a corporate job though. I've been writing
lisp code for 40 years and I can't find anyone willing to hire
me for my lisp skills. Perhaps there is something to this whole
"IDE" thing after all :-)


Tim Daly
Elder of the Internet

Lee Spector

unread,
Mar 28, 2011, 4:52:11 PM3/28/11
to clo...@googlegroups.com

On Mar 28, 2011, at 4:37 PM, David Nolen wrote:
>
> Using that clojure.xml, auto-indent works just fine for me.

Hmmm. Not for me. I guess this is another instance of the issue that the OP raised. Not sure what to try next to make it work. FWIW one reason I think auto-indentation is critical for newbies is that my best advice to beginning Lisp students is "auto-indent it to see where the structure isn't what you thought it was." That reveals a large percentage of problems. Also I rely on it myself for all of my coding.

>> I disagree. The preferred ways to include code from libraries/files are require or use (preferably in ns forms) and these should work. Ideally they would find things in some obvious location (like the location of the source file you're executing) by default, and ideally there'd be a simple way to customize this. I think that having no way to go beyond code in a single file, aside from using load-file, would prevent anyone from using this as platform for more than a quick experiment.
>

> The Clojure plugin comes with a Commando script under the Plugins > Console menu that does what you want.

I've just fiddled with the Commando options a bit but haven't succeeded in getting one file to find another in the same directory via "require" in an ns form. I don't doubt that it "does what I want" or that it's "simple" to do for you and others, but this is another instance of the problem that the OP and I have raised.

-Lee

David Nolen

unread,
Mar 28, 2011, 5:08:20 PM3/28/11
to clo...@googlegroups.com

Armando Blancas

unread,
Mar 28, 2011, 5:16:16 PM3/28/11
to Clojure
> IntelliJ w/ La Clojure -
> Could get a REPL, couldn't figure out how to do anything else.  In
> particular, I followed some specific instructions from somewhere
> (can't remember where) for how to set up a project, edit a source file
> (hello world or whatever), and "run" that source file.  All I got was
> some kind of error.  Result - uninstalled.

I can't believe that piece of crap is being recommended to newbies.
That must have been a practical joke. You're a good sport.

Aaron Cohen

unread,
Mar 28, 2011, 5:36:52 PM3/28/11
to clo...@googlegroups.com

That's remarkably unhelpful. It works fine for me, even downloads the
appropriate clojure jar. I can either run or debug a script file, or
get a usable REPL. You're going to have to be way more specific.

1) Install La Clojure plugin
2) Create new project
3) Create new module (the only even halfway complicated step)
a) Choose "Java Module" as the type, press Next
b) Press next until it asks you to select desired technologies,
select Clojure and leave everything default
4) Create a package in the src folder (right-click, name it something
like t.core)
4a) Tools | "Start Clojure Console" if you want a repl
5) Create a clojure file (right click on t.core, select "New ->
Clojure file", name it "t")
6) Add a line (prn "Hello world!")
7) Create a "run configuration"
a) Menu (Run | Edit Configurations)
b) Hit the plus sign to add a new configuration
c) Choose "Clojure script", script path should point to the t.clj
you created
d) Hit OK
8) Press the run button

This is honestly the kind of stuff you should be able to figure out...

Stefan Kamphausen

unread,
Mar 28, 2011, 5:59:26 PM3/28/11
to clo...@googlegroups.com, ultranewb
Hi,

please let me humbly add my 2ct to this discussion...

If you want to learn something new, you'll just have to jump through some hoops.  As soon as you do a little more than the basics you'll have to learn the specific way to do it.

Somewhere in this thread it says, that in some language you just include something at the top of your source code.  This is true of Clojure as well as long as your referring to libraries which shipped with your installation.  As soon as you need something more....

* In Ruby you'll install a "gem"
* In Python you'll use an "egg" instead
* In Perl you'll invoke the old perl -MCpan -e shell (and you'll freak out if you go through this the first time)
* In C you'll cross your fingers that your distribution (I only do Linux) has a package for the correct version of your library, because otherwise you'll do the configure-make-make-install-Cha-cha (and never mention Makefiles, autoconf and friends ), which kinda works as long as you don't need several versions installed in parallel which is when you begin setting some paths here and there
* And in Clojure you'll have to deal with the way the host platform does it.

Using CCW, Enclojure, Emacs, leiningen or whatever you can achieve basic things, and you can even include lots of "libraries" from the JDK without any dependency management.  If you want to "run a script", you're working against the language and you will miss the best part (IMHO), which is working with a REPL.

I know the feeling, when you're new to things and everything seems so complicated, and the Java world in particular can be quite a beast here.  I never really got used to it.  I've been through some of the various hells modern programming languages offer you, but one pattern emerges: Take the dive and learn the specifics -- otherwise you won't have fun and you have no chance of grokking some of the 'deeper' things in that language.

Kind regards,
Stefan

Sean Corfield

unread,
Mar 28, 2011, 6:00:53 PM3/28/11
to clo...@googlegroups.com
On Mon, Mar 28, 2011 at 1:48 PM, daly <da...@axiom-developer.org> wrote:
> Maven and Leiningen are really just "JCL reborn". About the
> only advance is that you don't have to specify the cylinders.

Oh you're bringing back terrible memories from my youth! JCL... I
thought once I'd left the insurance industry I'd never have to see
those three letters again! :)

> If you're going to really be a lisper and use Clojure for more
> than a "Java scripting language" then you might want to invest
> effort in using emacs.

I really think that depends on what other technologies you want to
work with. I used Emacs in the 80's. It was great then - absolutely
best of breed. I recently tried it again - because of Clojure - and it
was like taking a step back 20+ years, IMO. I'm using Clojure as part
of a large project that already has multiple languages, all running on
the JVM, as well as CSS, JS, HTML, SQL, and using Tomcat as the
container for testing / deployment. Eclipse handles all of that with a
small collection of plugins in rich, Java-centric manner - which is
what I need.

If you are writing a pure Clojure system and, for you, the JVM is a
necessary evil to run the end result, then Emacs is probably worth the
effort but for me it would be a *huge* shift in my workflow and a very
steep learning curve. For anyone coming from a Java background, I
don't think recommending Emacs is at all helpful...

> This won't get you a corporate job though. I've been writing
> lisp code for 40 years and I can't find anyone willing to hire
> me for my lisp skills. Perhaps there is something to this whole
> "IDE" thing after all :-)

*chuckle*

Chas Emerick

unread,
Mar 28, 2011, 6:55:38 PM3/28/11
to clo...@googlegroups.com

On Mar 28, 2011, at 4:48 PM, daly wrote:

> If you're going to really be a lisper and use Clojure for more
> than a "Java scripting language" then you might want to invest
> effort in using emacs. You don't even need slime. Just use a
> *shell* buffer. Lisp and emacs are made for each other and you'll
> find that you get a much better understanding of where things are,
> why it works, and how it is put together.

This thread is long past its expiration date, but I can't help myself:

You can "really be" a Clojure programmer with Notepad.exe or emacs or Eclipse or TextMate or IntelliJ or NetBeans or Sublime Text or jEdit: use whatever you are most comfortable with. The editors we use shouldn't end up being Shibboleths or the basis of cliques.

- Chas

Jon Seltzer

unread,
Mar 28, 2011, 9:07:43 AM3/28/11
to Clojure
While I agree that clear steps should be provided to assist newcomers,
I don't have sympathy for newcomers more interested in bashing other
languages and people than in actually learning something.

I started learning clojure over a year ago and I don't recall any
issues getting started. I fired up a REPL almost immediately. Other
things were more difficult but I figured that's part of the learning
process.

Frankly, I'm a little annoyed by people who want to blame everyone
else if something new is not immediately obvious to them.

On Mar 28, 5:51 am, Lee Spector <lspec...@hampshire.edu> wrote:
> On Mar 28, 2011, at 5:16 AM, Luc Prefontaine wrote:
>
> > Given the huge number of libraries/projects available these days
> > and the diverse profile of library maintainers, a totally automated/transparent
> > dependency manager is not for today. It would require a crystal ball to cope
> > with a number of situations.
>
> > That "garbage" has to be dealt with in day to day use by most of us.

Lee Spector

unread,
Mar 28, 2011, 7:03:20 PM3/28/11
to clo...@googlegroups.com

On Mar 28, 2011, at 5:08 PM, David Nolen wrote:

Thanks. That taught me some things -- e.g. I had guessed the wrong location for the mode file, and I hadn't guessed about editing that catalog file at all, and I hadn't seen the clojure item in the drop-down on the commando dialog -- but after following all of those directions I think I'm just where I started. The auto-indentation looks completely wrong for clojure/lisp code, and even though the classpath in the commando dialog looks right (pointing to my source directory) when I "Evaluate buffer in clojure shell" or "Evaluate file in clojure shell" for foo.clj that looks like this:

(ns foo
(:require [bar]))

(bar/baz)

It fails to find bar.clj (which creates ns bar and defines a function baz) which is in the same directory.

I do now have clojure syntax highlighting which I may or may not have had before (I don't recall noticing that before, but maybe it was there).

-Lee

Lee Spector

unread,
Mar 28, 2011, 7:22:35 PM3/28/11
to clo...@googlegroups.com

On Mar 28, 2011, at 9:07 AM, Jon Seltzer wrote:
>
> Frankly, I'm a little annoyed by people who want to blame everyone
> else if something new is not immediately obvious to them.

I don't know if you intend this to apply to me but for the record I'm not trying to blame anyone for anything, just trying to help improve the clojure ecosystem by pointing out some issues that I have had (and which some of my students and newbies who post to this list have had).

I've been using Clojure for about a year (and programming for about 30 years, and teaching Clojure since last September) but I'm not completely happy with any of the programming environments that I've found and I know they can be better in a couple of small but important ways. I know this in part because there are so many talented and creative people in the community and in part because there are (as I said) many near-solutions that do about 90% of what I'm looking for. I think that it can be hard for people with a lot of expertise to appreciate the way that things look to those who don't, and I intend to be purely constructive in pointing this stuff out.

-Lee

Kasim

unread,
Mar 28, 2011, 7:48:09 PM3/28/11
to clo...@googlegroups.com, Larry Travis
Thanks for the comment, Larry. I have used Aquamacs before. It is my plan to support it as well.

-Kasim

Mike Meyer

unread,
Mar 28, 2011, 8:38:57 PM3/28/11
to clo...@googlegroups.com
On Mon, 28 Mar 2011 08:46:20 -0700 (PDT)
ultranewb <pineapp...@yahoo.com> wrote:
> On Mar 28, 1:15 pm, Mike Meyer <m...@mired.org> wrote:
> > Question: how did you find the library you were going to use?
>
> By looking at the documentation for the system. I guess I was mostly
> referring to libraries which come with the system. I think your
> comments are more about using third party libraries or other libraries
> not included with the system. But heck, at this juncture I'm just
> trying to use plain Clojure! Just seems to me that I should be able
> to type some code in an editor within an IDE (not the REPL), push some
> button called "run" or "compile and run" or "build and run" or
> whatever, and get it to run. But nope. None of those major projects
> I tried (NetBeans, IntelliJ, etc) will do this, or at least I couldn't
> get them to do it.

Yup, you're right - that was sort of my point. I think I got the
level you asked for with emacs by installing all the "clojure" ports
in the FreeBSD ports tree (I wouldn't normally mention those, but
you're familiar with them).

The reason I'm not sure that I had that level is that you're asking
for a less than best-practice solution when using a language with a
repl. The first step after writing the code isn't to run the program,
it's to try loading it in the repl. Once that works without errors,
switch to the repl and start running the function(s) you just wrote
with a variety of arguments to test them. So I don't want "run file",
I want "load region" and "load defn". When I want to test the entire
program, I tend to switch to a shell and run it in a new instance of
the JVM, just to make sure the results aren't tainted by cruft left in
the JVM during the development process.

> About libraries not included with the main system, one poster here
> spoke of how Racket does things. I use another programming language
> which does a similar thing. It has a "package manager" (called
> pacman) built right into the IDE. I haven't had a need to use it much
> (the default language comes with a ton of stuff already working) but
> apparently this pacman thing goes out onto the internet, downloads the
> package you select, installs it in the right location, then does all
> the "dependency garbage" for you.

Many modern languages have such package managers. Being an emacs
person, I don't look for them to be integrated into the IDE. Clojure
is a long way from that: I don't know of any tools that will fetch
requirements for a library when they fetch the library, or a way to
search the standard library repositories other than using a web
browser.

Consider this a features request for cake/leiningen:
1) A task to search clojars.
2) A task take a name from #1 and add the appropriate data to project.clj.
3) Extend the "deps" task to install libraries required by any dependency.

> Reminds me, btw, of installing ports on FreeBSD. There's an automated
> thing I've used many times that just goes out, grabs what you need,
> and installs it. I'm not saying it's the same thing as what we are
> talking about here (maybe it is, maybe it isn't), but it sort of
> reminds me of it, anyway.

As far as I can tell, that's the original dependency-handling package
manager. I think SGI may have had a proprietary one earlier, but it
predates the other open source package managers, and most proprietary
ones required you to install other required packages by hand.

And yeah, that's pretty much what we're talking about, tweaked to deal
with project-level things instead of system-level things.

<mike
--
Mike Meyer <m...@mired.org> http://www.mired.org/consulting.html
Independent Software developer/SCM consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Andy Fingerhut

unread,
Mar 28, 2011, 9:10:31 PM3/28/11
to clo...@googlegroups.com
Changing subject line for this one.

On Mar 28, 2011, at 5:38 PM, Mike Meyer wrote:
>
> Consider this a features request for cake/leiningen:
> 1) A task to search clojars.
> 2) A task take a name from #1 and add the appropriate data to project.clj.
> 3) Extend the "deps" task to install libraries required by any dependency.

I am not claiming that Leiningen does #1 or #2 already, but in case you were unaware, you can go to clojars.org, type something like "hadoop" in the search box at the upper right, and see a list of matching packages.

Clicking on one of them gives me text I can copy and paste into a Leiningen project.clj file, or into a Maven pom.xml file. Here is the text shown for one version of hadoop-core that was shown when I searched for hadoop:

[org.apache.hadoop/hadoop-core "0.20.2-dev"]

If I add that appropriately to a project.clj file created from making a new "empty except for clojure core project" with "lein new <name>", save it, and type "lein deps", it does do #3, i.e. adds hadoop-core and everything that it requires. They are all put into the lib directory in the project. This is with Leiningen 1.5.0, but that behavior has worked for several versions now. I believe it is implemented under the covers via Maven's dependency management.

Have you tried "lein deps" and found that it failed to install libraries required by a dependency you had already added to your project.clj file?

Andy

Jon Seltzer

unread,
Mar 28, 2011, 8:57:22 PM3/28/11
to Clojure
Sorry, Lee. Not you. You're posts have been sincere.

Squid

unread,
Mar 28, 2011, 9:56:56 PM3/28/11
to Clojure
I started out playing with Clojure in the Intellij plug-in La Clojure
back about 6 months ago. It worked quite well, but I started
experimenting with lein and emacs and found it to be more light-
weight, enjoyable, and productive for me. And yes, I learned emacs
specifically to use it with Clojure. I consider it an investment that
was well worth the extra time (Paredit I love you.)

David Nolen

unread,
Mar 28, 2011, 11:07:52 PM3/28/11
to clo...@googlegroups.com
On Monday, March 28, 2011, Lee Spector

> I do now have clojure syntax highlighting which I may or may not have had before (I don't recall noticing that before, but maybe it was there).
>
>  -Lee

Clojure Shell is just for snippets. The Commando bit is for running
your script with a properly set classpath - but this is more of a
compile and run experience, it's not very interactive. I imagine that
will have to wait for integration with something like nREPL.

David

Mike Meyer

unread,
Mar 29, 2011, 12:52:39 AM3/29/11
to clo...@googlegroups.com
On Mon, 28 Mar 2011 18:10:31 -0700
Andy Fingerhut <andy.fi...@gmail.com> wrote:
> Changing subject line for this one.

I almost did that myself.

> On Mar 28, 2011, at 5:38 PM, Mike Meyer wrote:
> >
> > Consider this a features request for cake/leiningen:
> > 1) A task to search clojars.
> > 2) A task take a name from #1 and add the appropriate data to project.clj.
> > 3) Extend the "deps" task to install libraries required by any dependency.
>
> I am not claiming that Leiningen does #1 or #2 already, but in case you were unaware, you can go to clojars.org, type something like "hadoop" in the search box at the upper right, and see a list of matching packages.

> Clicking on one of them gives me text I can copy and paste into a Leiningen project.clj file, or into a Maven pom.xml file. Here is the text shown for one version of hadoop-core that was shown when I searched for hadoop:

Yes, I knew about that. This is the API that an IDE and/or dependency
manager (i.e. - leiningen) needs to use to do #1 and #2. It is not,
however, a replacement for an IDE or dependency manager actually doing
those things.

> [org.apache.hadoop/hadoop-core "0.20.2-dev"]
>
> If I add that appropriately to a project.clj file created from making a new "empty except for clojure core project" with "lein new <name>", save it, and type "lein deps", it does do #3, i.e. adds hadoop-core and everything that it requires. They are all put into the lib directory in the project. This is with Leiningen 1.5.0, but that behavior has worked for several versions now. I believe it is implemented under the covers via Maven's dependency management.
>
> Have you tried "lein deps" and found that it failed to install libraries required by a dependency you had already added to your project.clj file?

Cool. This one is my bad - I had gotten the idea that it wouldn't find
dependencies, and had always filled them in by hand. And I had figured
this would be the hard one of the three to do.

Andy Fingerhut

unread,
Mar 29, 2011, 1:24:39 AM3/29/11
to clo...@googlegroups.com
And I should have known about this before, but had not used it. It adds to Leiningen the capability to search, and I'm not sure, but perhaps also add dependencies that were found:

https://github.com/Licenser/lein-search

Andy

> --
> 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

ultranewb

unread,
Mar 29, 2011, 1:32:49 AM3/29/11
to Clojure
<<This won't get you a corporate job though. I've been writing
lisp code for 40 years and I can't find anyone willing to hire
me for my lisp skills....

Tim Daly
Elder of the Internet>>

It's okay. I couldn't get hired as a C programmer for NASA years ago,
and I had already written my own working C compiler! The idiot
interviewer opened some huge C library reference manual to some random
page, and asked me to recite whatever function he had the page opened
to from memory. Of course I couldn't do that, and explained to him
that this wasn't important, that any decent programmer would simply do
what he was doing (open up the reference manual, look up the function,
and be using that function within a minute). But of course idiots
will be idiots.

Either way, if you are in the USA (don't know if you are or aren't),
these days corporations just hire Indians on H1-B visas, or they just
outsource the work over to there. So you don't have a shot anyway.

<<Jon Seltzer

While I agree that clear steps should be provided to assist
newcomers,
I don't have sympathy for newcomers more interested in bashing other
languages and people than in actually learning something.>>

Note sure if this was directed at me or not, but the only language
I've bashed is Java. I won't apologize for that, though, so if it
offended you, tough ;-)

<<I started learning clojure over a year ago and I don't recall any
issues getting started. I fired up a REPL almost immediately.>>

I've stated at the top that I could get REPLs without difficulty.

<<Frankly, I'm a little annoyed by people who want to blame everyone
else if something new is not immediately obvious to them.>>

Don't know why you feel as if you or your "tribe" is being attacked.
I'm not "blaming" anyone or anything, I created a thread on "what
worked, what didn't" as a resource for 1) newbs interested in trying
Clojure (I wish I had this resource from the get-go), and 2) as
feedback for whatever Clojure people are out there who are making
tools and IDEs or who are concerned with the newbie newcomer
situation. As to #2, my thread already seemed to help the ClojureW
guy make an improvement in a bug I found.

If you aren't in group 1 or group 2, don't feel the need to hang out
in this thread and feel so annoyed or attacked if you don't want.

Jon Seltzer

unread,
Mar 29, 2011, 1:39:00 AM3/29/11
to Clojure
I use JEdit exclusively as described by David and adding external
libraries to the classpath on my own when I launch the REPL.

Really, setting the classpath isn't that hard and if you're really
planning on using Clojure long term then you'll have to deal with it
eventually. So why not just spend time to learn how to do it.

On Mar 28, 12:02 pm, David Nolen <dnolen.li...@gmail.com> wrote:
> On Mon, Mar 28, 2011 at 2:53 PM, Lee Spector <lspec...@hampshire.edu> wrote:
>
> > On Mar 28, 2011, at 1:48 PM, David Nolen wrote:
> > > 1) Install JEdit for your platform, start JEdit
> > > 2) Install Clojure and Clojure Shell plugins via Plugins menu
> > > 3) Start the Clojure Shell from the Plugins menu.
> > > 4) Write some Clojure source in a file, save it.
> > > 5) Send file to Clojure Shell
>
> > I've played with this, but am I missing something or does it not provide
> > language-aware auto-indenting? I think that's a minimal requirement for
> > editing in any Lisp-like language.
>
> Auto-indenting is achieved via the JEdit Clojure mode. You just need to drop
> it into your JEdit modes folder (platform dependent location).https://github.com/djspiewak/jedit-modes/blob/master/clojure.xml. I don't

Jon Seltzer

unread,
Mar 29, 2011, 1:39:38 AM3/29/11
to Clojure
This is exactly what I use and it works perfectly.

On Mar 28, 10:48 am, David Nolen <dnolen.li...@gmail.com> wrote:
> On Mon, Mar 28, 2011 at 12:39 PM, Lee Spector <lspec...@hampshire.edu>wrote:
>
>
>
> > On Mar 28, 2011, at 12:19 PM, Luc Prefontaine wrote:
> > > "But with any other language I've ever used, at most I include a
> > > library I need in a directive at the top, or I include my own code in
> > > a similar directive.  For instance, with Erlang you just say
> > > "module(whatever)" at the top.  I mean, that's ALL you do. "
>
> > > This is what the poster expects. So much for "not asking for a totally
> > > transparent solution"...
>
> 1) Install JEdit for your platform, start JEdit
> 2) Install Clojure and Clojure Shell plugins via Plugins menu
> 3) Start the Clojure Shell from the Plugins menu.
> 4) Write some Clojure source in a file, save it.
> 5) Send file to Clojure Shell
>
> David

Jon Seltzer

unread,
Mar 29, 2011, 1:49:14 AM3/29/11
to Clojure
<comments directed to me>

Fair enough.

It would be great if Clojure tools were as mature as Java's Eclipse or
IntelliJ, but hey, Java's been around for 15 years. Probably
unrealistic to expect more.

Perhaps we can look forward to tools created by you.

Phil Hagelberg

unread,
Mar 29, 2011, 7:49:48 PM3/29/11
to Clojure
On Mar 28, 10:24 pm, Andy Fingerhut <andy.finger...@gmail.com> wrote:
> And I should have known about this before, but had not used it.  It adds to Leiningen the capability to search, and I'm not sure, but perhaps also add dependencies that were found:
>
> https://github.com/Licenser/lein-search

This will be rolled into a future version of Leiningen with a proper
lucene-based search instead of the regex+spidering approach. The part
that modifies project.clj to insert new dependencies will probably not
be merged because 0) abritrary code may be embedded in project.clj, so
the :dependencies list is not necessarily a data structure you can
just splice however you feel like and 1) it's basic text editing;
asking Leiningen to do it for you is hardly more convenient than doing
it yourself. It could be done in a 3rd-party plugin with caveats that
it will not always work correctly though.

-Phil

Mike Meyer

unread,
Mar 30, 2011, 5:44:49 AM3/30/11
to clo...@googlegroups.com
On Tue, 29 Mar 2011 16:49:48 -0700 (PDT)
Phil Hagelberg <ph...@hagelb.org> wrote:
> On Mar 28, 10:24 pm, Andy Fingerhut <andy.finger...@gmail.com> wrote:
> > And I should have known about this before, but had not used it.  It adds to Leiningen the capability to search, and I'm not sure, but perhaps also add dependencies that were found:
> >
> > https://github.com/Licenser/lein-search
> The part
> that modifies project.clj to insert new dependencies will probably not
> be merged because 0) abritrary code may be embedded in project.clj, so
> the :dependencies list is not necessarily a data structure you can
> just splice however you feel like and 1) it's basic text editing;
> asking Leiningen to do it for you is hardly more convenient than doing
> it yourself. It could be done in a 3rd-party plugin with caveats that
> it will not always work correctly though.

Being able to type "lein add <library>" and have it take care of
everything is a lot more convenient than typing "lein search
<library>", selecting the appropriate stretch of text, copying it to
the clipboard (or not, if you're brave), switching to an editor,
finding the right place to insert it, pasting the clipboard, then
saving the file.

This seems to be a downside to switching from XML to Clojure. Not that
I think that was a bad idea - the upsides far outweigh this.

Maybe project.clj should be automatically merged with a project.xml
when lein runs, where project.xml is created with a "for machine
editing only - humans edit project.clj" comment at the top. Then tasks
could edit project.xml without running into those problems.

Martin DeMello

unread,
Mar 30, 2011, 12:10:07 PM3/30/11
to clo...@googlegroups.com, ultranewb
On Sat, Mar 26, 2011 at 10:54 PM, ultranewb <pineapp...@yahoo.com> wrote:
>
> I guess the optimum solution I see for myself at this point is getting
> Clojure Box to talk to ClojureW (i.e. editing a source file with
> Clojure Box, then "running" that source inside some Emacs window by
> running clj).  I'm guessing this would be trivial for the Emacs
> experts out there, but if someone wants to point me to a quick
> resource on it, I'll try it.

If you're on linux, another thing you could try is jark
[http://icylisper.in/jark/]. One of the things it lets you do is run
clojure code as a "script" - from the examples:

$ cat factorial.clj

#!/usr/bin/env jark
(ns factorial
(:refer-clojure :exclude [get]))
(defn get [n]
(let [n (int n)]
(apply * (take n (iterate inc 1)))))
(println "factorial of 10:" (factorial/get 10))

$ ./factorial.clj
=> factorial of 10: 3628800

martin

Reply all
Reply to author
Forward
0 new messages