30 ms·
Steel Bank Common Lisp
- reikonomusha 3y agoSBCL is an implementation I love working with because updates are steady and the software is stable. But the real superpower, in my opinion, is that, because the compiler and standard library are written in Common Lisp, you can reach in into the internals of SBCL for your own projects—as if SBCL were just another Lisp library. Is it advised to use unsupported APIs? Definitely not. But it's nice to be able to have seamless access to the same facilities and optimization tools (e.g., DEFTRANSFORM, DEFINE-VOP) that the SBCL uses for its own implementation. You can build impressively clear and highly efficient code this way, essentially by extending the compiler "in userspace".
- kagevf 3y agoI wanted to get last modified dates from some files, and I tried to use OSICAT-POSIX, but it didn't work because it was missing a non-CL dependency, so I used SB-POSIX instead, and it worked as expected, no issues. I was glad to have that option, and for that particular code, cross-compatibility with other implementations wasn't a concern.
- kaeland 3y agoI’ve been learning CL in my spare time and had no idea this was possible or even a distinction between CL implementations. Thanks for sharing.
- _19qg 3y agoMost Common Lisp implementations have one or more compilers integrated into it. Most of them are written in itself. Thus, when the implementation provides the source for the compiler, you can explore/change the compiler like any other part of the Lisp code.
- User23 3y agoI have a real soft spot for DISASSEMBLE too. It’s magical to be able to instantly see how the optimizer handles your hot spots.
- aidenn0 3y agoAnd if you profile code, then you see assembly level profiling information too!
- dunefox 3y agoThat's what I like about Julia as well with @code_native, @code_llvm, etc. https://docs.julialang.org/en/v1/stdlib/InteractiveUtils/#InteractiveUtils.@code_lowered https://docs.julialang.org/en/v1/stdlib/InteractiveUtils/#In... It's just nice to have inside the language itself.
- perihelions 3y agoWhat's a good introduction for learning SBCL compiler internals like VOP's?
- mtlmtlmtlmtl 3y agohttps://pvk.ca/Blog/2014/08/16/how-to-define-new-intrinsics-in-sbcl/ https://pvk.ca/Blog/2014/08/16/how-to-define-new-intrinsics-... Some quick googling led me to this. Can't vouch for it though, since I need to learn this stuff too! Can't find much documentation for DEFTRANSFORM though, unfortunately.
- tiffanyh 3y agoWhat is the dominant flavor of Lisp these days?
- reikonomusha 3y agoAs measured by what? Clojure is pretty popular, as is Racket in other circles. Common Lisp is robust, standardized, and "decentralized" with both free and commercial implementations. It and Python power a few quantum computing technologies.
- opan 3y agoIn addition to this, Guile is big in the GNU space, used for Guix and other things.
- nequo 3y agoThere was also sustained effort over the past two decades to move Emacs from Elisp to Guile but that has stalled: https://emacsninja.com/posts/state-of-emacs-lisp-on-guile.html https://emacsninja.com/posts/state-of-emacs-lisp-on-guile.ht...
- User23 3y agoAnd now thanks to the JIT patch elisp outperforms Guile considerably. Emacs dev is very much motivated by pragmatism, jokes about Emacs being a tool created to write Emacs config notwithstanding.
- jonas21 3y agoIn case anyone else is curious about the name: > SBCL derives most of its code from CMU CL, created at Carnegie Mellon University. ... it's appropriate to acknowledge the descent from the CMU hackers (and post-CMU CMU CL hackers) who did most of the heavy lifting to make the system work. So the system is named Steel Bank after the industries where Andrew Carnegie and Andrew Mellon, respectively, made the big bucks. https://www.sbcl.org/history.html https://www.sbcl.org/history.html
- pfdietz 3y agoNote that SBCL forked from CMUCL 23 years ago. There's been a great deal of turnover in the code since then. I'm sure you could find some remnants of the original code, but overall it's very much its own thing now.
- andsoitis 3y agoIn the same way that a version of SBCL 23 years in the future is a clear descendent of the current version, so is the current version a direct descendent of CMU CL, 23 years ago.
- varjag 3y agoCMU CL in turn has it's lineage from Spice Lisp: a dialect that originated 40+ years ago on pdp-10. It's even less chance to have residual code of that still around though.
- jgerrish 3y agoI posted previously about SBCL and quicklisp. Great ecosystem. I'm still learning but it's usually fun to work in. I made some recommendations about quicklisp using http by default and how to lock it down. I don't know if those are good recommendations anymore. I couldn't manage to follow them myself. I couldn't keep up and my patch approach didnt work. So, I don't know the best approach with that problem, but I was too confident in my post about security suggestions.
- atgreen 3y agoCheck out ocicl as an alternative to quicklisp if you are concerned about security. Code is distributed using the OCI ecosystem (https by default, proxies work, sigstore integration, etc). https://github.com/ocicl/ocicl https://github.com/ocicl/ocicl
- brabel 3y agoQuicklisp, ironically, only updates once a month. It's managed like a Linux distro. That means the client has a full index of every library in the registry, and knows the hash of every file it may download. I am pretty sure quicklisp checks the hashes it downloads. Hence, the only security issue with using HTTP seems to be that middleman can see what you've downloaded... if they try to change it in any way, the quicklisp client will reject the download as far as I know (though I haven't checked the code). Do you believe this is not sufficient, and why?
- atgreen 3y agoMan-in-the-middle attacks. But equally important, many secure environments won't allow outbound http connections.
- akho 3y agoWhat kind of mitm? The attacker cannot modify what you get. You leak the list of packages you download, but I don't think https by itself would have helped — host and filesize would be known, and that should be enough.
- beefman 3y agoWas this ever called SuperBallistic Common Lisp? I remember it being called that but google only returns https://news.ycombinator.com/item?id=1348383 https://news.ycombinator.com/item?id=1348383
- throwaway1777 3y agoNo
- d5ve 3y agoI found a post mentioning "SuperBallistic Common Lisp" from 2015, perhaps that's where you remember it from. > SBCL goes SuperBallistic! I have hacked together an SBCL port for the IBM BlueGene/P supercomputer's Compute Node Kernel (CNK). https://sourceforge.net/p/sbcl/mailman/sbcl-devel/thread/AANLkTikVbe92HTAj4ycAhqbkl1gjf9m12AzaVXuFAQ60%40mail.gmail.com/ https://sourceforge.net/p/sbcl/mailman/sbcl-devel/thread/AAN...
- msla 3y agoThey missed a trick when they didn't call it Rich Friend Common Lisp (Originally based on Carnegie Mellon University Common Lisp. Carnegie got rich in steel, Mellon in banks, but both were rich, and Mellon is Elvish for Friend. Rich Friend Common Lisp. There. A bilingual pun about a Common Lisp implementation, where one of those languages is a conlang from a fantasy novel. Geekiest joke you'll hear all day.)
- jrflowers 3y agoThat would be a very belabored joke. I read the entire explanation of the joke twice and do not see how it could qualify as a “missed trick”
- gautamcgoel 3y agoI agree, "Steel Bank" is way more natural.
- jrflowers 3y agoI mean yeah, if we’re in Belabored Jokes Town (where Steel Bank was invented) it is relatively more natural than Rich Friend.
- p_l 3y agoThere's also the joke that SB stands for "Sanely Bootstrappable", which refers to how SBCL is easy to build from source without having a copy of SBCL.
- msla 3y agoEh, just a bit more work than Leiningen as a build automation tool: https://en.wikipedia.org/wiki/Leiningen_(software) https://en.wikipedia.org/wiki/Leiningen_(software) https://en.wikipedia.org/wiki/Apache_Ant https://en.wikipedia.org/wiki/Apache_Ant https://en.wikipedia.org/wiki/Leiningen_Versus_the_Ants https://en.wikipedia.org/wiki/Leiningen_Versus_the_Ants
- dharmab 3y agoI used SBCL for a decent chunk of my college coursework. It was a joy to use and made programming fun and exciting in a way I hadn't experienced before.
- jderiksen 3y agoFond memories of using SBCL in grad school
- deleted 3y ago[deleted]
- brabel 3y agoThe biggest advantage of using SBCL over other Common Lisp implemnetations is that it has very good support for Common Lisp types: https://www.sbcl.org/manual/index.html#Handling-of-Types https://www.sbcl.org/manual/index.html#Handling-of-Types I "(declaim)" the types of my exported functions (at least) which makes life much easier when consuming the library's API, and when you make a mistake (either in the caller or the implementation) you'll get either an error or a warning when you compile the function. The types also show up in the documentation in SLIME and can (but is not guaranteed to, you can check with (time) and (disassemble) and (sb-profile)) make code much faster... specially if you need a lot of numeric computation, declaring the types of the numbers as `fixnum` or `single-float` (you may need to explicitly restrict the range of the numbers too to get the best Assembly) your code can run much faster as that will let it compile to basically what C would do, as it avoids the Lisp numerical tower slowing things down.
- ducktective 3y agoQuick comparison between CL with types and Typed Python as both are dynamic languages with types added later in?
- p_l 3y agoNope, Common Lisp is strongly typed, however the implementations are a bit flexible in how they handle it - the minimum required is that they serve as asserts (essentially, types for safety). CMUCL Python compiler (not to be confused with the much younger language of the same name), which is also used by CMUCL's descendants like SBCL, is famous for the amount of type-guided optimisation it performs. If it can subtype, or you can inform you of appropriately narrow type, it will happily replace more generic arithmetic and with (safety 0) elide all safety checks.
- pfdietz 3y agoAlso, the soft typing it does to allow the type-guided optimization also allows it to detect many type errors at compile time. These become warnings; it's considered proper to eliminate all such warnings from your code before considering it to "compile".
- dumdumchan 3y ago[flagged]
- nurettin 3y agoimagine python, but you can add more types in order to compile python code into machine code. So you have some slow tight loop, add types, add a decorator and it runs thousands of times faster. Now imagine being able to do this since early 2000s.
- dumdumchan 3y ago[flagged]
- nurettin 3y agoTouché, I wasn't really answering the question. But I don't think people really started using it. If my task was to gather a team of developers for a general purpose firm, I'd probably choose Java. I guess that answers a lot.
- pfdietz 3y agoLisps initially needed expensive hardware. Common Lisp wasn't even standardized until the 1980s, and by that time C was already ubiquitous and cheap.
- dunefox 3y agoMy guess is that Lisp was associated with AI in the AI winter in the 80s/90s and failed symbolic and logic AI took Lisp with it.
- pletnes 3y agoMy naive guess is lack of a good package repository. CPAN made Perl great, even if the language was not to everyone’s taste. Node/npm made javascript huge. Pypi picking up binary wheels made python the obvious choice for any data-heavy project. Is there even a central common lisp package repository?
- anyfactor 3y agoKinda was hoping that it was developed by a Bank of some sort, but no. Imagine a bank investing time and effort into creating a Lisp implementation. > The name "Steel Bank Common Lisp" is a reference to Carnegie Mellon University Common Lisp from which SBCL forked: Andrew Carnegie made his fortune in the steel industry and Andrew Mellon was a successful banker. https://en.wikipedia.org/wiki/Steel_Bank_Common_Lisp https://en.wikipedia.org/wiki/Steel_Bank_Common_Lisp
- jwr 3y agoBefore I moved on to Clojure, SBCL was what I used. Rock solid, open-source and debuggable (I also used commercial lisps: AllegroCL and Lispworks, and was not happy with them), actively developed. If you use Common Lisp, this is a really good implementation.
- BaculumMeumEst 3y agocommon Lisp has such great implementations and tooling, it's a bummer that it's hamstrung by its ecosystem. as an example I was working on a project that needed to use active directory for auth. i found a kerberos CL lib that someone had made just for that purpose years ago, but the windows KDC no longer accepted the encryption algorithm that the CL lib used. meanwhile i was able to get up and running with clojure by leaning on java's builtin security packages, which include kerberos support. and i know that code will not break in the future.
- tiberious726 3y agoDunno what you're on about, but sure seems like FUD to me: https://letmegooglethat.com/?q=common+lisp+kerberos+aes&l=1 https://letmegooglethat.com/?q=common+lisp+kerberos+aes&l=1
- accoil 3y agoI clicked that, which led me to https://github.com/fjames86/cerberus https://github.com/fjames86/cerberus Took a look at the issues, and the top issue is about not being able to connect to AD. The dev then says that it looks like the algo used has been deprecated since they wrote it in 2015, and they do not have the time to maintain this library any more: https://github.com/fjames86/cerberus/issues/5#issuecomment-1324142054 https://github.com/fjames86/cerberus/issues/5#issuecomment-1...
- tiberious726 3y agoWell, damn, the readme says they do AES but that sure doesn't look to actually be the case: https://github.com/fjames86/cerberus/blob/64d145a53478a8a0604d2ba38d0c3f2e0a818a6a/ciphers.lisp#L512 https://github.com/fjames86/cerberus/blob/64d145a53478a8a060...
- submeta 3y agoWhenever a post about Lisp graces the front page of Hacker News, I typically observe two main categories of commenters. The first group is composed of devout Lisp enthusiasts who have either applied it to solve problems in the past or continue to utilize it in their personal and professional projects. They are well-versed in the numerous advantages of Lisp over many contemporary programming languages. Their familiarity with the language extends to its versatility in writing DSLs using its macro system, its adaptability in altering running programs, and its debugging prowess. They value the ability to scrutinize the internals, apply multiple programming paradigms, and appreciate various other benefits. The second group, conversely, is characterized by its perennial question whenever a Lisp-related article surfaces: "Does anybody use Lisp these days?" In response, the first group can usually cite a small collection of projects that still use Lisp, including Clojure shops, a Brazilian startup, and the Hacker News website, which is written in Arc, among others. This dichotomy serves as an apt illustration of how one's perspective can be distorted, causing them to overlook the broader reality. As much as I admire and appreciate Lisp (and I genuinely do!), it's hard to ignore that the technological world primarily operates on languages such as C, Java, JavaScript, Python, C#, and a handful of others. The communities surrounding these languages seldom feel the need to prove their viability by listing projects that use them. The undeniable truth is that the world has largely embraced C-type languages, and in doing so, has achieved remarkable feats. The "absolute best" programming language was not a requirement for this progress. Management professor and esteemed writer Peter Drucker offered valuable insight in his book "The Effective Executive." He stated that effective executives don't become preoccupied with the tools they use; instead, they employ whatever tools are necessary to accomplish their tasks. This notion, I believe, is applicable not only to management but also to the realm of programming languages.
- kunley 3y agoI don't know why the observation above gets downvoted....
- davexunit 3y agoIt comes across a little dismissive (like "all due respect but <disrespect>") to me, as if Lisp programmers are not making good choices by going against the grain of the strong network effects of mainstream languages. I agree that trying to constantly justify why we choose one thing over another (how many times can we point out that Naughty Dog used Lisp for Crash Bandicoot and Jack and Daxter??) is not a good use of time, though, unless of course you're trying to get someone to give you money. Why do I use Lisp? The vibe is good and I'm usually happy when I'm hacking.
- FredPret 3y agoAfter reading many think-pieces evangelising LISP, I decided to get into it. However, I hate Emacs. Is this going to be a problem long term? Right now I'm entering code in a text editor, but I'm still solving toy learning problems only.
- dharmab 3y agoI used SBCL with Vim back in the day. (I have joint problems that make emacs keybinds literally painful). It worked fine, though I missed out in some features.
- cbreezyyall 3y agoI know other editors have their spinoffs but SLIME is the reason emacs is the go-to for lisp programming. it's really hard to beat that dev experience
- lispm 3y agoEMACS was always used for Lisp programming, since day zero. It had always a mode for Lisp programming. Later GNU Emacs became popular and it was partly written in Lisp. Thus it was not unusual for Lisp users to provide Emacs modes for hacking other Lisp dialects than Emacs Lisp, because they could easily program it. Before SLIME, there was an integrated extension, then ILISP and ELI (from Franz). Nowadays SLIME and SLY are mosly used as IDE extensions for GNU Emacs..
- nerdponx 3y agoNo. I use Vlime in Neovim and Slyblime in Sublime Text. I know it's not quite as amazing as the Emacs experience, but it does the job well enough.