I gave a talk on Clasp and my Chemistry at Google in Cambridge Mass last week

Here is the link for the talk.

This talk describes our unique approach to constructing large, atomically precise molecules (called “Molecular Lego” or “spiroligomers”) that could act as new therapeutics, new catalysts (molecules that make new chemical reactions happen faster) and ultimately to construct atomically precise molecular devices. Then I describe Clasp and CANDO, a new implementation of the powerful language Common Lisp. Clasp is a Common Lisp compiler that uses LLVM to generate fast machine code and it interoperates with C++. CANDO is a molecular design tool that uses Clasp as its programming language. Together I believe that these are the hardware (molecules) and the software (the CANDO/Clasp compiler) that will enable the development of sophisticated molecular nanotechnology.

For more info see: https://chem.cst.temple.edu/directory/faculty/schafmeister/

What a great place Google was! My host, Martin Cracauer was fantastic, he made me feel really, really welcome and made sure that the talk would be recorded and put up on the web. He arranged it so that I could spend the afternoon talking with him and Doug and James, two Lisp/compiler gurus at Google. He also gave me a tour of Google, it was great.

8 thoughts on “I gave a talk on Clasp and my Chemistry at Google in Cambridge Mass last week

  1. Great talk and amazing potential, Christian! I’m curious if, when you moved from Python to Lisp you took a look at other expressive languages – specifically Rebol and Red (a Rebol-like pl -RedMonk ranks Rebol right at the top) or you went straight to CL because you were familiar with it.

    When you started this work I’m guessing there was not a lot of choice if the criteria was maximum expressiveness _and_ you wanted C++ interop with minimal fuss, but recent work on Rebol adds a bi-directional C++ extension mechanism (a lot nicer than the typical FFI) added to it. Red promises close to C speed by including Red/System which is a Red dialect roughly equivalent to C, but with the look and feel of the higher level language. It is interpreted, compiled and will include a JIT when all is done.

    I’m hoping that the molecular Lego direction you are pioneering will come to these languages as well since there are some people that still get put off by too many parentheses (not me, but I see it enough) and it would be a shame to have that as a roadblock to advancement in the field you’re opening up.

    Again, fantastic work.

    • Adrian, thanks for your comments! Regarding languages – I’ve programmed in a lot of them over my almost 40 years as a programmer and Common Lisp only for four years. If a language doesn’t have Common Lisp like macros then I’m no longer interested in writing a lot of code in it. Code without macros takes a lot of time to debug and maintain and macros give you a way to write code that writes code for you. That’s why I went with Common Lisp. You can really only implement Common Lisp like macros in an S-expression based language and Common Lisp is the best, most complete example of an S-expression based standard language that there is.

      I’m not implementing a new language to attract people to it. I’m implementing a compiler that generates fast native code to solve really hard problems in materials and molecular design. I also have to use legacy C++ code so I need to hook C++ libraries into it . A C++ template programming based binding library will be faster than any other language interoperation approach there is. Clasp, Python and Lua are the only languages that have C++ template programming based bindings to C++. So those are the choices: Python, Lua or write my own.

  2. In your talk you mention that you use Maxima to calculate a jacobian. Have you looked into automatic differentiation? I believe this would be a better approach because it needs less terms than an explicit formula for the derivative.

    I understood this paper: http://www.cs.berkeley.edu/~fateman/papers/ADIL.pdf but unfortunately it only explains derivations with respect to one variable. The stalingrad system http://www.bcl.hamilton.ie/~qobi/stalingrad/ is too sophisticated for me to work with.

    • Hmm, thanks – I’m not really sure what automatic differentiation is – I’ll have to investigate it further. Thank you for the references! Currently what I do is I wrote code that uses Mathematica to generate analytical symbolic derivatives and then it repeatedly gathers common subexpressions until no more are found and then it applies some transformations to reduce reciprocal and square root calculations. Then it spits out the simplified stream of steps as C code. It is pretty efficient when I compare it to hand written code that calculates the same derivatives. I’m not sure if what I did was new or not (probably not) but it sure was useful. I was able to cook up some special restraint functions that ensure that stereocenters and double bonds don’t flip into the wrong conformations.

  3. Really amazing talk. Very inspiring how you could find time and energy to take the best possible programming choice to do your research.

    If only other mortals like us can put in as much effort. Very often, researchers make the mistake of choosing a system programming language (like C or C++) to build a programming architecture, which then tremendously constrains the possible future developments in research.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s