Get Started. It's Free
or sign up with your email address
What is SBCL? by Mind Map: What is SBCL?

1. How does it work?

1.1. Compiler

1.1.1. Source -> IR1

1.1.2. IR1 optimizations

1.1.3. IR1 -> IR2

1.1.4. IR2 optimizations (few -- we could do a lot more here, but the gains are generally smaller than working on IR1, so...)

1.1.5. IR2 -> machine code

1.2. Runtime

1.2.1. signal handling

1.2.2. GC

1.2.3. threads

1.3. Worked examples

1.3.1. Adding a new VOP

1.3.2. Adding a new DEFOPTIMIZER DERIVE-TYPE

1.3.3. Adding a new DEFTRANSFORM

2. SBCL is a high performance native compiler for ANSI Common Lisp.

2.1. What is SBCL?

2.1.1. One implementation among many.

2.1.2. ...but the most popular open source implementation!

2.1.3. Open source: public domain / MIT and BSD licenses.

2.1.4. CMU heritage

2.1.5. Current developers

2.1.6. Multiplatform, but best on Linux. OS X ok except for threads. Runs on Windows too, and I know people use it for production there... but Windows is still a second-class citizen. Solaris, *BSD, etc also supported.

2.1.7. Competitive with C and C++

2.1.7.1. Usually within a small percentage factor, sometimes even better.

2.1.7.2. Benchmark game is bad.

2.1.7.3. What counts is the code you are able to produce.

2.1.7.4. Admittedly newbies need some time to learn what is expensive and what not.

2.1.8. Examples

2.1.8.1. Arithmetic

2.1.8.1.1. Generic version.

2.1.8.1.2. Fixnum version.

2.1.8.1.3. Single-float version.

2.1.8.2. Object instantiation

2.1.8.3. Slot access.

2.1.8.4. Agressive inlining and PE.

2.1.9. Users -- both private and corporate

2.2. What is Common Lisp?

2.2.1. ANSI Standard came out just before Java

2.2.1.1. Does that make it old or not-so-old?

2.2.1.2. CLTl1 & 2 older

2.2.2. Not just Scheme with funny spellings

2.2.2.1. Lisp-2 (or -n)

2.2.2.1.1. Humans are very good at this sort of contex-sensitivity, it turns out. Even though you can make a silly example like (defun listlist (list) (list list)) in practise being able to name local variables without worrying about shadowing global function names is a boon -- no need for contractions like lst.

2.2.2.1.2. If you ask me, it's Lisp-4: variables, functions, tags, and blocks.

2.2.2.1.3. Silly people may also count classes, throw tags, etc -- but they are not lexically scoped entities, so I don't think they count.

2.2.2.1.4. Operators are either named or LAMBDA-expressions. You never have (((foo))) -- but instead (funcall (funcall (foo))). I think this is a good thing.

2.2.2.2. Hygiene? Nope. I think hygiene is good, and implicit phasing in particular appears to solve actual problems -- but lack of hygiene isn't an issue. Seriously. Lack of implicit phasing... let's not go there right now -- but I can talk about that later to those interested.

2.2.2.3. No CALL/CC -- but UNWIND-PROTECT, and a number of libraries implement CALL/CC via a code-walker.

2.2.2.4. Large standard library. (Think a huge bunch of SRFIs that every single implementation implements.)

2.2.2.5. Native compilation is the typical. Interpreters exist, but everyone qualifies them as exceptions.

2.2.2.6. CLOS and MOP

2.2.2.7. Conditions and restarts

2.2.2.8. Programmable reader

2.2.2.9. The funny names come from older dialects like Interlisp, maclisp, and Zetalisp.

2.2.2.10. Compiler macros

2.2.3. A mudball of strength. Buddha has hairy armpits and laughs!

2.2.4. Libraries: we have a lot of them, and a nice way to install them.

2.2.4.1. Demo Quicklisp.

2.2.4.1.1. Hunchentoot

2.2.4.1.2. cl-ppcre

2.2.4.1.3. cl-javascript

2.2.4.1.4. cl-opengl