SBCL: A Sanely-Bootstrappable Common Lisp (2008) [pdf]
100 points by pabs3 10 hours ago | 64 comments

vindarel 6 hours ago
Previously:

SBCL (16 days ago) https://news.ycombinator.com/item?id=47140657 (107 comments)

Porting SBCL to the Nintendo Switch https://news.ycombinator.com/item?id=41530783 (81 comments)

An exploration of SBCL internals https://news.ycombinator.com/item?id=40115083 (106 comments)

Arena Allocation in SBCL https://news.ycombinator.com/item?id=38052564 (32 comments)

SBCL (2023) https://news.ycombinator.com/item?id=36544573 (167 comments)

Parallel garbage collection for SBCL [pdf] https://news.ycombinator.com/item?id=37296153 (45 comments)

SBCL 2.3.5 released https://news.ycombinator.com/item?id=36107154 (31 comments)

Using SBCL Common Lisp as a Dynamic Library (2022) https://news.ycombinator.com/item?id=31054796 (67 comments)

etc

reply
meken 2 hours ago
> Current Common Lisp implementations can usually support both image-oriented and source-oriented development. Image-oriented environments (for example, Squeak Smalltalk]) have as their interchange format an image file or memory dump containing all the objects present in the system, which can be later restarted on the same or distinct hardware. By contrast, a source-oriented environment uses individual, human-readable files for recording information for reconstructing the project under development; these files are processed by the environment to convert their contents into material which can be executed.

Am I reading this right that people can (and do??) use images as a complete replacement for source code files?

reply
kqr 2 hours ago
I imagine some systems may start out by tinkering with definitions in the REPL in the live system, and then as it grows, the best definition of the system is found in the current state of the REPL, rather than any more formal specification of the system – including by source code.

At some point maybe the system state will be captured into source code for longer term maintenance, but I can totally see the source code being secondary to the current state of the system during exploration.

After all, that's how I tend to treat SQL databases early on. The schema evolves in the live server, and only later do I dump it into a schema creation script and start using migrations to change it.

reply
dfox 2 hours ago
All the magic of Smalltalk is in the development tools that work by means of introspection into the running image, writing source code in text files causes you to lose all that. Add to that the fact that Smalltalk when written as source files is quite verbose.

Smalltalk does have standard text source file format, but that format is best described as human-readable, not human-writable. The format is essentially a sequence of text blocks that represent operations done to the image in order to modify it to a particular state interspersed with "data" (mostly method source code, but the format can store arbitrary stuff as the data blocks).

One exception to this is GNU Smalltalk which is meant to be used with source files and to that end uses its own more sane source file syntax.

reply
blenderob 2 hours ago
> Am I reading this right that people can (and do??) use images as a complete replacement for source code files?

Images are not replacements of source code files. Images are used in addition to source code files. Source code is checked in. Images are created and shipped. The image lets you debug things live if you've got to. You can introspect, live debug, live patch and do all the shenanigans. But if you're making fixes, you'd make the changes in source code, check it in, build a new image and ship that.

reply
tzot 2 hours ago
Maybe you understood image as in photo-image instead of image as in memory-image (like disk-image); a glorified memory dump, more-or-less.
reply
anonzzzies 4 hours ago
SBCL is lovely and very well optimised. Been using it for many personal projects as it just works and it is so easy to work with and debug. I cry a lot when I have to use 'modern' things. But those make money, they are just far worse.
reply
praptak 9 hours ago
SBCL seems pretty actively developed. A proposal for coroutines implementation appeared recently and AFAIK it is being actively discussed and improved upon.
reply
TurboHaskal 8 hours ago
And arena support, and a parallel GC... there's always something exciting and promising coming up.

The proprietary implementations are also quite good.

