1. 59
  1. 24

    I’m a lisp-1 zealot, so I won’t talk about CL, but I think more people should meditate on the idea that libraries can be complete rather than abandoned.

    Unitl recently I’ve been using an HTML ToC library from 2007. It was calling getElementsByTagName() instead of using a 400KB (minified) library that provides a fancy wrapper for it. Worked just as well as it worked in 2007 I guess.

    1. 7

      but I think more people should meditate on the idea that libraries can be complete rather than abandoned

      This is nice sentiment but I guess it depends on how often underlying system deprecates wrapped functionalities.

      1. 5

        A lot of Clojure libraries simply do data transformations. You pass a data structure to the API, and you get a different data structure out. These libraries can be done once they implement the desired functionality, and will not need to be updated unless the scope is extend. The community tends to favor making small and focused libraries that solve a particular domain problem, and chain these libraries together within the applications. The libraries that wrap underlying system tend to be simple IO wrappers that are separate from the business logic.

        1. 5

          Yes, I also think we should be careful not to break compatibility without a really good reason.

          1. 3

            For the web and most important systems, that feels like “approximately never”. I would also consider using libraries that you feel comfortable patching/forking yourself.

            1. 2

              Unless you relied on IE6 implementations, of course.

          2. 3

            more people should meditate on the idea that libraries can be complete rather than abandoned.

            I agree. I would propose the problem is we don’t have a good measurement for complexity. If a library has been reduced to solving the essence of the problem, then it should need next to no maintenance. I find most of these types of libraries in the Lisp world.

            On this topic, I have a WIP paper proposing a way to determine whether something has been made “as simple as possible”. My expertise in complexity theory is nil, so if you or anyone else had any thoughts and/or wanted to collaborate, you can see the WIP here: https://github.com/breck7/jtree/blob/master/papers/paper3/countingComplexity.pdf

            1. 2

              Kind of, sort of, not really. A library not being updated for 12 years is a pretty sure sign of it being dead. Well, Open Source never dies, but becomes a zombie. Sure, there are exceptions, but that’s why they’re called exceptions :-)

              Almost anything that touches network stuff rots. Simple example: a library that connects to some online services. Well, if it’s HTTP-only, then in my eyes, it’s dead. If it’s HTTPS that’s better, but it needs to be maintained because cyphers are deprecated and removed by browsers, as a simple example.

              Anything that touches modern OSes rots. OSes change APIs (especially for GUIs), new OSes appear (what are you going to do about that library from 2007 if you need to run the code on Android or iOS? you can port it yourself, but are you paid to do that?).

              Some super-core, super-functional, super-algorithmy stuff doesn’t really rot (all that fast), but how much of the code the average app runs is actually that? If I look at the dependencies of the app I’m working on, most stuff is functionality to integrate with various vendors. All of that rots.

              1. 1

                it needs to be maintained because cyphers are deprecated and removed by browsers, as a simple example. I would be wary of a library that implements its own HTTPS. OpenSSL and friends offer a reasonably stable API. Such a library will more likely stop working because the online service changes its API.

                what are you going to do about that library from 2007 if you need to run the code on Android or iOS It’s a JS library and the basic DOM API it uses hasn’t changed in decades. It will keep working the same in any browser that implements the DOM API correctly. I dropped it because I wanted a JS-free ToC and because my code for that can do things nothing else can, but that lib is still good for what it does.

                How much code does that really depends on the application. I think one problem is that many libs tend to do too much and aren’t modular enough. libpurple is a great example that got it right: you can easily make a new IM client with any parts of it.

            2. 8

              See, @sjl, this is what happens when you write thoughtful articles - people keep rediscovering them. Any updates worth mentioning?

              1. 3

                Have there been any considerable changes since the last submission?

                1. 1

                  I would like to add to the author’s recommendation to use CCL on the Mac and SBCL everywhere else that, on Windows, it is also simpler to go with CCL. I’ve got some weird errors from SBCL on the Windows and, as the SBCL website says, the support is still experimental.

                  1. 1

                    FYI, I accidentally posted a link to the TOC item, moderators please remove anchor if possible.

                    1. [Comment from banned user removed]

                      1. 7

                        but I don’t want to create a comprehensive list.

                        That’s a shame – can you at least toss a “these are the top n ‘incorrect things’ I see in this document” for the purpose of those newbies/experienced users to digest?

                        1. 0

                          The main issue that comes to mind is recommending C libraries when unnecessary, such as Ncurses.

                          You can’t write Common Lisp expecting certain performance characteristics, although you can inspect them, and I recommend against heavily optimizing some code for a specific implementation, unless you’re specializing code for several. Also, in writing programs that interface with other systems, you need to be aware of portability concerns such as character sets.

                          However, I stress that recommending C libraries is the main issue that currently comes to mind. There are other libraries I see as superfluous, but that’s more arbitrary than this note.

                          1. 1

                            What would you use for Lisp instead of ncurses if you want a TUI? Is it as well supported and maintained as ncurses?

                        2. 5

                          This is mostly with regards to libraries and development practices and other such things, but I don’t want to create a comprehensive list.

                          Honestly, when I was getting into CL, I found the abundance of seemingly equal libraries more annoying – having a list where someone says “use these” is a first step towards something that makes more sense than just a list of names, none meaning anything – and all of this, even if the person was giving bad advice!

                          1. 4

                            why is advertising a discord server wrong?

                            1. 11

                              Discord is pretty famous for abusing user trust and being anti-software freedom. They will ban your account if they find out that you have even been discussing using 3rd-party clients.

                              1. 2

                                oh wow, I did not know that, thanks for the information!

                            2. 4

                              I discussed this with him, but he wasn’t keen on writing it under the AGPLv3, so that went nowhere.

                              I don’t get this remark. He didn’t want to write it under AGPLv3, at your request, so he didn’t write it?

                              1. 1

                                I offered to collaborate with him, but he wasn’t interested in collaboration if the result was licensed under the AGPLv3.

                                1. 2

                                  Got it. What is the perceived value in LSP for Common Lisp, anyway? As far as I can tell, LSP doesn’t have a standard way, or any way(?), to provide remote REPL like services, so only code introspection seems likely…but doesn’t SWANK give you all that, AND, remote REPL, remote debug, etc?

                                  I can see the value in learning one set of keybindings for all languages, fwiw, but I wouldn’t adopt LSP over geiser for my Racket / Scheme stuff…

                                  1. 1

                                    doesn’t SWANK give you all that

                                    Yes and no. Yes there is some overlap in functionality between in LSP and Swank. For CL, Slime is still ahead in the features it provides. I wouldn’t switch to using an LSP client for CL in a million years

                                    No in the sense that an LSP server would allow you to leverage the work of hundreds of developers to provide support for vscode, atom and other editors more popular with the webdev crowd. While SWANK is primarily intended to be used in conjunction with SLIME using Emacs (as superior as Emacs may be).

                                    Also while LSP doesn’t have a standard for all the features of SLIME, it does have a standard, and it is being extended with new features every day. The lack of a standard is not a theoretical problem, nrepl was developed because when Clojure used swank as their back-end the protocol would change and their client would break.

                                    And while sexpr-based format would be a better choice for serialization than JSON (I would have preferred they using transit), the Swank protocol is less than ideal. For example the way the cursor position is specified for eldoc purposes is to insert ==> x <== around the argument the cursor is at.

                                    Also the author of the article doesn’t use Emacs nor Swank. They have implemented part of the nrepl protocol and use that for their day to day.

                                  2. 1

                                    Why the preference for AGPLv3 vs. some other license?

                                    1. 4

                                      I’m reluctant to continue replying, since Lobsters requires me to enable JavaScript for this, so I won’t be responding to any more replies, note.

                                      I choose the AGPLv3 because it’s the strongest copyleft license available and I also find it nice that many companies are afraid to touch it. I reject permissive licenses, because I want my work to benefit the Free Software world and not enable proprietary software. There are other reasons, but I’m being brief.

                                      1. 3

                                        You can enable email notifications to which you can reply and it’ll show up here.

                                        Mailing list mode can be enabled per-user to receive all new stories (including their plain-text content as fetched and extracted by Diffbot) and user comments as e-mails, mirroring discussion threads offline. This makes it easy and efficient to read new stories as well as keep track of new comments on old threads or stories, just like technical mailing lists or Usenet of yore. Each user is assigned a private mailing list address at this domain which allows them to reply to stories or comments directly in their e-mail client. These e-mails are then converted and submitted to the website as comments, just as if the comment was posted through a web browser.

                                        https://lobste.rs/about

                                2. 4

                                  To claim to know a standardized language without knowing the standard is foolhardy and wrong.

                                  But he says “ It’s a useful tool to have, but not the only one you’ll need.”…So he is saying you should read it, at some point, right?

                                  I always read the standard document

                                  This is interesting. I generally will at some point hit the standard document, but usually only after consuming 2 or 3 introductions (I guess you may do so as well, since you said in either order). But I often find standards documents bloated and boring. Are there particular ones you like?

                                  1. 6

                                    I know what you mean, but CLtL2 isn’t really that kind of “standards document” — it is pretty pleasant to read, has a sense of humor, and is well-organized.

                                    1. 1

                                      Okay, just requested it. Thanks!

                                    2. 3

                                      So he is saying you should read it, at some point, right?

                                      Without looking back, I believe he was recommending not reading it end-to-end, which is bad advice, also tying in to what I told @owen .

                                      I generally will at some point hit the standard document, but usually only after consuming 2 or 3 introductions (I guess you may do so as well, since you said in either order).

                                      The standard document is either the first or second text I read when learning a language.

                                      But I often find standards documents bloated and boring. Are there particular ones you like?

                                      The Common Lisp standard is pleasant, with its detailed descriptions of facilities, such as FORMAT. APL is a good example of reading an introductory text first. I don’t recommend reading ISO 13751 (This is a gzip file, not a PDF.) before having a loose understanding of APL, as the standard is well-written and rather concise, but gives the most general descriptions of primitives that can be difficult to understand without knowing behavior for one-dimensional and two-dimensional parameters and is generally best understood by walking through the descriptions with such parameters in mind.

                                      I’m learning Ada 2012 and, while I started by reading the Ada Reference Manual, I was advised to read ’‘Programming in Ada 2012’’ by John Barnes by others and, having largely made my way through that, I’m rereading the standard, intending to finish it this time, and it is more comprehensible now that I’m reading with knowledge of what’s to come and so the earlier material is much more approachable now.

                                      I found it queer, learning others don’t learn in this way. I never feel the need to ask questions about standard language behavior as others do, though, either.

                                      1. 1

                                        Thanks!

                                        I found it queer, learning others don’t learn in this way. I never feel the need to ask questions about standard language behavior as others do, though, either.

                                        I agree, just often I don’t hit the standard right away. Probably because I mostly fiddle with things for months or years before doing a deep dive. Thanks for the tips!

                                    3. 1

                                      The Discord has been very helpful for me, a beginner.

                                    Stories with similar links:

                                    1. A Road to Common Lisp authored by sjl 4 years ago | 66 points | 27 comments