• vtail a year ago

    The most unexpected news to me was that Hacker News, apparently, runs on top of SBCL now, via a secret implementation of Arc in Common Lisp!

    • Y_Y a year ago

      Ya, when are we going to hear about "Clarc"? Where's the source?

      • tmtvl a year ago

        I read that the source won't be made available because it contains some anti-spam (anti-abuse?) measures that would be easily circumvented if the source were open. Security through obscurity is famously no security at all, but I can see how it can reduce the noise that dang has to deal with a bit.

        • darthrupert a year ago

          Anti-spam isn't security in that sense. Perfection is not required when dealing with irritation.

    • Onavo a year ago

      Everybody forgets about SICL. It's one of the few new CL implementations that's not proprietary or copyleft.

      https://github.com/robert-strandh/SICL

      • veqq a year ago

        Truly, I've never heard of it and it didn't come up searching in any of my favorite spots.

        • KingMob a year ago

          I wonder how often people encountering it assume it's a typo of SICP?

        • pronoiac a year ago

          I've worked on PAIP, and I think the GitHub.com version - https://github.com/norvig/paip-lisp/ - gets more attention than the GitHub.io version linked here. The GitHub.io version automatically gets updates, I think, but I'm not verifying the Markdown works over there.

          • superdisk a year ago

            Hey, my little webassembly demo was linked, cool. Nice article!

            • sorrythanks a year ago

              so was mine!

            • nesarkvechnep a year ago

              A few cool thing happened! I might give the CLOS course a try! I’m a functional guy but I feel CLOS isn’t your typical object system.

              • pjmlp a year ago

                Indeed, most successful FP languages have their OOP like approaches.

                Another thing all modern Lisps have since the 1980's, is all major data structures, not only lists as many think when discussing Lisp.

                • ludston a year ago

                  Common Lisp isn't a functional programming language to be clear.

                  • pjmlp a year ago

                    It definitely isn't one, when instead of looking at it with the eyes of CS knowledge, people take the mindset whatever Haskell does.

                    FP predates Haskell by decades.

                    • ludston a year ago

                      It also isn't one when "looking at it with the eyes of CS knowledge", given that Common Lisp has very powerful support for OO and procedural programming out of the box, and in order to most effectively use an FP style it's necessary to rely on community developed libraries...

                      • pjmlp a year ago

                        What FP style? Haskell style, I guess.

                        When I learnt Lisp, Lisp and Scheme were FP, Miranda was still around, and Caml Light had just started being known outside INRIA.

                        I really dislike revisionism regarding what it means to be FP.

                        • veqq a year ago

                          The issue's that Schemes (and Clojure) are way more functional than Common Lisp and e.g. `funcall` feels like a kludge compared to lisp-1. If you read the old CL codebases or modern code, destructive and imperative use are common, so it doesn't feel terribly revisionist (just compared to pascal, c, bliss etc.).

                          • andsoitis a year ago

                            Wikipedia page for “functional programming”:

                            ”The first high-level functional programming language, Lisp, was developed in the late 1950s…”

                            https://en.wikipedia.org/wiki/Functional_programming

                            • ludston a year ago

                              Common Lisp has Lisp in the name, but it is not the same thing. We're talking about languages developed 30 years apart here.

                              In the 80s, things like immutability just weren't pragmatic due to memory constraints, and CL was designed with pragmatism in mind. Scheme could be argued as FP. Clojure certainly is. CL is not.

                            • pjmlp a year ago

                              So that rules out most ML derived language as well, pity Standard M, OCaml, F#, Scala are no FP as well. /s

                    • fovc a year ago

                      Having the data structures is nice and all, but using them is kind of painful. They are certainly second class.

                      Having to use accessor functions or destructuring macros instead of just a period or -> is often annoying too. The lack of syntax has cons as well as pros.

                      • pjmlp a year ago

                        Everything needed is place, there is no second class about using arrays instead of lists.

                        • cenamus a year ago

                          I mean you can write a macro that let's you write

                          (object -> slot)

                          and transforms it to (slot object)

                          "->" should be unused

                          • tmtvl a year ago

                            Writing a reader macro that allows for something like...

                              [some-numbers 0]
                            
                            ...to get the first (many programming languages make this mistake, using 0 to refer to the first element of a collection, so we can forgive CL for this) element. But I'm curious how you can write...

                              (object -> slot)
                            
                            ...without getting an error about OBJECT not being a valid function or macro.
                            • kazinator a year ago

                              > so we can forgive CL for this

                              The 1962 dated Lisp 1.5 Programmer's Manual already describes a 0 based array feature. Lisp was clearly one of the historic instigators of zero based array, rather than just playing along.

                              • tmtvl a year ago

                                Yes, but the various Lisps that Common Lisp is the more-or-less common subset of are (were?) all 0-indexed. Between easy heap implementation (left is (ash index 1), right is (1+ (ash index 1)), parent is (ash index -1)) and easy last element selection (nth seq (length seq)) I prefer 1-indexing, but I realize that's an unpopular opinion.

                              • Jach a year ago

                                A late reply but it's worth addressing one way of doing this. First, your concern about object not being a valid function or macro isn't relevant at read time. Second, note that Lisp already has similar syntax: '(1 . 2) is essentially (cons 1 2). Implementing this type of syntax is not a privilege of the implementation alone. You're allowed to redefine your own reader for left paren. In SBCL:

                                    CL-USER> (get-macro-character #\()
                                    SB-IMPL::READ-LIST
                                
                                You can write `(set-macro-character #\( 'sb-impl::read-list)` and everything continues to work just fine. You can also jump-to-source and modify it if you want -- though it's cleaner to just copy it out to your own project, that's what I did for a quick hack/proof of concept. Essentially I added before the existing (when...) which handles the special dot syntax:

                                      (when (and (eq firstchar #\-)
                                                 (eq (peek-char t stream t nil t) #\>))
                                        (read-char stream t) ; actually read the nextchar > to discard it
                                        (let ((next-obj (read stream)))
                                          (sb-impl::flush-whitespace stream rt)
                                          (return `(slot-value ,@listtail ',next-obj))))
                                
                                I won't claim this is good or proper, but it shows that it's quite feasible. We've turned (foo -> bar) into (slot-value foo 'bar).

                                    CL-USER> (defclass vec2 ()
                                      ((x :initarg :x)
                                       (y :initarg :y)))
                                    #<STANDARD-CLASS COMMON-LISP-USER::VEC2>
                                    CL-USER> (defparameter vec (make-instance 'vec2 :x 3 :y 4))
                                    VEC
                                    CL-USER> (vec -> y)
                                    4
                                    CL-USER> (read-from-string "(print (vec -> x))")
                                    (PRINT (SLOT-VALUE VEC 'X))
                                    18
                                
                                Personally I wouldn't use this even if it was more properly/carefully implemented. (There's really no reason to replace the default left-paren reader, and no reason we have to have a space surrounding the "->". One thing I like about the infix reader macro package https://github.com/quil-lang/cmu-infix is that it doesn't care about spaces, I can write #I(1+1 + 4) and get 6.) I'm quite happy putting my class in its own package, and thus getting the primary tab-completion behavior I care about. e.g. "(ma:<tab>" could complete to "(math:" and then "(math:v<tab>" could complete to a list of options like "vector-x" "vector-y" or so on. I also like the somewhat unusual approach of naming my accessors with a dot prefix, e.g. (.x vec) and (.y vec), or even (math:.x vec) if I haven't imported the symbol.
                                • tmtvl a year ago

                                  Good things are worth waiting for. I never considered making a reader macro for a regular opening bracket, that's equal parts genius and insanity.

                                • fovc a year ago

                                  And also make sure that slot is a symbol in the correct package. Or do like Elisp and do without packages but then have a 16 character prefix

                          • runevault a year ago

                            As someone who's dabbled with Scheme, Clojure, and CL long ago and started wanting to get back into CL, I really enjoyed that course as a combination refresher plus deep dive into some topics I didn't really know before (including CLOS).

                            • nextos a year ago

                              CLOS is great, but CL also supports pure typed FP with https://coalton-lang.github.io

                              Coalton progress is discussed briefly in the OP: https://lisp-journey.gitlab.io/blog/these-years-in-common-li...

                              • trenchgun a year ago

                                Coalton is its own language, just implemented and embedded in CL.

                                • nextos a year ago

                                  Sure, but Coalton has decent interop with CL.

                                  Eventually, I expect this to be a relationship similar to Java and Scala or Clojure.

                              • dartos a year ago

                                As a functional fan, CLOS is amazing.

                                • f1shy a year ago

                                  When I learned CLOS it was the first time OOP started making sense for me.

                                • codr7 a year ago

                                  My main takeaway was multi-methods, they didn't really click for me before I started seriously digging into CLOS. I wish more languages supported them/played around with similar ideas.

                              • waynenilsen a year ago

                                Is there a web framework that is reasonably popular/supported?

                                • aidenn0 a year ago

                                  What do you expect from a web framework? That means different things to different people. I don't really like frameworks, so I used a web-server abstraction layer named "clack."

                                  Radiance[0] is a more traditional web-framework, with interfaces for backend-storage, web-servers, templating, authentication &c.

                                  Hunchentoot gives you basic route definitions out-of-the-box (bring your own database), and for something more full-featured there is CLOG[1] and Reblocks[2]

                                  0: https://shirakumo.github.io/radiance

                                  1: https://github.com/rabbibotton/clog

                                  2: https://40ants.com/reblocks/

                                  • runevault a year ago

                                    Might be worth checking out this[1], one of the sites linked from awesome-cl that teaches setting up webdev. And looks like it uses Hunchentoot which is what I've always seen every time I looked into backend webdev in CL

                                    [1]: https://web-apps-in-lisp.github.io/

                                    • silcoon a year ago

                                      Caveman2 is a good framework used with lack and clack. There are tutorials on the web.

                                      • tempodox a year ago
                                      • cracauer a year ago

                                        Too bad the jobs are all gone by now.

                                        • -__---____-ZXyw a year ago

                                          A complete treasure trove, wonderful!

                                          • osmano807 a year ago

                                            I really like this, as from an outsider it seems that CL doesn't have a community and the few packages it has are more like building blocks for customizing and implementing you required functionality rather than packaged black boxes. With all those new languages, it appears that the value proposition of CL is dwindling, static checking feels primitive, macros are easily attainable now, and live runtime image manipulation misses the point on the world of short lived containers.

                                            • reikonomusha a year ago

                                              CL has Coalton, which is the implementation of a static type system beyond Haskell 95. Full multiparameter type classes, functional dependencies, some persistent data structures, type-oriented optimization (including specialization and monomorphization). All integrated and native to CL without external tools.

                                              Live image manipulation isn't quite as useful as it once was for runtime program deployment. But it's still a differentiating feature for incremental and interactive development—before you compile binaries to deploy. Tools like Jupyter notebooks don't come close for actual (especially professional) software development.

                                            • Greentheodore a year ago

                                              [dead]

                                              • Aguad84 a year ago

                                                [dead]

                                                • amatob23 a year ago

                                                  [dead]