KamilaLisp – A functional, flexible and concise Lisp

128 points by tluyben2 1 year ago | 54 comments
  • tluyben2 1 year ago
    Impressive feature list with a book to learn the language.

    Featured on Arraycast:

    https://www.arraycast.com/episodes/episode74-kamilalisp

    • shrubble 1 year ago
      This is the second Lisp, in addition to APRIL, which combines Lisp concepts with APL concepts. Wonder if that is going to be a trend in the future?
    • bloopernova 1 year ago
      Slightly related question:

      Do any editors have a "translator" kind of tooltip or panel that explains what each symbol does in languages like APL or KamilaLisp?

      I was thinking about how I'd go about learning the various symbols involved in such a language, and I learn best by reading and modifying existing code, so something that helps me understand what I'm looking at would be nice.

    • lispm 1 year ago
      The KamilaLisp repository contains a version of ABCL (Armed Bear Common Lisp for Java) and of Fricas (a computer algebra system written in CL).

      What are those used for?

      • trymas 1 year ago
        I thought I have seen this name…

        malbolge-lisp: https://github.com/kspalaiologos/malbolge-lisp

        HN discussion: https://news.ycombinator.com/item?id=28048072

        She’s a genius prodigy.

      • anthk 1 year ago
        Check out stutter from the Computational Beauty of Nature too:

        https://github.com/gwf/CBofN

            cat data/demo.lisp | ./bin/stutter
        
        Have a look on the file on how integers and aritmetics are implemented.

        The books explains that, but is not free. But you can get it somewhere else.

        • 1 year ago
          • hislaziness 1 year ago
            Inspired by MalbolgeLISP which was a lisp written in Malbolge.
            • anonzzzies 1 year ago
              Are they related? I mean same author, but they seem not related besides the Lisp part. Both are pretty impressive feats for someone who is only 19 though.
              • jonahx 1 year ago
                Really impressive for any age.

                Quotes about Malbolge:

                "The day that someone writes, in Malbolge, a program that simply copies its input to it's output, is the day my hair spontaneously turns green. It's the day that elephants are purple and camels fly, and a cow can fit through a needle's eye."

                "There's a discussion about whether one can implement sensible loops in Malbolge—it took many years before the first non-terminating one was introduced. A correct 99 Bottles of Beer program, which deals with non-trivial loops and conditions, was not announced for seven years; the first correct one was by Hisashi Iizawa in 2005."

                • ergonaught 1 year ago
                  "KamilaLisp, the language described in the book, originates from its previous iterations - v0.1 and MalbolgeLISP."
                  • anonzzzies 1 year ago
                    Ah! I stand corrected, thanks. I opened the github and saw APL, Haskell, Lisp. Interesting as this new effort looks pretty serious while the Malbolge, while an incredible feat, is more a joke I guess.
              • karmakaze 1 year ago
                It would be helpful if the Features were separated by language vs library. I don't know what to make of

                  No memory side effects, all collections are persistent.
                
                This can't be relevant when the objects referenced by these collections are mutable.
                • kazinator 1 year ago
                  > separated by language vs library

                  You're totally new to Lisp, right? There is no such clear boundary in Lisp languages.

                  > This can't be relevant when the objects referenced by these collections are mutable.

                  Why not? Explain your reasoning. E.g. why is not not relevant that we can make a longer list by adding an element to the front of a shorter list, without mutating that shorter list, if the elements are objects that support mutation?

                  • karmakaze 1 year ago
                    How so? Tail-call optimization would be a language feature. The math/graph operations in a lib/module etc.

                    An example would be if presence in a collection is dependent on mutable properties of its entries.

                    • Kamq 1 year ago
                      > Tail-call optimization would be a language feature.

                      Most lisps generally do it this way (except maybe emacs lisp?), but there's not really a requirement for it to be a language feature. TCO is really just AST manipulation, and lisp macros are more than capable of that, although you might want to hook into the reader as well if Kamila supports it (I didn't see anything about that in the github readme).

                      • kazinator 1 year ago
                        cons is a graph operation and + is a math operation. Go on ...
                    • 1 year ago
                    • hyperbrainer 1 year ago
                      This could actually be nice for code golf.
                      • mm007emko 1 year ago
                        Looks great, however it's licensed under GPL. Does it mean that ALL programs in that language have to be GPL as well?
                        • Zambyte 1 year ago
                          No.

                          Edit: though I thought about it a little more. The more interesting question is regarding the standard library, rather than the compiler. Applying different licenses to the two is not unusual (gcc is GPL, glibc is LGPL). From what I can see, the standard library is embedded entirely into the compiler, and thus yeah, I do think programs that use this would actually have to be GPL. Not that that's a bad thing though :)

                          • Tomte 1 year ago
                            More important than the standard library (which isn‘t so standard, just conventional, see musl) is the GCC Runtime Library, which is GPLv3, but with the "GCC Runtime Library Exception".

                            There is also an interesting question about license compatibility between GPLv3 and GPLv3 with RLE, but that is mostly ignored by everybody.

                          • kazinator 1 year ago
                            Unless KamilaLisp specifies exceptions to the GPL, it means that if you ship your own KamilaLisp program in a way that is combined with KamilaLisp (for instance compiled into one big executable that includes the KamilaLisp run-time) then the entire combination has to be distributed under the GPL, meaning that your program has have a GPL-compatible open source license.

                            Programs that are not combined with KamilaLisp, only requiring an installation of KamilaLisp for their execution, almost certainly don't have to be GPLed.

                            • anthk 1 year ago
                              No. If you are a GCC user, you should know that.
                              • mm007emko 1 year ago
                                As a GCC user I know that GCC has a runtime library exception in the license. This doesn't.
                                • kazinator 1 year ago
                                  You don't need to combine your program with GCC in order to ship it.

                                  Except in the case of libgcc, which is not just GPLed, but has a GCC Runtime Library Exception.

                                • 1 year ago
                                  • tagfowufe 1 year ago
                                    [flagged]
                                • behnamoh 1 year ago
                                  I said this in another thread too, but the problem with Lisp is that it's sorta bundled with Emacs, so if you want to use LISP's powerful REPL you really have no choice other than learning Emacs. Essentially, Lisp is not just a "language"; it's a whole system designed to explore programming ideas. It includes the IDE, the minimal syntax, REPL, compiler, etc. All of this together makes "Lisp" the powerful and enlightening tool that people talk about.

                                  I think the other "inconveniences" of Lisp could be more tolerable for beginners if learning the language didn't require learning a new IDE (or OS, depending on how you define Emacs!). But at that point you'd have to forego a major benefit of using Lisp (its REPL); you'd be back to writing "dead" programs, not image-based "live" ones.

                                  Another problem I've faced with Lisp is lack of good documentation (except for Racket, but then again, Racket doesn't have Common Lisp's powerful REPL). Every website that teaches Lisp is in ugly HTML+CSS-only style, compare that to the more user-friendly websites of other languages.

                                  Then there's the issue of up-to-date learning material. Aside from the fact that there are very few resources to learn Lisp, the ones that are available are too old too. "Practical Common Lisp" (2005), "Common Lisp Recipes" (2015), "ANSI Common Lisp" (1995), etc.

                                  I like the philosophy of (s-exp) but modern lisps have ruined its simplicity for me by introducing additional bracket notations [like this]. It's confusing for me as a beginner to distinguish between (this) and [that], and honestly goes against the whole idea of "code and data look the same" motto.

                                  • gumby 1 year ago
                                    > I said this in another thread too, but the problem with Lisp is that it's sorta bundled with Emacs, so if you want to use LISP's powerful REPL you really have no choice other than learning Emacs.

                                    You can use Medley which is Interlisp-D, a different, parallel strain of Lisp, a descendent of MACLISP, itself an ur-lisp ancestor of Interlisp, emacs lisp (older than EMACS, which didn’t start out as a lisp program at all), CommonLisp, Multics MACLISP and that even begat Scheme.

                                    Interlisp didn’t even keep its code as text files (though I wrote an eMacs for it at PARC back in the early 80s) so you may find it more accessible.

                                    • vindarel 1 year ago
                                      • egnehots 1 year ago
                                        What about clojure? IntelliJ & VS Code are also popular IDEs for it. It also support datastructure literals vec [1 2 3], map {:a 1 :b 2} which are mostly considered as helpful for beginners since it's closer to what they are used to in other languages.
                                        • jabradoodle 1 year ago
                                          While I use emacs and I'm not too familiar with other editors I'd question how true this is today, clojure in particular is often written with vscode, intelij and vim, all seem to have good repl support.
                                          • wglb 1 year ago
                                            Well Paul Graham and team built ViaWeb with VI and it worked very nicely.
                                            • lispm 1 year ago
                                              > Lisp is that it's sorta bundled with Emacs ... Essentially, Lisp is not just a "language" ... All of this together makes "Lisp" the powerful and enlightening tool that people talk about

                                              Here we have a conflict: Lisp survives, because it is different and ground breaking. Like Bach, Shakespeare, Einstein, ... But it is also old. If you study Bach, you'll find that he composed for instruments which are out of fashion, like the Harpsichord. When do we last have heard one of his compositions on an original instrument from the time he was living? His music has been reused, re-interpreted, but the original impression, live played on historic instruments is rare.

                                              Lisp is also not "modern", it's not fitting into the "fast fashion" world of current software with ever faster hype cycles, where JavaScript creates hundred new variants frameworks every day and your software from a five years ago is no longer supported. Like our phone doesn't get any software updates after five years (if not earlier).

                                              There, a book like "Paradigms of Artificial Intelligence Programming, Case Studies in Common Lisp" by Peter Norvig is outdated. At the same time it might be a timeless classic.

                                              The tooling for it has been developed and accumulated over decades and can't be reimplemented every other year. It's not powered by Microsoft, a trillion-dollar company, currently fueling the AI hype. Lisp is not in the hype cycle industry.

                                              Using GNU Emacs plus extensions like SLIME or SLY as a dev-environment is just an effect on the low amount of resources and the concentration on a tool, which is itself programmable in Lisp. None of the other IDEs (IntelliJ, Visual Studio, ...) is easily extensible in Lisp.

                                              > not image-based "live" ones.

                                              to have "live programs" doesn't need "images". Image-based development is something different. For example ECL has the usual Lisp tools embedded, but can't create or start images. SBCL can save and load images, but doesn't use it much, beyond being able to deliver applications with it.

                                              The real image-based development tools like Interlisp/Medley (-> https://interlisp.org ), Symbolics Genera, LispWorks ( https://lispworks.com ), etc. few people have ever seen or used. None of those use GNU Emacs as a dev environment.

                                              > learn Lisp, the ones that are available are too old

                                              Lisp is old, too.

                                              The newer versions are no longer Lisp. It is nicely in the web, but it is no longer Lisp, like SICP has shown

                                              https://sourceacademy.org/sicpjs/4.1.1

                                              • 1 year ago
                                              • James_K 1 year ago
                                                > 0.3.x.y where a bump of x signifies a breaking change, while the bump of y signifies a non-breaking change

                                                If only regular version numbers had some way to encode this relationship.