Nov
17
2008
I often find myself longing to be able to use Clojure, a very enticing lispy language that runs on the JVM.
I could possibly be using it right now in my dissertation research. It has the promise of dynamic languages, functional programming, almost-as-cool-as-Erlang concurrency, JVM performance, and Java library soup. It could be so awesome. A few months ago I started briefly down this road, unaware that…
Clojure sucks. Not generally, but it sucks for DSP. More specifically, Java and therefore Clojure has no real support for complex numbers. In order to do serious DSP, you need native syntactic, semantic, and performance support for complex numbers. Java has none of the above. Older versions of C didn’t have syntactic or semantic support, but the performance of using arrays was plenty fast. Not so in Java, at least not to the extent necessary to override the lack of syntactic and semantic.
So someday, when I’m writing general purpose code again and not high performance DSP code, I will have an opportunity to use Clojure, and I think that will make me very happy. By then the book will be out of beta. The community will be in full swing. There will be awesome libraries. Children will play in pristine parks with formerly-ravenous ravens.
In the meantime, if anyone sees the scene change, do let me know.
3 comments | tags: audio, clojure, concurrency, cs, dsp, dynamic, erlang, java, jvm, phd, ruby
Jun
28
2008
Word on the street is emacs is teh hotness for lisp hacking. I’m taking a serious look at clojure, which is a lisp that incorporates a lot of what I like about erlang and runs on the JVM. So naturally, I want to see if emacs is all that hype.
I’m having a problem though. I can’t find the secret island of emacs howtos, where someone has written a nice one-page article on how to do clojure (or any lisp) hacking in emacs and take advantage of the most awesome good parts. I realize that covering all the cool things would probably take a few hundred pages. I don’t have time to learn all the cool things anyway. I just need the most cool things. The gateway drugs if you will.
In specific, I’m looking for:
- Syntax highlighting
- Automatic indentation
- Paren matching
- Have a REPL window
- Evaluate this thing under the cursor
And it should all be automatic. I shouldn’t have to remember and type 80 characters. The syntax highlighting/indentation should be automagic, and the REPL should be a few memorable keystrokes or in a menu (I don’t want to type M-X up up down down left right left right B A every time I want a REPL).
I’ll bake a loaf of sourdough for anyone that writes an article for the emacs+clojure newbie.
3 comments | tags: clojure, emacs, lisp, repl
Apr
9
2008
Thanks to Tene for pointing this out to me. It seems like a really useful tool. I am playing with Clojure in my spare time (ha!), and its repl doesn’t have readline support (or anything like it). The clojure website suggests some Java readline-like jar, but I like this solution much better. I just made a script to wrap clojure in rlwrap, and it’s working great.
$ cat ~/bin/clojure
#!/bin/sh
exec rlwrap java -jar ~/src/clojure/clojure.jar
no comments | tags: clojure, readline, wrap
Apr
6
2008
Levi pointed me to a presentation on Clojure, “a dynamic programming language for the JVM”. That’s actually a pretty bland description. I’d describe it at least as a dynamic functional concurrency-oriented lispy language for the JVM. The presentation was interesting, though I wish I had been able to follow the ant colony demo (it’s audio-only).
It awakened the oft-recurring “functional floundering” feeling. I’ve written a semester worth of scheme in a programming languages course. I’ve read the Erlang book and written a little Erlang code. I recently went through a graduate course in programming languages with emphasis on denotational semantics. I understand the lambda calculus, functional programming, etc. But I feel completely stymied whenever I think about actually programming in a functional language.
I’m not sure what the root is, but I’m sure it boils down to lack of practice. That undergraduate course aside, I haven’t had any practice. And since that course was very handholding (too much in retrospect), I don’t feel like I took any practical skill away from it. Yet I feel that in the future functional programming for concurrency will be important, even if I’m not convinced it will be essential.
So I don’t have time right now to really rectify the situation, but that doesn’t stop me from wondering—how does one learn practical functional programming? What problem sets do you work through to get the needed practice? I suppose the question can apply to learning any new language, but there is much paradigm carry-over between imperative languages (and probably between functional languages). Are there certain problems that will aid that paradigm shift? If you feel like you’ve developed functional chops, in any functional language, I’d like to hear in the comments how you got there, what you’d change in retrospect, and your advice for me and others like me.
1 comment | tags: clojure, cs, erlang, functional, lisp, programming, scheme