Comment by eimrine

3 years ago

I would like to compare this thing with real Lisps in the terms of abilities.

Also I would like to know the correct transcription of the name.

I find it interesting to compare Janet to Guile Scheme because they both claim to be fit as embed-able scripting languages.

Haven't done any practical comparison yet bc Janet has only caught my eye recently (;p), but it appears to have a culture of vendoring and an edge in implementation size and complexity which (ideally) enable diving into the language's implementation to scratch your own itches, learn how it (and the stack in general) work more throughly, and allow eg. low level code optimizations with less FFI boilerplate.

I wonder how executable size and performance pan out, but with C FFI available in each language (and the reality of how much time optimization is worth), I feel that comforts matter more.

Color me intrigued!

I mean, let's be real: if you have SBCL and QuickLisp most newer S-expression based languages don't have much to offer.

  • no

    I readily admit, though, that not all software development needs to be flexible and big-application focused. To that end there are many things Common Lisp is not so good at. Common Lisp is not good at being pretty out-of-the-box, it's not good at minimalism, and it's not good at prescriptive or dogmatic programming styles. I've personally not been convinced of the various approaches to using Common Lisp as a scripting language (especially because of standard multi-stage execution). Common Lisp also has an unusual learning curve: there's an initial hump of learning Lisp's oddities (DEFVAR/DEFPARAMETER, CAR/FIRST, no hash table syntax, lots of EQ[UA]L-ity functions, systems vs packages, LOOP/DO/DOTIMES/DOLIST, "Neo, there are no lists in Lisp", ...), followed by a longer path of soaking in the extensive facilities offered by the language. There's just... a lot of content. And in part because of its idiosyncratic nature, no singular approach to learning it works for everyone.

    Common Lisp is pretty anemic when it comes to extreme use of functional programming. It's wholly capable and serviceable, but most library writers don't go whole-hog with FP, and Common Lisp by default makes FP a little stuffy (it requires functions bound to variables to be called with FUNCALL, and it requires defined functions to be referenced with #' syntax). There is very little support for functional data structures; the FSET library seems to be what most people suggest.

    https://old.reddit.com/r/lisp/comments/123edgv/im_considerin...

    • > Common Lisp is not good at being pretty out-of-the-box, it's not good at minimalism, and it's not good at prescriptive or dogmatic programming styles

      These things help you learn to program, but they do not help you program.

      At some point the box is open, at some point your problems are big and nobody else has done them before. It is in this moment that CL is good, and perhaps better than anything else.

      > There's just... a lot of content.

      That's some of the stuff that helps you program, because if you didn't have it and you needed it, you'd have to write it.

      > no singular approach to learning it works for everyone.

      So what? "Everyone" is your competition. Why do you care what works for them?

  • I’m relatively unfamiliar with lisps. Are all S-expression languages not created relatively equal? What is the difference between a “good” S-expression language and a “poor” one?

    • Well, tastes in programming languages differ from person to person of course; you may as well ask what makes Ada better or worse than Pascal or Algol68 and Rust.

      I personally am very fond of the strong support SBCL has for type checking, which is something I find many Lisp-inspired languages just don't seem to care about.

      Every programming language has its strengths and weaknesses, S-expression based languages are no exception, though what I consider a weakness in a language someone else may consider a strength. Things that come to mind immediately are CL's case insensitivity (Ricardo Signes' talk A Million Billion Squiggly Characters touches on the problems with case insensitiveness), Clojure's decision to randomly use square brackets for expressions that have no need for them (this is one thing I know that other people are fans of), and Bel's streams operating on bits (as in 1/8th of a byte).

      Though what got me to try CL in the first place was someone mentioning that SBCL is fast, and given that it is still a GCed language, it really is. With Scheme I was bouncing back and forth between Scheme and C because I was unsatisfied with the performance, but with CL I don't feel a need to use C as it is fast enough.

    • Many Common Lisp users unfortunately have this tendency to refer to other Lisp dialects as "not real Lisp" and often don't bother to explore the value propositions of the newer dialects, particularly Clojure-inspired dialects such as Janet. At least, this has been my experience as a Clojure user for several years now.

      1 reply →

    • There is endless variety in lisps and lisp-like languages. It's one of this language family's greatest strengths, and greatest weaknesses.

  • Apologies for the question, but to clarify you’re saying that you much prefer the libraries that QuickLisp provides and find Lisp languages lacking.

    I’m debating whether to dive into Common Lisp for a new project. I’ve been a fan of Lisp for a while, much prefer parentheses over other notation, and have dabbled over the years by doing things like SICP and writing my own toy Lisp.

    Common Lisp comes across as one heck of a battle-tested language and libraries. But I’m debating how much of a learning curve I’ll have on the front end just getting used to SBCL/Emacs/Slime and the various libraries. And I’m not sure that I “get” the interactive workflow yet but def would love to.

    • I can't speak for parent but I'm currently writing a one-man SaaS using common lisp on the backend and vanilla js on the frontend, and it's been great so far. SBCL's compiler produces very performant code and I find I can be very productive in lisp. The library ecosystem isn't quite as rich as, say, python's but it's still good.

      My chief complaint is that if you stray too far off the "happy path" of well-known libraries the quality (or even presence of) the documentation tends to decrease dramatically.

      5 replies →

  • Strongly disagree. SBCL is not embeddable. It produces huge binaries. Managing and versioning dependencies is very difficult.

    Newer dialects like Janet and Fennel address these deficiencies.

    • > It produces huge binaries.

      My binary with dozens of dependencies (the compiler, the debugger, a web server and all that's required for a web app) is ±30MB, it starts up in 0.40s. The non-compressed binary weighs 120MB and starts in 0.02s.

      > Managing and versioning dependencies is very difficult.

      You can use Qlot and CLPM these days.

      Alexander of 40ants made a demo: https://www.youtube.com/watch?v=jLkqYVTqM38 (with english subs)

    • Thankfully SBCL is just an implementation and not the language ;)

      There are alternative implementations, like ECL, which is capable of transpiling to C and producing small binaries and dylibs. Then there are implementations like CCL, which have low memory footprint (a freshly booted image consumes ~6.8 MB RAM on my Mac). Lastly, there are commercial implementations like LispWorks and Allegro CL which offer tree-shaking, unlike all other implementations.

    • That's why Common Lisp is a standard and has different implementations.

      ECL for example is called "Embeddable Common Lisp". https://ecl.common-lisp.dev/

      ABCL is embeddable into Java.

      LispWorks and Allegro CL can compile to shared libraries, which are embeddable.

      SBCL, OTOH was not developed with the goal to be embeddable.

I’m on the verge of trying Racket to write my own DSLs. I wonder if Janet is better for this task?