A piece of intertube about the Clojure programming language, algorithms and artificial intelligence.

Thursday, October 18, 2012

An Emacs minor mode for the ClojureScript compilation

When programming with ClojureScript, one has to lunch "lein cljsbuild auto" to automatically compiles its ClojureScript sources. It is convenient but a problem remains: the output of the compilation process must be manually read to see if any errors or warnings occur.

To solve this problem I programmed a simple minor mode for Emacs. If you start the cljsbuild command in a terminal buffer, it will watch the ouput and popup the window if an error or a warning occurs. It can also automatically hide the process when the compilation succeed, so that you are able to concentrate on what matters, the code.

It's available on Marmalade or Github.

Feedback and patches are welcomed!

Wednesday, May 2, 2012

Implementing a Lisp

To extend my knowledge and to have a better understanding of the Lisp's foundations, I implemented a simple Lisp in C. It supports symbols, integers, a few primitives, anonymous functions, closures, macros and garbage collection. The implementation follows the KISS principles and is around 1400 lines of code.


Discussion: http://news.ycombinator.com/item?id=3919685
Code: https://github.com/kototama/kml

Thursday, February 23, 2012

Emacs key bindings for Lisp programming

I finished reading Learning GNU Emacs, Third Edition this week. The edition is from 2004 but the book has aged well. All essential concepts, modes and key bindings are presented. The Emacs documentation system is also explained, which is useful to know if you want to further extend your knowledge once you read the book. One chapter is an introduction to Emacs programming with Emacs Lisp. It gives the basis to start and explains how to implement a simple major mode. Of course since 2004, the Emacs ecosystem has changed so you won't find something on Magit mode (for Git) or on the Emacs Lisp Package Archive but if you are not an expert Emacs user, you will learn from reading it.

One chapter is on programming modes and Lisp key bindings are presented. Even if you don't use paredit (and really you should - just take a few minutes to learn its key binding) many commands are available to work with S-expressions. Here is one table of the book that illustrates them:

Structurally editing S-expressions gives an intense satisfaction and will make you regret Lisp syntax whenever you have to program with an another language family.

Tuesday, February 14, 2012

js2-mode fun


In Emacs with the JavaScript js2-mode...



No side effects? How bad can THAT be :-) ?



Followers