ClojurePla.net
Using the Clojure programming language for fun and profit!
Sunday, August 29, 2010
I am freezing this blog: future Clojure material will be on my main technology blog
Please visit my general technology blog
Thursday, August 19, 2010
cool: Clojure 1.2 released today
I just updated the project.clj on all of my active lein-based projects and I updated my local cljr setup.
I have been on version 1.2 for my own projects and my work projects for some time, but it is always great to use a released major version.
I have been on version 1.2 for my own projects and my work projects for some time, but it is always great to use a released major version.
Wednesday, August 18, 2010
more notes on using cljr
For work at CompassLabs, I now use the Clojure setup that everyone else uses (emacs+swank-clojure, with our custom repositories). For my own Clojure hacking (my own projects) I have just about settled on using cljr for convenience and agility. For me, the big win is being able to access Clojure libraries, Java libraries, and JAR files containing data sets I use often for NLP work from any directory. I don't need a heavy weight project, like for example, using Leiningen with all dependencies locally loaded. cljr uses Leiningen to manage the packages in the single ~/.cljr repository. When you startup cljr, everything in ~/.cljr is on your JVM classpath: this may seem a little heavy, but it is very convenient.
As an example, this morning I noticed an old Twitter direct message from the author of Nozzle library asking me if I had a chance to try it. Instead of setting up a separate Leiningen project directory, I just did a cljr install com.ashafa/nozzle 0.2.1, went to my catch-all directory where I keep short snippets of Clojure code, and entered Tunde's test program for Nozzle:
As an example, this morning I noticed an old Twitter direct message from the author of Nozzle library asking me if I had a chance to try it. Instead of setting up a separate Leiningen project directory, I just did a cljr install com.ashafa/nozzle 0.2.1, went to my catch-all directory where I keep short snippets of Clojure code, and entered Tunde's test program for Nozzle:
;; assumes: cljr install com.ashafa/nozzle 0.2.1and running it is as simple as:
(use 'com.ashafa.nozzle)
(def username (System/getenv "TWITTER_ACCOUNT"))
(def passwd (System/getenv "TWITTER_PASSWD"))
(defn my-callback
[message]
(println message))
(def noz (create-nozzle "filter" username passwd my-callback {:track "twitter"}))
cljr run nozzle-twitter-test.cljor, if you want to use emacs+swank:
cljr swankand after starting Emacs in the same directory:
M-x slime-connectand in the repl:
(load "nozzle-twitter-test")I still use IntelliJ with the Clojure plugin for some projects also.
Sunday, August 15, 2010
My light weight Clojure wrapper for the PowerLoom knowledge representation and reasoning system
A ZIP file with everything you need to try it is on my open source web page.
PowerLoom has been in development for many years and is available in Common Lisp, C++, and Java editions. I wrapped the Java edition for this project.
This is just a first cut at a wrapper because assertions and queries must be encoded as strings.
PowerLoom has been in development for many years and is available in Common Lisp, C++, and Java editions. I wrapped the Java edition for this project.
This is just a first cut at a wrapper because assertions and queries must be encoded as strings.
Saturday, August 14, 2010
Clojure: the good and the awkward
I have been doing some Clojure development at CompassLabs this year and I now feel like I have enough experience to better discuss both the language and tools that have been developed to support Clojure.
First for the awkward bits: for me the worse aspect of Clojure development is the un-useful stack frames when an error is thrown. I have 99% confidence that this problem will eventually get fixed and this issue will go away. Another awkward aspect is not being able to settle down on a single development setup. I currently use:
For me, the best bits of coding in Clojure are the uniform APIs for seqs and the wealth of existing Java libraries that make Clojure close to ideal for many kinds of applications.
I spend a lot of time coding in Clojure, Ruby, Java, Common Lisp, and Scheme. It is difficult to predict what tools will be most useful in the future but as rough edges of the Clojure experience are smoothed out, Clojure has the real possibility for being a reasonable choice for almost all of my development.
First for the awkward bits: for me the worse aspect of Clojure development is the un-useful stack frames when an error is thrown. I have 99% confidence that this problem will eventually get fixed and this issue will go away. Another awkward aspect is not being able to settle down on a single development setup. I currently use:
- Emacs+swank - more experienced Clojure developers who I work with prefer this option, so I am trying to adjust
- lein repl - a favorite option for me, using a light weight editor like TextMate to edit text.
- IntelliJ with Clojure plugin - another favorite option for me, especially in projects where I am also working on Java and/or Scala code
- David Liebke's clj repl and package manager - this is a nice option if you prefer to not work in a project-oriented mode and instead want to have packages installed on your development system that are available for working on small files, snippets, etc. no matter what directory you are working in
For me, the best bits of coding in Clojure are the uniform APIs for seqs and the wealth of existing Java libraries that make Clojure close to ideal for many kinds of applications.
I spend a lot of time coding in Clojure, Ruby, Java, Common Lisp, and Scheme. It is difficult to predict what tools will be most useful in the future but as rough edges of the Clojure experience are smoothed out, Clojure has the real possibility for being a reasonable choice for almost all of my development.
Sunday, July 11, 2010
The Aleph asynchronous server
Zach Tellman implemented a Clojure rapper for the Java Netty asynchronous server that looks very nice (I have only played with it on my laptop, no stress tests).
I experimented with Node.js last month but Aleph looks like a better fit for me (preferring to work in Clojure instead of Javascript).
I experimented with Node.js last month but Aleph looks like a better fit for me (preferring to work in Clojure instead of Javascript).
Friday, June 25, 2010
Two interesting projects: clj and clj-plaza
I am travelling and working, so not too much time to kick the tires on either of these projects yet.
Alex Miller provides a good introduction to Clojure and clj-plaza. This package by Antonio Garrote looks like a very nice wrapper for several RDF data stores. I have installed clj-plaza but I am waiting for an evening when I have several hours to really kick the tires with several different data stores like 4store, AllegroGraph 4, etc.
I installed David Liebke's clj repl and package manager today. It looks like a useful addition to developing in IntelliJ or swank-clojure.
Alex Miller provides a good introduction to Clojure and clj-plaza. This package by Antonio Garrote looks like a very nice wrapper for several RDF data stores. I have installed clj-plaza but I am waiting for an evening when I have several hours to really kick the tires with several different data stores like 4store, AllegroGraph 4, etc.
I installed David Liebke's clj repl and package manager today. It looks like a useful addition to developing in IntelliJ or swank-clojure.
Labels:
package management,
RDF,
repl
Subscribe to:
Posts (Atom)