14 ms·
Anyone here use SBCL or Common Lisp? Curious what you guys think of it.
by gautamcgoel 6y ago
Anyone here use SBCL or Common Lisp? Curious what you guys think of it.
- submeta 6y agoJust started learning Lisp (Emacs Lisp), and I am planning on doing a deep dive in Common Lisp. Using Python and Pandas for my day to day scripting. Common Lisp does not have the ecosystem in terms of packages compared to Python (or JS / NodeJS), but hacking Lisp feels extremely good. I intend to use it for prototyping, for all kinds of hacking that does not involve using available packages.
- _ph_ 6y agoI do. Feel free to ask any questions, I will try to answer them if possible. In summary: I think SBCL is the most sophisticated Lisp compiler around and it is even free :). It is not as polished as some commercial solutions, which also come with IDEs, but in the setup of SBCL+Slime+Emacs, you have a professional Lisp setup which will go a long way. (I have done professional work with this setup).
- TeMPOraL 6y agoI do. Currently only in hobby fashion, but I also used it professionally when contracting for a company that was building a computation-intensive web platform on a Common Lisp (SBCL) backend. AMA. Personally, I really like SBCL, it's my go-to implementation. I originally picked it because of performance considerations (hobby gamedev), as it compiles to native. But over time, I've learned to also appreciate the type inference and overall embracing the use of (optional by standard) type declarations to provide compile-time typechecking (as well as further performance benefits).
- susam 6y agoI do. I post about it often here, so instead of repeating myself, I will add a few links to my earlier comments and posts here: * Recommendations on learning Common Lisp: https://news.ycombinator.com/item?id=25442155 https://news.ycombinator.com/item?id=25442155 * On Lisp communities on Reddit r/lisp and Freenode #lisp: https://news.ycombinator.com/item?id=25543565 https://news.ycombinator.com/item?id=25543565 * Observations on State of Common Lisp Survey 2020: https://news.ycombinator.com/item?id=25291780 https://news.ycombinator.com/item?id=25291780 * Lisp in Vim with Slimv/Vlime: https://news.ycombinator.com/item?id=21735148 https://news.ycombinator.com/item?id=21735148 * Emacs4CL (a tiny quick starter ~/.emacs): https://news.ycombinator.com/item?id=25440690 https://news.ycombinator.com/item?id=25440690 Like many others commenting here, I too use SBCL because of its good performance. I keep CLISP around mainly for nostalgia's sake. I began learning Common Lisp in Sep 2007 during a long layover at an airport using CLISP 2.41 on Debian 4.0 (Etch). Also, having another implementation helps me to test that my code is portable and does not rely on any SBCL-specific features.
- threatofrain 6y agoIs there a story of a Common Lisp workflow on VSC by any chance?
- zerr 6y agoAtom + SLIMA seems quite nice.
- scruple 6y agoThis is what I've been using to learn CL. It's a very small barrier to entry compared to when I've tried (and failed) in the past to approach Lisp from Emacs.
- phoe-krk 6y agohttps://marketplace.visualstudio.com/items?itemName=rheller.alive https://marketplace.visualstudio.com/items?itemName=rheller....
- core-questions 6y agoI don't write Lisp myself, but I support SBCL-based apps running in production, and it's a very interesting beast. The REPL and the debugger/inspector are amazingly powerful. I still find Lisp itself very hard to read, though. I understand the whole homoiconicity thing, and how S-expressions are one of the simplest implementations of that, but it's things like "car"/"cdr" instead of some reasonable memorable name (say, "first"/"rest") that kill me. Just don't seem to have the brain space for it.
- rvense 6y agoI've done quite a bit of Scheme in the past, but I've been playing with Common Lisp a little recently, and I often find myself thinking things like "how do I convert a string to a list of characters" or "how do I check if this thing is in this list", like simple standard library stuff that I could implement myself but expect to already be there, and then I go look in the Hyperspec, and sometimes it's hard to find thing when you don't have a name to look up.
- guenthert 6y agoTrue, but there is The Common Lisp Cookbook project to help with exactly such: http://cl-cookbook.sourceforge.net/strings.html http://cl-cookbook.sourceforge.net/strings.html
- rvense 6y agoThat looks great, thanks!
- vindarel 6y agoThe Sourceforge version is old, please see https://lispcookbook.github.io/cl-cookbook/ https://lispcookbook.github.io/cl-cookbook/ !
- vindarel 6y agoPleeeeeeeeeeeease link to the recent Cookbook :) https://lispcookbook.github.io/cl-cookbook/ https://lispcookbook.github.io/cl-cookbook/
- lisper 6y agoYes, I use it professionally, and have for over 30 years, since before it became Common Lisp. It is far and away my favorite programming language (hence my HN handle :-) for two reasons: macros allow me to capture any design pattern and seamlessly add it to the language as a programming construct, and the generic function model of OO built in to CL is vastly more powerful than the C-based single-dispatch object.method() model that is ubiquitous in the rest of the programming language world.
- gautamcgoel 6y agoCan you expand on the second point? What can you do with CL OO that is hard in C/C++?
- remexre 6y agoI like the Circle-Ellipse Problem [0] as an example of something CLOS / multimethods are good at that C++ isn't. In general, Expression Problem-like [1, 2] problems are much much nicer to solve in CL. [0]: https://en.wikipedia.org/wiki/Circle%E2%80%93ellipse_problem https://en.wikipedia.org/wiki/Circle%E2%80%93ellipse_problem [1]: https://en.wikipedia.org/wiki/Expression_problem https://en.wikipedia.org/wiki/Expression_problem [2]: https://wiki.c2.com/?ExpressionProblem https://wiki.c2.com/?ExpressionProblem
- lisper 6y agoThe big win is not so much in the actual underlying power, but rather in the syntactic uniformity. In traditional OO languages there is a semantic difference between f(arg1, arg2) and arg1.f(arg2) and as a programmer I have to remember which one is the right one for any particular operation I want to do. In CL the syntax for a regular function call and a generic function call is exactly the same, so as a programmer I don't have to worry about it. I just write (do-something arg1 arg2) and let the compiler figure it out. It removes a tremendous amount of cognitive burden. But there are lots of examples where it really makes sense to be able to dispatch on multiple arguments. Arithmetic operations, for example. It's really nice to be able to add, say, arrays using the same syntax as adding numbers, or to be able to do array-array multiplication and array-scalar multiplication using the same syntax as multiplying numbers. Or, if you're doing graphics, to be able to specialize on both the object being drawn and the target to which it is being drawn. There are loads of other things as well. The meta-object protocol allows you to do all kinds of wizzy things. Using EQL specialization lets you define special-case handling for a privileged object without cluttering up the rest of your code. BEFORE and AFTER methods let you tweak arguments on the way in or results on the way out. Here's an example from a real-world project I'm working on: it's a 30-year-old legacy system and it's chock-full of hard-coded path names, literally thousands of them. We had to port it to a new environment where those paths don't exist. Normally this would have been a huge project to go through the source code and manually find and change all of the paths. Instead, I was able to define a BEFORE method on the OPEN function [1] which translated the incoming hard-coded path name to the correct value in the new environment. What would normally have been a multi-day headache was instead a five-minute tweak. [1] Yes, I know OPEN is not actually a generic function, and so this is not actually possible in portable CL. But this was in ACL which provides this feature as an extension. And even in portable CL you can always shadow OPEN and redefine it. This is now getting away from the advantages of the OO system and into other parts of CL, but the bottom line is that many, many things that are a PITA in other languages are easy in CL.
- heisig 6y agoI use Common Lisp for most of my daily programming, and SBCL is a big reason why. Once you get over the initial hassle (getting used to the Emacs+SLIME tool chain and learning to read the compiler diagnostics) it really gives you the productivity of Python with the performance of C++. And a lot of that performance is thanks to the tireless effort of the SBCL developers, who have been churning out a new release every few months for the last decades. Kudos to all SBCL contributors!
- watermelon59 6y agoDo you mind sharing in what space you work on? Just curious about where Common Lisp finds professional usage. It's not something you see every day. Also, do you have any tips on landing a Common Lisp job for someone who's already in the middle of their career (30s, senior dev)?
- pjmlp 6y agoNot the OP, but if you feel like moving into Lisbon, https://www.siscog.pt/en/ https://www.siscog.pt/en/ https://franz.com/success/customer_apps/scheduling/siscog.lhtml https://franz.com/success/customer_apps/scheduling/siscog.lh...
- vindarel 6y agoThis is attractive :) No offer mention Lisp though? found https://www.siscog.pt/en/careers/software-engineer-lisbon-ref-swel012018/ https://www.siscog.pt/en/careers/software-engineer-lisbon-re...
- pjmlp 6y agoIt is been a while, so I don't have any more contacts there, yet one might apply and find out.
- watermelon59 6y agoOh hey, that sounds interesting and I already speak the local language :)
- fmakunbound 6y agoSBCL is one of those exceptional free software projects IMO. It's compiler which includes type inference and optimizations is world-class among Common Lisp implementations.
- juanre 6y agoI use it to write the star-mapping software behind https://greaterskies.com https://greaterskies.com many years ago. I did it as a fun project after reading PG's essays, but now it is supporting my family and two employees. In the few occasions I need to touch something or add a new feature I feel like coming back home.
- gglitch 6y agoThank you! Do you have an end-to-end write up for the experience? Tooling, libraries, deployment, etc?
- juanre 6y agoI have never written it down, but it's very simple. I don't use any external libraries. I converted the input databases to lisp and compiled them in, and the output is simple postscript. When I want to deploy I dump a core with the compiled functionality, then run sbcl with that core. At some point I was using hunchentoot[1] to provide an http point of entry (great library, as all the ones written by Edi Weitz) but I am not bothering anymore, as most of the processing time is consumed by ghostscript and convert in the post-processing of the images. [1] https://edicl.github.io/hunchentoot/ https://edicl.github.io/hunchentoot/
- gibsonf1 6y agoSBCL is a great production common lisp that we use for our AGI system - incredibly fast and reliable. https://graphmetrix.com/ https://graphmetrix.com/
- phoe-krk 6y agoYes, I use SBCL daily. The fact that SBCL (like most CL implementations) is image-based makes CL the language for interactive and incremental programming and live debugging the program as it runs. (Shameless plug: I wrote a book about the last point and about how CL achieves it. https://www.apress.com/us/book/9781484261330 https://www.apress.com/us/book/9781484261330)
- vram22 6y agoWhy does the first part of your (first) sentence imply the second part? The two parts are separated by the word "makes".
- phoe-krk 6y agoIn theory, a Common Lisp implementation is not required to be image-based. The standard permits a Common Lisp compiler that can e.g. be a batch file compiler that turns files into binaries, and then those can be executed without lots of live-programming, image-based goodies. No CL implementation I'm aware of follows this paradigm.
- lispm 6y agoeven live programming does not require images. In most CL systems, image-based technically means it can dump memory to images on disk and start those. More exotic is nowadays, when quitting a Lisp system always writes all the changes to a new image, which then will be started next time. ECL does not support images, but has live programming, MOCL does not support images, nor full live programming. There are/were a bunch of CL compilers which work similar. They support then only a subset of CL - a subset without some runtime support for things like EVAL or COMPILE. Typically non-image based and non-live Lisp compilers were written for the compilation of Lisp to C, with the purpose of generating small static executables, MOCL does that. MOCL is based on the earlier CLICC compiler.
- vram22 6y agoThanks.
- guenthert 6y agoI use Common Lisp for 'exploratory computing' as they say. It's my go-to language if I want to quickly evaluate an idea. Took me a while to learn, but since acquiring at least modest familiarity, I have less patience with ad-hoc syntax (syntactic sugar) found in in-fix languages and the churn found in many currently popular languages. SBCL might be the best (in terms of correctness, adherence to the standard, performance of the compiled code, compatibility with existing libraries, tool support) open source compiler for CL. The compiler itself can be compared with commercial offerings (those seem to focus rather on additional libraries and external tools). On ARM32 however, I do use CCL, as SBCL doesn't support multi-threading on that architecture.
- bumbada 6y agoFor me learning Lisp is an essential requirement for becoming a professional programmer, even if you don't use it after that, you will "Lispify" everything you touch. It just changes the way you think. SBCL is a compiler, it let's you use what was designed as an interpreted language, in an efficient, compiled way. But this compiler has nothing to do with other compilers you probably know about. Instead of compiling the entire set, you just can compile fragments of code, or not compile them (interpret it for things like flexible self modifying code)if you want with total control. Very very good for incremental programming, with tools like the REPL and debugging options you have nowhere else. Having said that, I use my own dialect of Lisp in C, and I use that for writing code in the c world: c, c++, python, webasm, js. I use SBCL only occasionally now.
- lispm 6y agoSBCL was for years a compilation only Lisp implementation. A few years ago an interpreter for Lisp was added, but is not used by default. SBCL has two compilation modes: a) compilation of source code files to machine code files and b) compilation of Lisp expressions in memory. a) can be used via the function COMPILE-FILE and b) typically via COMPILE (and thus also via EVAL) Generally compilation of Lisp is nothing new (the first compiler was written in the early 60s) and the Common Lisp language definition (first in 1984) has many features to support Lisp compilation: compiler interface, code inlining, similar semantics for interpreted and compiled code, type annotations, ...
- vindarel 6y agoI do, this year I shipped a web application and paid a few rents with it. It reads an existing DB, fetches data from a SOAP service, sends daily reports to a FTP server and renders some HTML templates. I'm coming from Python and am much happier now. The compile-time checks and the deployment stories are particularly appreciated.
- nibbula 6y agoSBCL is a "sufficiently smart" compiler, that makes Lisp fast. I've replaced enough software with CL, that now I can't stand to use a computer without it. With CL you can do whatever the fuck you want, all the time. It's glorious. The limitations are your own ability, and having to interface to crappy non-CL software, idiotic non-Lisp protcols, and hardware seemingly designed to be operated by spavined brine shrimp. But also I'm "eccentric" and I like exiling myself to the software wilderness, where you have great freedom, but have to be very self reliant.
- all2 6y agoI am interested in this idea of "refactoring" software into Lisp. Do you have any resources on this?