reply
cardanome 4 hours ago
Arena support would make it amazing for game dev. Yes please!
reply
vindarel 25 minutes ago
reply
pjmlp 6 hours ago
To note that you will find arena like stuff on old Lisps, like those from Xerox, TI and Genera.
reply
geospeck 8 hours ago
Do you have a link to the proposal and the discussion? I am quite interested to see the implementation details. Thanks!
reply
atgreen 7 hours ago
reply
gibsonf1 3 hours ago
Incredible! Is this ready for at scale production use?
reply
atgreen 2 hours ago
No. I have yet to propose the patches formally. The SBCL maintainers are reviewing the high-level proposal (on my blog) first. You can try the implementation, however. There's a pointer to the repo/branch on my blog. I need to build a proper benchmarking framework and publish some real numbers that people can reproduce before I am confident enough to submit the patches for review.

Let me know if you try it out. I would love some feedback (via github)

reply
ivanb 6 hours ago
This is fantastic! Godspeed.
reply
Antibabelic 8 hours ago
Here's an SBCL coroutines talk at the European Lisp Symposium from 2024: https://www.youtube.com/watch?v=S2nVKfYJykw
reply
praptak 8 hours ago
Yeah, so I believe that this proposal kind of petered out at proof of concept phase but the author of the one being discussed references it.
reply
yacin 23 minutes ago
it came up in the SBCL mailing list as well, and its author has been commenting there as well. seems like it has some legs! would be a very nice feature to have.
reply
rusakov-field 2 hours ago
As someone who fell in love with Lisp with Scheme and SICP, I think I agree with the push for minimalism and a bit dubious about the changes in Lisp-2 ...

Is that only a recency bias ? Because I learned Scheme first ? When I try CL I find my mind resisting some things due to purely elegance reasons.

If someone put a gun to my head and asked me for a deliverable quickly I will go with CL to save my life of course, but for my own personal pleasure I will always prefer Scheme.

reply
tmtvl 56 minutes ago
As someone who also first got introduced to Lisp through SICP and Scheme, I don't really care about Lisp-1 versus Lisp-2, but I don't much fancy minimalism. I switched to CL for the type declarations and just got used to funcall and number sign+apostrophe; and minimalism means the things a larger language would provide out of the box (say, hash tables) you either need to write yourself or find a library for. Hence why various Schemes (Guile, Gauche, Chicken) have a ton of libraries beyond the standard.

In fact, I'd say CL is too minimalist, hence CLDR (a bit like SRFIs) and various libraries which form a sort of unofficial extended core (Alexandria, Bordeaux threads, CL-PPCRE,...)

reply
krishSingaria 8 hours ago
I am learning scheme(dr racket), which is i think derived from lisp, what is this actually used for and do people build anything with lisp???
reply
pjmlp 6 hours ago
Yes, people do build anything with Lisp, that is why there are at least two commercial Common Lisp systems around, LispWorks and Allegro Common Lisp.

Google Flights is an acquisition of a company using Lisp, ITA Software, they even have a Lisp guide.

https://google.github.io/styleguide/lispguide.xml

In Portugal, Siscog used to be a Lisp shop, no idea nowadays.

Then you have the Clojure based companies, where Datomic and Nubank are two well known ones, even if not a proper Lisp, still belongs to the same linage.

reply
vindarel 6 hours ago
Yes, SISCOG is still kicking. From last year's European Lisp Symposium: https://www.youtube.com/watch?v=hMVZLo1Ub7M
reply
pjmlp 6 hours ago
Obrigado. Thanks.

I was aware of the company when I was still living in Lisbon, a few decades ago.

reply
guenthert 31 minutes ago
Not sure what they are using now, but fairly recently the folks over at grammarly were still using Common Lisp (CCL and SBCL) among other technologies:

https://www.grammarly.com/blog/engineering/running-lisp-in-p...

