Brian Carper writes about Clojure, Lisp, Vim, and Ruby, including a series on building an RPG in Clojure.
HN links his post comparing keyword arguments in Ruby, Clojure, and Common Lisp, and his Clojure game development writing.
In any language you can build a interpreter/compiler for any other language but thats not the point. The point is that you can do random AST transformation at compiletime.
You think of macros as a kind of pay of for s-exp syntax. I have to say that even without macros I would think s-exp syntax is nicer. Sure in Ruby you can do alot when you play around with that suger stuff but this stuff often doesn't come free. See this blogpost for an example of what I mean: http://briancarper.net/blog/579/keyword-arguments-ruby-clojure-common-lisp
Depending on what you do you are writting a lot of macros. In lisp the interface to a library is almost always in a DSL style witch makes them easy to use. See this list here: http://stackoverflow.com/questions/3968055/are-there-any-clojure-dsls. In your own Application your maybe not going to need them that often depending on what you do.
What you discribe is just a macrosystem. Having macros in a language with syntax is duable (look at Dylan or Plot) but you will find that getting everything nice and easy to use is much harder then you think. If CoffeeScript has a macrosystem great. I don't really know CoffeeScript well enought. Could you provide me with some nice examples of how people use this in CoffeeScript?
If I where you I would just learn enought lisp that you can trie it out yourself.
Thanks! Same here in terms of "mostly a fun experiment". A while ago Brian Carper blogged about early attempts at developing a little RPG in clojure: http://briancarper.net/blog/520/making-an-rpg-in-clojure-part-one-of-many
His post indicated that he initially tried the "every entity is an agent" idea, and had performance problems with it - although maybe his real problem was that the entire world was a single ref, and all of the agents would bash on that ref.
Another question, do you have any kind of reverse-lookup table implementation? I see that you're using component-based entities, do you have any way to quickly query your world for entities that match some arbitrary criteria, rather than iterate over all entities in the entire world? I ask because my game idea would involve potentially tens of thousands of entities, and I'm trying to figure out a way to build game logic mini-systems that can quickly find a subset of game entities and perform some function on them. For example "In the spring time find all fruit-bearing trees of a minimum age and spawn unripe fruit on them", or "every 15 seconds find all poisoned characters and deduct 1 health point"
Mmm, I've never used Ruby or Rails professionally, so I can't really speak to that. Prior to Clojure, I mostly worked with C++, Java, C#, and Python.
At its core, Clojure is basically just data and functions. Once the switch flipped in my mind, I found that to be simpler and more straight forward than any of the languages I worked with before.
When the majority of your code is side-effect-free, pure functions (and Clojure makes it very easy to structure your code this way), it becomes very easy to reason about. And very easy to test, with minimal ceremony!
P.S. When I was learning Clojure, I kinda devoured all the resources I could find. A couple interesting looks at the language from the perspective of Rubyists:
http://briancarper.net/blog/536/clojure-from-a-ruby-perspective
http://confreaks.tv/videos/rubyconf2009-clojure-for-ruby-programmers
>Python..is immensely more readable than..Lisp
fwiw, it is immensely easier to build a parser for (= z (+ y x)) than for z=x+y
you might ask, why should that matter ?
Ad outside the eyeglass store:
why do we have ears ?
so we can wear spectacles!
The point being, we first evolved as creatures with ears and later on devised spectacles so we could wear them over the ears. But we've now taken the ears so much for granted we think of spectacles as the innovation! Parsing should have been the whole point, but we now prize readability. We then add fluffy monikers like "serious perseverance" and "Lisp dumbness" to further tilt the balance in our favor.
http://briancarper.net/blog/442/lisp-syntax-doesnt-suck
Someone (sorry for not noting your name) suggested dimming/graying the parentheses in lisp modes and gave this elisp snippet to do it. I find that I prefer reading lisp with dimmed parentheses.
(defface paren-face
'((((class color) (background dark))
(:foreground "grey20"))
(((class color) (background light))
(:foreground "grey70")))
"Face used to dim parentheses.")
(add-hook 'scheme-mode-hook
(lambda ()
(font-lock-add-keywords nil
'(("(\\|)" . 'paren-face)))))
I also came across a blog post[1] which includes a slightly more complete solution.
http://briancarper.net/blog/492/
I don't see any resistance to change; it's more like Clojure folks are generally going to demand that changes be unequivocally positive. I remember the fixed-position args in Scala function literals being particularly irritating in certain circumstances; whatever one's gripe about the chosen sigils, being able to write #(%2 %) is damn handy.
This widespread Scala/Clojure rift is a myth AFAICT, outside of various spitball fights on Twitter.
Oh, and if you want to have userland reader macros in Clojure, have at it: http://briancarper.net/blog/449/clojure-reader-macros ;-)