5 ms·
Great to see the project is still going strong, I kinda want to try CL but I always feel like I don't have a great use-case.
by NeutralForest 2mo ago
Great to see the project is still going strong, I kinda want to try CL but I always feel like I don't have a great use-case.
- GalaxyNova 2mo agoCL can be used pretty much anywhere nowadays, even on the web with ECL wasm compilation.
- NeutralForest 2mo agoI have a todo list longer than the Tour de France I want to tackle first!
- ivxvm 2mo agoAnywhere is where exactly? I've been thinking of where I could use it for like 10 minutes, and I couldn't come up with anything. Maybe a game engine or web services. It wouldn't make much sense for any kind of desktop software or command line utilities that are supposed to start really fast and have minimal runtime.
- ux266478 2mo agoA binary has a startup time of like 20 milliseconds, the overwhelming majority of that is setting up page tables iirc. While that's a lot for a small cli utility called in a loop, it's really nothing for a desktop application. I wish more desktop applications could hit even a 100ms startup time. These days it feels like 5 seconds or more is the norm.
- deleted 2mo ago[deleted]
- klibertp 2mo agoOn the contrary, CLI, TUI, and desktop GUI apps are basically the only kinds of apps that benefit from CL and can live with its shortcomings. The startup time of a tool written in CL is short: you just need to load the image into RAM, run some hooks (if configured), and you're good to go. If you don't include loads of dependencies, the dumped image is also not too big, so loading it from an SSD is almost instantaneous. The startup is of course nowhere near that of a small C or Zig binary, but for larger tools it will be tolerable. For TUIs and GUIs, you can work on them interactively and see the changes in the source immediately reflected in the interface of a running instance. Web services need either cooperative concurrency or M:N concurrency due to the "10k problem". CL only supports threads (OS-level) and promises; everything else is incomplete (eg., delimited continuations, which could be used to build coroutines) due to missing parts in the spec and some language features (eg., conditions and restarts). Of course it can be done, but it won't be as pleasant as using Elixir and Phoenix. A game engine would work, most likely, unless it was for an MMO (again, concurrency handling). I personally never worked on one, but I see examples of game engines in CL, and they tend to look nice. In general, single-user desktop (CLI, TUI, GUI) apps are still a good fit for CL, even today (you need to put some work into packaging the app for different platforms, but it tends to be easier to set up than it is for C or C++; harder than Go or Rust, though). It's unfortunately not as good a fit for the backend, at least not until an implementation with good support for concurrency appears. It's nice as an extension language in a larger app (through ECL), and as far as dynamic languages go, it's quite performant, so some computation-heavy apps can benefit from using CL (with SBCL). On the other hand, the ecosystem is quite small, which means dependency-heavy apps are better written in something like Python or a mixture of CL and another language (there are two-way bindings to many dynamic languages and there's mature FFI support for compiled languages). To be perfectly honest: as much as I love Lisp, I personally gave up on trying to use it, for now. For hobby stuff, I found an even more niche solution that is more enjoyable to work with in the GUI/TUI/CLI space. It also doesn't support OS-level threads, but instead provides coroutines for concurrency - I find this side of the trade-off to be useful/beneficial more often, at least in the code I tend to write. I don't believe the time spent learning CL and other Lisps was wasted, but it's become harder and harder to justify going for CL over the past 15 years, and I finally reached a point where I stopped trying. YMMV though, and I would still give CL a chance if it's your first language of this kind (i.e., providing image-based interactive development, a dynamic language with a native compiler with inline assembly support, a multimethod-based object system, and homoiconicity/macros, etc.).
- fuzztester 2mo ago>For hobby stuff, I found an even more niche solution that is more enjoyable to work with in the GUI/TUI/CLI space. What is that solution?
- klibertp 2mo agoGToolkit[1] - a Smalltalk environment that's based on Pharo but replaces the UI framework and some other parts of the stack. It uses Rust through FFI to interface with and bundle native dependencies. I don't remember the exact numbers, but when I checked, the GT+Pharo ecosystem (available packages, number of people in Discord, tools with support for the language, etc.) was ~2x smaller than Common Lisp's. It also comes with its own problems, some of which CL doesn't suffer from (the GIL, performance, startup time). But it's very fun to use and play with, which is the most important quality for me in my hobby/side-projects. :) [1] https://gtoolkit.com/ https://gtoolkit.com/
- fuzztester 2mo agothanks.
- wduquette 2mo agoWhat GUI would one use with SBCL? Is it cross-platform, Linux/Mac/Windows?
- Jach 2mo agoYou can use most of the popular GUI libs, there's a couple Lisp-specific ones but they're not nearly as featureful. https://lispcookbook.github.io/cl-cookbook/gui.html https://lispcookbook.github.io/cl-cookbook/gui.html collects most of them; though for gtk4 I'd recommend https://github.com/crategus/cl-cffi-gtk4/ https://github.com/crategus/cl-cffi-gtk4/ But no matter what you use I think the experience is going to be a bit rough. CLOG is probably the most interesting non-traditional framework but you do have to accept some web idioms. I'm confused by the GP's assertion that backends aren't a good fit because of the threading model, to me they're one of the best fits. The 10k problem isn't a concern for most software, and in any case there are ways around it. (I don't know what Google Flights does but even at their scale they haven't moved off SBCL. And Hacker News itself runs fine on SBCL, though there probably aren't 10k concurrent connections.) In the ecosystem, there's the https://github.com/fukamachi/woo https://github.com/fukamachi/woo webserver which binds to libev to handle similar scale as Go was advertising about 10 years ago. And besides some work going on recently on the SBCL dev mailing list to add native fibers/green-threads, there's been non-native versions of them before, and basically any concurrency model you can think of has been built on top of SBCL by someone. (STM, actors, async (one even built on libuv), channels, promises/futures...)
- srparish 2mo agoAn extensible LLM agent (such as https://pi.dev/ https://pi.dev/ or maybe hermes) written in common lisp could be interesting. Conditions and restarts and general debugging and repair of the live system, fast startup, native execution speeds, ability to add or replace or modify core functionality on the fly, solid multi-threading support, dynamic introspection including documentation, CLOS and multiple dispatch, saved images.
- p_l 2mo agoBehold! https://www.lambda-symbolics.com/autolith https://www.lambda-symbolics.com/autolith Not mine, but interesting.
- GeorgeTirebiter 2mo agoI bet you do, or you will. In my case, I had been getting movie recommendations from friends and also randomly. I'd look up the flick on IMDB, metacritic, and rotten tomatoes and I'd guess whether I would like it. I wanted something more 'algorithmic' - and more accurate. So me and Claude build an sbcl-based Film Recommendation system. Type in a new film name, it goes to open film database OMDB, grabs the scores, and then, using films I have already rated and with a built-in tiny Neural Net, gives me a personal recommendation. It uses the OMDB data and an algo that weights those with my personal values (in half a dozen areas: overall, acting, cinematography, etc), along with a 'comments' box to note for friends / others. The code is very well-done CL, heavily commented. The film & ratings database is stored as S-exprs, naturally, all in one file. I don't use a database as I only have a few hundred films, but maybe later I will. And that's the point -- this is a living chunk of code that I from time to time bolt in new features, or try new things (e.g. the UI is localhost:8080) I fretted about having a 'real' project to really dig into CL for a long time, and finally, found a meaty-enough project that ends up being really useful & quite a learning (continuing learning) experience. I start it up inside emacs/sly like this: (ql:quickload '(:hunchentoot :dexador :yason)) (load "s:/filmrec.lisp") (filmrec:start) I have to set the omdb key: (setf filmrec:*omdb-api-key* "fxxxx70") Then, every so often, I retrain the NN: (filmrec:retrain) Good Luck, you'll find a project. And with an LLM buddy, you'll succeed.
- nesarkvechnep 2mo agoBut then again, why would I use CL for this when I can use Elixir? I’m not the original commenter but I too can’t find a use case for CL.
- mfru 2mo agoWell, why use Elixir if I can use Clojure/Python/Ruby/Go?
- nesarkvechnep 2mo agoIn my case, Elixir is the best language, plus the BEAM, for everything that consumes from the network or listens on a socket. It's just too easy.