Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Thursday, April 23, 2009

[Programming] Sometimes DSLs or macros are difficult

In Notes from Empirical Studies of Programmers, Second Workshop, and some ideas, aran concluded:

Normally better program comprehension means easier program modification. I think DSLs break this: They increase program comprehension, but I bet they make (some) program modifications much more difficult due to the lack of tool support in the most DSLs.


I agree the lack of tool support for most Domain-Specific Languages (DSLs) makes difficult to handle in one way or another.

Just yesterday I wanted to search for the definition of a function and failed at the first try. It happens that the function was generated with a macro in Emacs Lisp. Had it been defined as a normal function, it would be much easier for me to locate it in the source file.

Wednesday, October 15, 2008

[Programming] Trying Clojure

Clojure is a new Lisp dialect created by Rich Hickey.

It is interesting to me because it runs on JVM with a large collection of Java libraries directly available to Clojure and keeps most of the best features of Lisp.

While Common Lisp supports functional programming, it supports other paradigms of programming quite well. Clojure only supports functional programming. It does not support object-oriented programming in the style of Common Lisp or Java. So it will be challenging to learn.

Its software transactional memory and immutable data structures make Clojure very powerful in concurrent programming.

You can find links at the official homepage to the tarballs, subversion repository, IRC channel and newsgroup. Besides the official homepage, the Clojure wikibook is also very helpful.

Clojure is under fast development and most users are using its subversion repository directly. Slime integration is a must if you are comfortable at using GNU Emacs. You should also be familiar with the Java library or have the API available to you, as Clojure depends on the Java platform for many functionalities.

The traditional REPL environment is a bliss to development and debug, but the error messages certainly need a lot of improvement to be helpful. You also need knowledge of the JAVA API and even Clojure implementation details to decipher such messages.