12 ms·
I am interested in LISP-type languages, but I have a serious case of decision paralysis. GNU Guile? Common Lisp? Clojure (JVM)? Racket? Judging by my understan
by gypsyharlot 6y ago
I am interested in LISP-type languages, but I have a serious case of decision paralysis.
GNU Guile? Common Lisp? Clojure (JVM)? Racket? Judging by my understanding of the difference between Common Lisp and Scheme, I think I am more of a Scheme type (I prefer C over C++, I like Go more than Java, etc).
- fredrikholm 6y agoRacket if you're interested in a more "pure" lisp and/or metaprogramming/DSLs. Clojure if you're looking to use the language directly to solve your problems (and my preferred Lisp).
- yw3410 6y agoIf you want live image reloading stick to a Lisp like SBCL rather than Scheme. If you care about startup times or FFI then don't pick Clojure. YMMV between Racket and Guile; I would say Racket is better insofar as the culture of documentation is really very good. In practice, once you learn a Lisp, you can jump between them without too much trouble.
- mepian 6y agoSBCL is an implementation of Common Lisp, to be precise. There is also CCL, or Clozure Common Lisp, which has the best support for macOS.
- jnxx 6y agoWhile almost all can call easily into C, one thing where Guile really shines is that it can easily be embedded and be used for scripting and configuration in a program with C building blocks.
- kazinator 6y agoIf you learn Clojure, you will not jump into Lisp without too much trouble.
- jnxx 6y agoI would love to learn more why you think this - I am sure you have good reasons! Isn't Clojure in some significant aspects similar to Schemes?
- fulafel 6y agoYou can have FFI and fast startup times on Clojure and ClojureScript.
- bjoli 6y agoIf you want batteries included and probably the nicest runtime of all the lisps I would suggest racket. I use guile since I think it more fun, but racket is a lot easier if you want libraries around.
- potta_coffee 6y agoRacket really is nice if you don't know what you want to do and you want to be hacking on some code in less than five minutes. I think I have Racket installed on every computer I own.
- gypsyharlot 6y agoThank you for the feedback! In what way is Guile more fun?
- bjoli 6y agoBecause I can understand the whole implementation. I am no programmer, but the racket source is somewhere between "magic" and "more magic" to me. I managed to patch guile to fold equal? to eq? when the comparisons involved literal symbols, chars or fixnums. (Although maybe not in the best way, it still worked). I apparentlynnerd-sniped Andy so he implemented it properly as a part of the expander (I think). That took me less than an hour starting from a cursory understanding of the guile codebase.
- potta_coffee 6y agoI tend to enjoy Scheme more than Common Lisp for just hacking around, but I'm by no means an expert Lisp hacker. If you decide to check out Scheme though, Chicken Scheme has been awesome for me. It's very fast, compiles to C, had a ton of great "eggs" (modules / packages), and seems to have a somewhat friendly community with decent documentation.
- desine 6y agoI'm in a similar boat, and I am loving both Racket and Chicken Scheme
- Decabytes 6y agoI think the first question is scheme, or Common Lisp? The answer depends on what your style is. After trying both I like scheme better but I agonized over this decision for awhile, though I enjoy sbcl and CLISP is dear to my heart. In terms of schemes you have a wide variety to pick from. Gerbil, Racket, Gambit, Chez, Chicken and many more. Racket is a great all around choice. There are schemes that do various things better than it, but it can do most things well. It has two great edX courses to learn from (How to design simple data, and how to design complex data) and is how I initially learned. Chicken is one of my favorite schemes and is probably the one I would use if I wasn't using Racket. It's so portable since it compiles to C. I love the egg system, and I like the logo. Gerbil is a performant systems level scheme. I remember there being an article about someone in the Common Lisp community considering jumping to Racket, but ending up on Gerbil Scheme for what it's worth. I haven't used it Chez is another super performant scheme, and is actually the backend for the Racket programming language as seen in the article above. It was only open sourced a few years ago so it might be difficult to find solutions or get answers. I've used Guile, I appreciate the mission, but I found it wanting. I've heard people ship Gambit scheme apps onto IOS so if you are looking at mobile apps that might be the way to go, I'm sure Chicken could do that to. I have also heard that Gambits Cffi is one of the best in the business, so if you need to interface with a lot of C code that might be the way to go.
- pjmlp 6y agoIn that case just pick the scheme dialect used by SCIP. https://mitpress.mit.edu/sites/default/files/sicp/index.html https://mitpress.mit.edu/sites/default/files/sicp/index.html After getting comfortable with Lisp based languages, it is like Algol derived ones, it is relatively easy to jump between them. I tend to stay with Clojure, because JVM/CLR is where I spend most of my time, so I can easily pig back into the libraries. Maybe what you can do is similarly, pick a Lisp variant for the domain you spend most of your time on.
- bmitc 6y agoThere's pretty much no reason to use MIT Scheme unless for a course, despite its historical significance and influence. For one, it's no longer supported on Windows. I would recommend using Racket with the #sicp language extension. https://docs.racket-lang.org/sicp-manual/SICP_Language.html https://docs.racket-lang.org/sicp-manual/SICP_Language.html
- pjmlp 6y agoSure, hence why I didn't mentioned it explicitly, thanks for the addendum.
- Blikkentrekker 6y ago> I think I am more of a Scheme type (I prefer C over C++, I like Go more than Java, etc). Scheme is not more minimalist than C.L. in practice; it's standardization is simply more fragmented and has nested layers, often by different organizations, that implementations can support, and then most implementations go well above even that. Different Scheme implementations tend to share a common base but then tend to provide functionality above that, often shared between different implementations as well.
- bmitc 6y agoI personally would recommend Racket or Clojure. Both of them are much more opinionated and closer to Scheme than Lisp, which is a bit more loosey-goosey (i.e., not focused on functional programming), so to speak. If you really want Lisp and not a Scheme-like, then Common Lisp is the only choice.
- arminiusreturns 6y agoI'm leaning towards GNU Guile these days, for a few reasons. Mostly because I am a GNU type of person, (almost all of my stack is gpl, for example) and Guile is now not only the preferred GNU extension language, but it is also the core part of GUIX, and a few other tools I really like (mcron, a cron replacement). So to explain just a bit, often I do a lot of paralysis by analysis of tooling, but as a side effect one of the things I've learned to help me get past it is to filter first based on licensing. I like Nixos, and I think the principles there are going to go far into the future, but I don't like MIT/BSD licenses. So if I want the same kind of tech, but in GNU-land, that leaves me with GUIX (the os and the package manager). Decision made. Only in the most extreme circumstances do I violate these principles (steam for gaming!) and am always looking for alternatives as they pop up. I really like the idea of compiled lisp eg common lisp, but most of the gpl friendly versions are not in active development, besides maybe Clozure CL. Clisp website shows last update was in 2010, and for some reason that really rubs me the wrong way. It's funny because I still really don't know that much about lisp, it's just on my "to get into" list, besides elisp.
- rurban 6y agoFedora just announced to kill the Guile bindings for GNU make and GDB. https://fedoraproject.org/wiki/Changes/RemoveGuileFromToolchain https://fedoraproject.org/wiki/Changes/RemoveGuileFromToolch... Apparently they dont like it that much
- arminiusreturns 6y agoThats just redhat deciding that for fedora though, GDB itself on other distros will still have support for guile. Not sure how to interpret that, though I guess working on shrinking gdb is understandable.
- bjoli 6y agoNobody uses them. Guile users tend to go "oooh, neat!" until they realize that the supported version is ancient.
- jnxx 6y agoIt is a very multi-dimensional issue. While all these languages belong to the same family, they also take some time to learn, and each has its specific strengths. It is probably very helpful to think about what matters most to you, and pick what matches your needs best for the first language. Here some axes of distinction: 1. supported programming styles 2. support for concurrency 3. performance of generated code and parallelism 4. floating-point performance 5. level of standardization 6. closeness to the system and capability to call into C functions, or functions with C ABI 7. suitability for scripting and stand-alone programs 8. GUI programming 9. Comprehensiveness and beginner-friendliness of documentation 10. REPL Programming 11. Libraries 12. Licenses Here what I know about the languages you name: (I also mention ABCL = Armed Bear Common Lisp a few times, just to illustrate that you also can run Common Lisp on the Java Platform). 1. supported paradigms - Clojure is very opiniated in supporting and demanding a purely functional style. It uses purely functional data structures. Racket and Scheme support a functional style well, but allow for seamless imperative code. Common Lisp is agnostic, one can program in a purely functional way and there are libraries with purely functional data structures, but it requires much more discipline. 2. Clojure has best support for concurrency and server-like tasks, it is made for that. Racket also supports green threads, apart from its places parallelism. 3. Racket, Chez, Common Lisp and so on support OS level threads and parallelism. Chez and Common Lisp stand out as they generate the most performant code - when it comes to raw computing power, single-threaded SBCL code will be faster than multi-threaded Clojure code. SBCL, for example, also allows to add compiler hints which generate unsafe code with better optimizations (for example, indicating that integer values will only be in a specific range). 4. SBCL has by far the best floating-point performance, I think Chez comes after that, and I'd expect Racket to improve further here. Racket has also been reviewed very favourably for scientific applications (https://khinsen.wordpress.com/2014/05/10/exploring-racket/ https://khinsen.wordpress.com/2014/05/10/exploring-racket/ - Konrad Hinsen, the author, was an early contributor to Numerical Python). 5. Of all these, Common Lisp is standardized most. Especially Racket and Clojure are defined by their implementation. 6. Clojure and ABCL allow to call into Java. In turn, all of Common Lisp, Guile, Racket, Chez allow to call easily into C. There is a performance difference, I think, between most Schemes and SBCL: Calling into a C function has some extra cost because the stack is handled differently (I think it is because of continuations). I also tried to call into Rust functions from Racket and that works very nicely. 7. Clojure's startup time is simply too slow for scripting. It is also a bit hampered in that it runs on the JVM. There is babashka, which is interesting but has no mature status. Conversely, Common Lisp and Racket are well suited to scripting. It is also possible to compile SBCL and Racket programs into a single executable. I think SBCL supports this case best, for running Racket programs, an extra runtime library or a standard Racket installation is needed. Guile is also well-suited to scripting and is closer to the OS than some other Lisps. 8. Racket has a very nice support for GUI programming with a platform-independent functional API. Clojure and ABCL also allow to call into Swing and Fx code written in Java. I have not tried the rest but it looks relatively painful and brittle in comparison. 9. Racket has very comprehensive and high-quality documentation good for beginners. Clojure is also comprehensively documented, but might assume a bit more experience. Common Lisp is, as an open system, more eclectic, and this might lead especially beginners to underestimate how mature and good it is. It is very under-hyped compared to Clojure. But there is the Common Lisp Cookbook on the web, which is really good. I can also warmly recommend the books "Practical Common Lisp" by Peter Seibel, and "Common Lisp Recipes" by (corrected!) Edmund Weitz. If you want to have true understanding, and are about to write industry-grade robust software, they are really worth every cent. 10. REPL Programming: Lisps and Schemes such as Racket have a subtle difference which affects the style of programming. In Lisp, everything is dynamic and you can re-load and evaluate parts of the program when it is running. This makes for a great development environment. In contrast to that, Racket for example has a clear distinction between compilation time and run time, which gives certain safety and correctness guarantees, but requires that the program is re-loaded more often during development. 11. Libraries: Racket has a distinct "Batteries included" feeling which makes it nice for beginners. Clojure uses Leiningen which runs on top of Maven to automatically retrieve libraries, it works very well. Racket has a similar system. Common Lisp is more eclectic again, what is used today is quicklisp and asdf (see the Common Lisp Cookbook). There is also a reasonable support in OS Packages e.g. in Debian, and in addition GNU Guix is a very interesting solution for packaging of Lisp libraries and in polyglot projects. 12. Licenses: Clojure has a non-copyleft license (Eclipse License) which might be an obstacle if you want to publish copyleft libraries and code (not sure about the exact limits here but the problem is that in a Lisp system, there is less clear of a boundary of system or language code and your own code, so it is probably advisable to use a language with compatible license if you want to publish copyleft code). Racket is Apache 2 which is GPL compatible. Guile is, as part of the GNU system, GNU LGPL. In summary, I think Racket is great for beginners, although you could start with all of them. Clojure is fantastic for servers and to learn about functional programming. Guile and Racket are great for scripting. Common Lisp, and especially SBCL requires a bit more learning effort at the beginning, but it is a really mature and highly performant system which gives you a lot of freedom.
- kazinator 6y agoThough people use Clojure for real work (just like PHP, Perl, Bash or Fortran), it has a narrow ideological focus which is radically different from the multi-paradigm nature of historic Lisps. It can be described as a domain-specific language for processing several kinds of immutable data structures as generic sequences, with Lisp-like syntax and meta-programming. You may learn something about Lisp from Clojure, but the big picture is missing; Clojure is "its own thing", mostly disconnected from the Lisp history, culture and practices. Clojure expertise will not transfer well to Lisp and vice versa.
- jnxx 6y agoClojure with its focus on immutability and its purely functional data structures makes it much easier to write correct concurrent programs. It is clearly geared to servers, for example sequences are always lazy. This is not always the best thing but for servers, it seems in general better. However, there is a subtle point about parallelism: One typically wants concurrency and parallelism for one of three objectives: 1. Concurrency in servers 2. Graphical user interfaces 3. exploiting many cores for complex parallel computations, like number crunching It turns out that Clojure is great for the first application. It also works for the second one. However it is not that great for the third area of interest. The reason is performance. For example, floating point numbers passed in function arguments are often boxed. Also, due to the JVM it is not possible to pass even small objects by value. These things put a lot of pressure on the garbage collector, even if the Clojure compiler partially tries to work around this. And the result of that is that a single-threaded program which does things like massive number crunching written in Common Lisp will be faster than a parallel program written in Clojure. But I still think that immutability in-the-large is the right way to go.