[HN Gopher] SBCL: New in Version 2.1.0 ___________________________________________________________________ SBCL: New in Version 2.1.0 Author : susam Score : 116 points Date : 2020-12-30 06:40 UTC (16 hours ago) (HTM) web link (www.sbcl.org) (TXT) w3m dump (www.sbcl.org) | newusertoday wrote: | off topic: can anyone recommend good solution for text templating | like https://handlebarsjs.com/ with full power of common lisp? i | have checked the one's mentioned in cliki | https://www.cliki.net/templating%20library . | fiddlerwoaroof wrote: | There is a cl-mustache library: I end up just using spinneret | for html and postmodern' s-expression syntax for SQL | fmakunbound wrote: | Yeah, I'd just be using templating in code using cl-who and | whatnot. Text template languages like handlbars and are just | not a popular choice in Lisp circles. | WalterGR wrote: | (To save others the time googling, "whatnot" is not a Lisp | templating library.) | | There's a third way, though: text templating libraries that | support the full language. Does that exist for Common Lisp? | alaaalawi wrote: | Just curious. I went and skimmed through the handlebarsjs link. | I'm used to cl-who and can not see what the js lib does have | that is not possible or harder in cl-who. Side note: with a | small macro you can start defining your own streamlined | components and special tags. akin to having your abstractions. | Also l'm taking a course in HTML5+CSS and use this additionally | to avoid being drawned in the usual characteristic boilerplate | text. | newusertoday wrote: | I am actually using handlebars along with helpers | https://github.com/helpers/handlebars-helpers to | automatically generate sql, golang, json and jsx. cl-who is | only for markup. What i found useful in handlebars is ability | to define inline function templates and use them in template. | I am missing cl macro's which would automate my workflow even | more so asking if something like this is available in cl. | WalterGR wrote: | _Just curious. I went and skimmed through the handlebarsjs | link. I 'm used to cl-who and can not see what the js lib | does have that is not possible or harder in cl-who._ | | They are very different styles, though. With cl-who you write | code that mimics the structure of HTML and that code outputs | HTML. With Handlebars etc. you write your HTML in HTML and | embed code in it. Some prefer one over the other. | gautamcgoel wrote: | Anyone here use SBCL or Common Lisp? Curious what you guys think | of it. | susam wrote: | I 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 | | * On Lisp communities on Reddit r/lisp and Freenode #lisp: | https://news.ycombinator.com/item?id=25543565 | | * Observations on State of Common Lisp Survey 2020: | https://news.ycombinator.com/item?id=25291780 | | * Lisp in Vim with Slimv/Vlime: | https://news.ycombinator.com/item?id=21735148 | | * Emacs4CL (a tiny quick starter ~/.emacs): | 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 wrote: | Is there a story of a Common Lisp workflow on VSC by any | chance? | zerr wrote: | Atom + SLIMA seems quite nice. | phoe-krk wrote: | https://marketplace.visualstudio.com/items?itemName=rheller | .... | submeta wrote: | Just 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_ wrote: | There are quite a lot of packages for Common Lisp, though the | selection certainly is smaller than for Python. | [deleted] | _ph_ wrote: | I 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). | core-questions wrote: | I 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 wrote: | I'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. | TeMPOraL wrote: | FWIW, "first" and "rest" are literally aliases for "car" and | "cdr" (and there's a bunch more, see [0]), so it may be that | the code you're working with isn't following a good style. | The general style rule for more modern code is that you use | "first"/"rest" if you're dealing with regular lists, and | "car"/"cdr" if you're doing something more peculiar with cons | cells - though it's not universally followed, and I guess at | this point "car"/"cdr" & friends are too established in the | history of Lisp. | | -- | | [0] - http://clhs.lisp.se/Body/f_firstc.htm | guenthert wrote: | I 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. | fmakunbound wrote: | SBCL 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 wrote: | I use it to write the star-mapping software behind | 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 wrote: | Thank you! Do you have an end-to-end write up for the | experience? Tooling, libraries, deployment, etc? | juanre wrote: | I 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/ | TeMPOraL wrote: | I 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). | phoe-krk wrote: | Yes, 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) | lisper wrote: | Yes, 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 wrote: | Can you expand on the second point? What can you do with CL | OO that is hard in C/C++? | lisper wrote: | The 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. | remexre wrote: | I 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_p | roblem [1]: | https://en.wikipedia.org/wiki/Expression_problem [2]: | https://wiki.c2.com/?ExpressionProblem | gibsonf1 wrote: | SBCL is a great production common lisp that we use for our AGI | system - incredibly fast and reliable. https://graphmetrix.com/ | heisig wrote: | I 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 wrote: | Do 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)? | guenthert wrote: | Congrats and big thanks to all contributors! | clircle wrote: | Does common lisp have any great libraries for working with data? | I've been reading some books over the holiday and I'd like to | start getting my hands dirty, but my background is R, and my day | to day is statistical analysis and graphics. | hipparcos wrote: | It's not something I'm familiar with but I saw a similar | question [1] on r/lisp a few days ago. u/digikar mentioned the | Teddy library [2] which itself refers to numcl [3] in its | readme. Both are available on Quicklisp. | | [1] | https://www.reddit.com/r/lisp/comments/kburda/is_there_a_goo... | [2] https://github.com/40ants/teddy [3] | https://github.com/numcl/numcl | patrec wrote: | Not really. But you might want to check out what Gabor Melis is | doing, e.g. | | https://github.com/melisgl/mgl | | He's won several ML competitions and works at Deep Mind now, so | as far as Common Lisp fans with strong street cred in up-to- | date machine learning go, he's probably a good starting point. | phoe-krk wrote: | https://github.com/sirherrbatka/vellum is maturing and already | usable as a data frame library. | gibsonf1 wrote: | We're using cl-containers [1] and cl-graph [2] and to make it | very fast lparallel [3] and rtg-math [4] (among many others) | | [1] https://github.com/gwkkwg/cl-containers [2] | https://github.com/gwkkwg/cl-graph [3] https://lparallel.org/ | [4] https://github.com/cbaggers/rtg-math/ ___________________________________________________________________ (page generated 2020-12-30 23:01 UTC)