Settings

Theme

Ask HN: clojure and JVM

4 points by dkd 16 years ago · 4 comments · 1 min read


Is there quick way to start clojure + JVM? I would like to start with simple GUI and then move to serial port manipulation. Then to connecting database. My background is electronics and I have never use java before. Any help is appreciated.

gtani 16 years ago

Holloway book is excellent, and only $22 from a monstrously large online seller!

http://www.amazon.com/Programming-Clojure-Pragmatic-Programm...

radu_floricica 16 years ago

For what you want a java tutorial is the simplest thing. Then all you have to do is translate the syntax, eg System.currentTimeMillis() becomes (System/currentTimeMillis). And of course the briefest tutorial of lisp/clojure, just enough to learn to define a function.

Why? First because both GUI and serial manipulations are java things, not clojure. You'd have to learn the java parts anyways.

Then why stick to clojure? Actually, there is a great benefit to this: the REPL. For what you want, it will be much easier to just type things in the console and see if they work. I'd go as far as to say you should learn clojure syntax first, and then go through the java tutorials tying the examples in clojure. For both GUI and serial comm it'll be easier to learn this way.

edit: Holloway's is an excellent book, but I think in this case it's a bit of an overkill. It's worth buying anyways, just to have it for reference.

ajuc 16 years ago

Try eclipse + plugin to write in clojure - it gives you interactive console to explore clojure.

Download eclipse, then install: http://code.google.com/p/counterclockwise/wiki/Documentation

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection