Skip to content
0:00 / 0:00

#clasp#commonlisp#llvm

Clasp: Common Lisp using LLVM and C++ for Molecular Metaprogramming

Google TechTalks

349K subscribers • 62 videos on Hallway

YouTube
  • Recommended by 9 people: 8 on Hacker News and 1 in engineering communities.
  • A classic. People kept recommending it from 2015 to 2021.
  • Presented by Christian Schafmeister
  • Linked in the descriptiondrmeister/clasp

Advanced. Deep dive for people who know the field.

51K views11 years ago9 recommendations

Programming languagesSystems programmingLisp and ClojureCompilers and interpretersPerformance and optimization

Christian Schafmeister introduces Clasp, a Common Lisp implementation built on LLVM that interoperates with C++ to design complex molecules.

Google Tech Talk June 9, 2015 (more info - click "show more") Presented by Christian Schafmeister. Introduction () The beginning () Mimicking proteins () Spiroligomers: an alternative to proteins () Applications of spiroligomers () A spiroligomer that binds Mdm2 () A spiroligomer that catalyzes a transesterification reaction () Designing large molecules () Developing a programming language for chemistry () Clasp: A Common Lisp based on LLVM () Automatic differentiation for chemistry force fields () Writing code that builds molecules () Why Common Lisp for chemistry? () Interfacing C++ with Common Lisp () Clasp: What is it? () Automated analysis of C++ code built into Clasp () How C++ is exposed to Clasp Common Lisp () What is next for Clasp? () Wrap up () Questions and answers () ABSTRACT 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. Clasp is available at: github.com/drmeister/clasp For more info see: chem.cst.temple.edu/directory/faculty/schafmeister/ More about Clasp Clasp is an implementation of Common Lisp that interoperates with C++ and uses LLVM as its backend. It is available at github.com/drmeister/clasp. The goal of Clasp is to become a performant Common Lisp that can use C++ libraries and interoperate with LLVM-based tools and languages. The first sophisticated C++ library with which Clasp interoperates is the Clang C/C++ compiler front end. Using the Clang library, Common Lisp programs can be written that parse and carry out static analysis and automatic refactoring of C/C++ code. This facility is used to automatically analyze the Clasp C++ source code and construct an interface to the Memory Pool System compacting garbage collector. The primary purpose of Clasp is to act as a performant language for scientific computing that will be used to design sophisticated new molecular devices, catalysts and therapeutic molecules based on our "Molecular Lego" technology. Clasp is a general programming language that will support many other applications. About the Speaker: Christian Schafmeister visited Google’s Cambridge, MA office to deliver the talk "Clasp: Common Lisp using LLVM and C++ for Molecular Metaprog

Why it's here

9 people recommend this

What people say. Recommended as an inspiring demonstration of building a custom Lisp compiler to solve complex molecular design problems.

u/jropin r/ProgrammingLanguages • Recommends

Clasp: Common Lisp using LLVM and C++ for Molecular Metaprogramming

616con Hacker News • Recommends

On “Making sexy molecules in PowerPoint”

So no one will mention the Clasp (Lisp on LLVM developer)? He built a language to build better, albeit not visualize, better molecules. If you are on this article, you probably will love to watch this guy. I am computer nerd and this guy makes me want to go back and study chemistry. link to this video

radicalcuton Hacker News • Recommends

On “John Carmack working on Scheme as a VR scripting language”

Unrelated to VR but still: if anyone here hasn't yet watched drmeister's talk about Clasp and his "molecular metaprogramming" project, please do. Absolutely fascinating stuff. link to this video Also recently discussed on HN: link

nabla9on Hacker News • Recommends

On “The Lisp Curse (2011)”

Lisp is programmable programming language, especially Common Lisp. It works as programmer amplifier. Better you are, more you benefit from it. I challenge anyone to watch this lecture from Christian Schafmeister and say they are not impressed: link to this video and link

golergkaon Hacker News • Recommends

On “European Lisp Symposium 2016”

link to this video This talk is even better. "C++ templates are to Commmon Lisp macros what IRS tax return forms are to poetry". I don't know both well enough to tell if it's true, but damn it's a good metaphor.

pmarinon Hacker News • Recommends

On “Ask HN: What is your favourite tech talk?”

…on 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. link to this video…

nnqon Hacker News • Recommends

On “Lisp is still a secret weapon”

If you're asking yourself what kinds of problems is a Lisp good for you should probably watch this: link to this video (A computational chemist built himself his own Common Lisp implementation because no other language available was powerful enough for his needs...) It basically boils to: if you're solving a truly new and interesting problems for which the current libraries and ecosystems don't matter that much to you anyhow (because what you do is too bleeding-edge / ahead of everyone else, so you'll write your own better stuff anyhow), than you might want to choose a Lisp. And if your problem is so bleeding-edge and exotic that you also need to build your own programming-language for it, than you mig…

girishsoon Hacker News • Recommends

On “Ask HN: Can we write a programming language for biology?”

That was my interest when I started my career, but didn’t do much on it. Bio-informatics deals with the stuff you mentioned in-silico. There’re a whole bunch of libraries for many different languages, but I’ve not come across any specific language for bio-informatics. You might find link to this video interesting, they developed a DSL in common lisp to generate C++ code using LLVM.

simioneson Hacker News • Recommends

On “Carp – A statically typed Lisp, without a GC, for real-time applications”

CLASP is a really interesting project. For one, it's created and written by a Chemistry PhD researcher (Christian Schafmeister), not someone with a traditional CS background. For another, it's one of the few languages that has ever attempted to interface with C++ at the template level - you can instantiate C++ template classes from CL, and catch C++ exceptions etc. For yet another, he does compacting garbage collection for the C++ objects used in the CL implementation, with pointer patching and everything else. There's a nice Google Tech Talk about it 0, that goes into both why he did this, and how he implemented this. 0 link to this video

justifieron Hacker News • Mentions

On “Aneurysm”

" I rarely clip aneurysms now. All the skills that I slowly and painfully acquired to become an aneurysm surgeon have been rendered obsolete by technological change. Although neurosurgery is no longer what it once was, the neurosurgeon’s loss has been the patient’s gain. " so nice to read this many of the entrenched remain so through superstition at the loss of progress, but to read someone speak highly of a practice that rendered a section of their skill set obsolete is heartening i have family who work in trauma and they condescendingly balk at my excitement over new medical technology: link link to this video personally, i look forward to bones: link

istvan__on Hacker News • Mentions

On “John Carmack working on Scheme as a VR scripting language”

Same here, I never understood Java interfaces, abstract classes, and a ton of other "features" but picking up Clojure was a breeze. I don't understand why complicating thing that supposed to be simple helps you by any mean. On the top of that, I have seen several cases when Java programmers tipped over in their own code because of the complexity that they thought they understand, except there was a particular case when it was doing something else then expected. Reasoning about Clojure (LISP) code is always easy because if you follow best practices you have small functions with very little context to understand. On the top of these, I see the ratio of LOC 50:1 (worst case even higher) for Jav…

TeMPOraLon Hacker News • Mentions

On “Whoever does not understand Lisp is doomed to reinvent it (2007)”

A small few: link . EDIT: Also, link to this video for a recent example of Common Lisp pushing the limits of science and computing in chemistry.

bloafon Hacker News • Mentions

On “Why programmers will never be the brightest and the best”

I'd argue that there are essentially two problems in computer science: 1. Math. 2. Dealing with the hardware. Virtually all the ugliness is a product of the interface between these two areas. Dealing with the hardware requires a fascination with minutiae and imperfection, while working in Math requires a fascination with generalities and perfection. The people on the math side create systems like Haskell, which let you express very abstract concepts, and reason very generally about your code, but make dealing with hardware issues difficult. The people on the hardware side use things like Forth, which is very powerful for building code that works closely with the hardware, but whose paradigms…

sedachvon Hacker News • Mentions

On “AI and Robotics in Agriculture in Japan [video]”

Check out Christian Schafmeister's research if you are interested in this: link There is a brief summary of the history of Schafmeister's approaches (and why he thinks direct copying of protein-based mechanisms from nature will not work) in this talk: link to this video

drmeisteron Hacker News • Mentions

On “Ask HN: Are you working on interesting technical problems?”

We are developing a matter compiler. We are working on designing molecular Lego to assemble them into new catalysts, therapeutic compounds, atomically precise membranes and sensors for proteins and small molecules. The goal is to make molecules that can do everything that proteins can do and that can be designed by human beings with computer assistance. We've developed a programming environment with a custom compiler and Common Lisp implementation for designing these molecules. We are looking for programmers with chemistry experience. link to this video

cracaueron Hacker News • Mentions

On “Let over Lambda – Common Lisp Book (2008)”

That is me, I'm half of that team (Martin Cracauer). If you have any questions I'd be happy to answer. If you want to learn more about the programming side of our work (not so chemical), check out our other videos. They are from programming conferences: Longer talk: link to this video Shorter one from the LLVM meeting: link (yes, the whole system is a compiler using LLVM as the last stage to make machine code from abstract assembly. The thing I always missed in SBCL)