December 09, 2004

cheval noir

Charlemagne is a genetic programming tool that is written in both Python and Lisp [via gavin]. The uneasy truce between the two languages seems to have come about when clisp was embedded in Python.

From the manual:

Here is an example of an interactive session defining a complex deviance calculating function:

>>> lsp.interactive()
CLISP> (defvar SPEED 0.05)
CLISP> (defvar TURNS 50.0)
CLISP> (defun simulator-helper (p turns x y)
  ...>     (if (eq turns 0)
  ...>         (sqrt (+ (* x x) (* y y)))
  ...>         (progn
  ...>             (setq INPUT1 x)
  ...>             (setq INPUT2 y)
  ...>             (let ((theta (degrees-to-radians (eval p))))
  ...>                 (simulator-helper
  ...>                     p
  ...>                     (- turns 1)
  ...>                     (+ x (* SPEED (cos theta)))
  ...>                     (+ y (* SPEED (sin theta))))))))
CLISP> (defun simulator (p)
  ...>        (/ (deviance-helper TURNS 50 INPUT1 INPUT2) TURNS))
CLISP> exit
>>> cfg.configure("deviance-calculation", LISP-FUNCTION=simulator)
>>> cfg.configure("input", [[1.0,1.0], [0.5,0.5], [-1.0,-1.0], 
    [-0.5,-0.5], [0.25,-0.25],[-1.0,0.75], [0.25,-0.5], [1.0,-1.0]])
>>> cfg.apply()
Posted by jjwiseman at December 09, 2004 02:49 PM

Happy 1000th post (kinda, excluding some porting and renumbering issues).

Posted by: Aaron Brady on December 9, 2004 03:26 PM


That is one of the most disturbing things I have ever seen, definite visceral horror factor.

Posted by: Barf on December 9, 2004 03:52 PM

Heh, thanks! I noticed that when I initially posted it, and meant to go back and update it with a mention, but then I got distracted.


Posted by: John Wiseman on December 9, 2004 04:02 PM
Post a comment

Email Address:


Unless you answer this question, your comment will be classified as spam and will not be posted.
(I'll give you a hint: the answer is “lisp”.)


Remember info?