reply
tmtvl 5 hours ago
Well, besides pgloader, which achieved a 20~30x speedup via a rewrite from Python to Common Lisp (<https://tapoueh.org/blog/2014/05/why-is-pgloader-so-much-fas...>), there is also this little organisation called NASA which has a collection of theorem proving libraries called variously PVSLib or NASALib (<https://github.com/nasa/pvslib>).

There is a lot more as well, of course, but these two are clear examples of Common Lisp being used in 'the real world'.

reply
atgreen 7 hours ago
This very website that you are using right now, Hacker News, runs on sbcl.
reply
chuckadams 3 hours ago
It runs on Arc, which itself is implemented with SBCL.
reply
vindarel 22 minutes ago
It switched from Racket in late 2024. Context and discussion: https://news.ycombinator.com/item?id=44099006 (9 months ago, 435 comments)
reply
Keyframe 8 hours ago
*I am learning scheme(dr racket), which is i think derived from lisp*

it _is_ Lisp. Namely lisp-1, vs what one would consider lisp like common lisp would be lisp-2. Difference mostly being that in lisp-1 everything's in single namespace, whereas lisp-2 has more. So, in scheme you cannot have a function and a variable have the same name. In common lisp you can. Other diffs being (syntactically) passing functions and executing them. There are other things, of course, but not that big of a deal. Scheme is simpler and suitable for teaching / getting into lispen. I'd argue it might also be a rather well-equipped DSL.

reply
bitwize 7 hours ago
"Emacsen" I can understand by analogy with plural forms like "oxen". "Lispen" is new to me.
reply
KineticLensman 4 hours ago
At Uni we had a stable of Vaxen.
reply
ninalanyon 43 minutes ago
It gets confusing if you speak a Scandi language where -en is the masculine definite article so Emacsen would mean the Emacs, Lispen = the Lisp etc.
reply
mkreis 8 hours ago
Scheme is mostly used for teaching, but there are many production applications out there written in Lisp (Emacs for example). Also I'd like to mention Clojure, which is "lispy" and used by big cooperations.
reply
e12e 5 hours ago
Current racket is running on top of chez scheme - which is maintained by Cisco - and reportedly extensively used in commercial products (router firmware/os etc).

https://cisco.github.io/ChezScheme

reply
drob518 2 hours ago
It was brought into Cisco to do that but the project was eventually shelved, which was a shame because the prototypes delivered some really interesting reliability features. Most Cisco hardware products run firmware written in C. Management systems are often Java and (increasingly) Go. Clojure is used for one of the security product lines, but that was developed as a startup that was later purchased by Cisco. One of the management systems, NSO, is written in Erlang (brought in through the tail-f acquisition). There are certainly a lot of people in Cisco that understand the power of Lisp (I was one), but they are spread out and surrounded by people that just want to push whatever the latest thing is (now Go). C.f. the blub paradox and “worse is better.” They have a lot of legacy code that was written over the last 30 years that powers their devices, and that’s all in C.
reply
mark_l_watson 6 hours ago
Lisp languages are niche, but frequently used as seen in the great projects mentioned in this thread. Since 1982, I have been employed about 20% of my time using mostly Common Lisp and for a few years Clojure. Racket is a great language and system for learning and having fun, so, have fun!
reply
vindarel 7 hours ago
Examples with screenshots: http://lisp-screenshots.org/

Some companies: https://github.com/azzamsa/awesome-lisp-companies/ (Routific, Google's ITA Software, SISCOG running resource planning in transportation, trading, big data analysis, cloud-to-cloud services, open-source tools (pgloader, re-written from Python), games (Kandria, on Steam and GOG, runs on the Switch), music composition software and apps…

More success stories: https://www.lispworks.com/success-stories/

I myself run web-apps and scripts for clients. Didn't ditch Django yet but working on that.

reply
meken 2 hours ago
> what is this actually used for

If you're interested in LeetCode, Racket is one of their accepted languages.

reply
krishSingaria 5 hours ago
Thanks everyone for opening my mind, actually it is being taught in a core course at my college, and it is very different course form others that i have taken. course teaches feature of lisp how they are unique and useful. Also we are solving simple questions like Fibonacci, or number patterns, list pattern, recursion vs iterative etc.
reply
pjmlp 4 hours ago
Go through one of the more famous books to learn Scheme, in case you haven't yet been introduced into it.

"Structure and Interpretation of Computer Programs"

https://web.mit.edu/6.001/6.037/sicp.pdf

See https://planet.racket-lang.org/package-source/neil/sicp.plt/... as well.

reply
krishSingaria 41 minutes ago
That is the same book, prof is going through the course.
reply
tmountain 8 hours ago
Often as a DSL (domain specific language) for extending applications at runtime and/or configuration. I wouldn't start a "serious" project in Lisp today; meaning, a project with investment behind it, but Lisp can be a real joy to work with, and I've used Clojure for countless hobby projects. Clojure, in particular, has lots of deployments around the tech industry, and it's the foundation of the Jepsen DB test suite, Datomic (an immutable DB), and Metabase, as a few examples. Walmart has a non-trivial amount of Clojure running in prod as well.
reply
mapcars 8 hours ago
I used a few different lisps for pet projects and honestly today for me the biggest problem of lisps is the typing. ADTs (and similar systems) are just super helpful when it comes to long term development, multiple people working on code, big projects or projects with multiple pieces (like frontend+backend) and it helps AI tools as well.

And this in not something lisps explored much (is there anything at all apart from Racket/typed dialect?), probably due to their dynamic nature. And this is why I dropped lisps in favour of Rust and Typescript.

reply
vindarel 7 hours ago
+1 to explore Coalton. It's also talked about on this website and often by its authors.

Links to Coalton and related libraries and apps (included Lem editor's mode and a web playground): https://github.com/CodyReichert/awesome-cl/#typing

reply
pfdietz 6 hours ago
SBCL has fine type checking. Some is done at compile time -- you get warnings if something clearly can't be type correct -- but otherwise when compiled with safety 3 (which people tend to make the default) types are checked dynamically at run time. You don't get the program crashing from mistyping as one would in C.
reply
mapcars 3 hours ago
> You don't get the program crashing from mistyping as one would in C.

Sorry but I don't compare to C anymore, I want the same safety as in Rust or Typescript: exhaustive checks, control-flow type narrowing, mapped types and so on. Some detection at compile time is not enough, since there is a way to eliminate all type errors I want to eliminate them all, not some.

reply
guenthert 60 minutes ago
Why stop there? Why not demand proof of correctness? After all, that's now within reach using LLMs producing the formal specification from a simple prompt, right?

SBCL does a fine job in detecting type mismatches within the frame of ANSI Common Lisp, not Haskell. While I would agree that a strict type system eases long term maintenance of large systems, for "explorative computing", proof-of-concepts, RAD or similar that tends to get in the way. And if such proof-of-concept looks promising, then there is no shame in rewriting it in a language more suitable for scale and maintenance.

reply
streetfighter64 3 hours ago
> You don't get the program crashing from mistyping as one would in C.

Uh, isn't that exactly what happens with runtime type checking? Otherwise what can you do if you detect a type error at runtime other than crash?

In C the compiler tries to detect all type errors at compile time, and if you do manage to fool the compiler into compiling badly typed code, it won't necessarily crash, it'll be undefined behavior (which includes crashing but can also do worse).

reply
pfdietz 2 hours ago
> Uh, isn't that exactly what happens with runtime type checking?

No, it raises an exception, which you can handle. In some cases one can even resume via restarts. This is versus C, where a miscast pointer can cause memory corruption.

reply
brabel 7 hours ago
You can run Coalton on Common Lisp. It has a type system similar to Haskell’s. And interops very well with pure Common Lisp. It also modernizes function and type names in the process so it makes Lisp more familiar to modern developers. I tried it in a small project and was impressed.
reply
larsbrinkhoff 8 hours ago
Jonathan Blow: "It’s about a compiler written in Python FFS."
reply
phtrivier 7 hours ago
Missing the joke here. The pdf if about a Common Lisp compiler, written in Common Lisp, C, and assembly for good measure.
reply
massysett 6 hours ago
I don’t get it either. The CMUCL compiler is named Python, no relation to the prominent language. Not sure that’s what this was about though.
reply
pfdietz 6 hours ago
That was his confusion.
reply
bmacho 6 hours ago
Seems some rando posted something factually false on twitter, got corrected and apologized.
reply
Antibabelic 7 hours ago
reply
nilamo 5 hours ago
Is there any way to see the whole conversion, and not one specific reply in the middle of it?
reply