News for hackers. Stuff that matters.
Re:Emacs-like editors written in Common Lisp by djha-skin on Sunday October 02, 2022 @09:33AM (#33055745)
I have used Clojure on and off for probably 7 years. But when I tried to distribute my program which was a CLI tool, it proved incredibly painful. Clojure startup time is really bad over a second in the best case and it gets worse the more libraries you include. This is not a problem if you are writing a web application, but it's terrible for command line applications. The community seems thoroughly disinterested in solving this problem except with graalvm's native-image. I've done that route and believe me it's so painful.

Common Lisp has everything Clojure has. It feels like Rich Hickie took everything that he liked about Common Lisp and put it into Clojure. Many of the functions in Clojure were basically copied from Common Lisp: if-let, conj(oin), disj(oin) are some examples of core Clojure functions and macros that were totally stolen from Alexandria.

Even better, most CL implementations can save directly to an executable file. Embeddable Common Lisp is my favorite because its executable files are measured in kilobytes, something I could never do with native-image. And the startup time is amazing.

I did look at other lisp languages when deciding to move away from Clojure. However, Racket's standalone executables (raco exe) include the interpreter, and so are huge; Chez Scheme's ecosystem doesn't have a YAML library as far as I can tell, ditto for Chicken. Also scheme's library ecosystem in general (sans racket) is a bit lacking to me.

Common Lisp it is. It has its warts, but they're not too bad. It's long history also speaks of stability though. SBCL is crazy good optimized.

Re:Emacs-like editors written in Common Lisp by brabel on Sunday October 02, 2022 @03:24PM (#33059288)
For CLIs, Common Lisp is excellent.

I wrote a small program in CL and Rust, and (SB)CL can run faster than Rust EVEN FROM SOURCE! It's just completely mindblowing how fast it starts.

If you don't believe me, write a program that does something like count how many times each letter appears in a text file in CL and Rust, then run them with `time`. I can pretty much guarantee CL runs as fast or faster.

EDIT: my comment is meant for anyone curious about OP's clamis, I am obviously just agreeing with their point about CL's startup speed.

Re:Emacs-like editors written in Common Lisp by ArtixFox on Sunday October 02, 2022 @09:37PM (#33062440)
Ooooh nice!!! That is amazing but how viable is common lisp for low level programming. Instead of embedding CL, what about a DSL that creates binaries, does something like this exist?
Re:Emacs-like editors written in Common Lisp by ducktective on Monday October 03, 2022 @02:09AM (#33063990)
For embedded application (as in micro-controllers) there is http://www.ulisp.com/

SBCL still needs garbage collection. There are also https://github.com/carp-lang/Carp and https://github.com/bakpakin/Fennel

I haven't used these. Would be great if low-level and embedded engineers could chime in.

Re:Emacs-like editors written in Common Lisp by nanomonkey on Sunday October 02, 2022 @12:33PM (#33057500)
Clojure now has Babashka and better integration with GraalVM if you are interested in creating CLI tools. Worth checking out.
Re:Emacs-like editors written in Common Lisp by ducktective on Sunday October 02, 2022 @11:23AM (#33056685)
Last I checked, ECL binaries are around ~10-20 MiB (including the shared file) and the price of having these binary sizes is start-up time which is around 500-1000ms.

BTW, since you program professionally in CL, do you use Emacs? Doom or custom?

Re:Emacs-like editors written in Common Lisp by djha-skin on Sunday October 02, 2022 @01:48PM (#33058352)
To be clear, unfortunately I do not program professionaly in CL. I use vim + vim-slime (jpalardy) + GNU screen + rlwrap. dotfiles here[1], here[2] and here[3].

Blog post about this will be written subsequently at https://blog.djha.skin .

1: https://git.sr.ht/~djha-skin/dotfiles/tree/main/item/dot-con...

2: https://git.sr.ht/~djha-skin/dotfiles/tree/main/item/dot-loc...

3: https://git.sr.ht/~djha-skin/dotfiles/tree/main/item/dot-scr...

Re:Emacs-like editors written in Common Lisp by ducktective on Sunday October 02, 2022 @03:29PM (#33059327)
Very cool! Thanks for sharing the dots!

I'm a vim user too, but recently I've been considering Common Lisp mainly due to this post: https://mikelevins.github.io/posts/2020-12-18-repl-driven/

so I did a brief tour on Emacs (cause everyone uses sly) but both Emacs and CL take too much time so I've postponed them.

Would be nice if you describe your vim+cl workflow and how does it hold up to Emacs+Sly+Org-mode ™

Re:Emacs-like editors written in Common Lisp by djha-skin on Sunday October 02, 2022 @09:26PM (#33062362)
Re:Emacs-like editors written in Common Lisp by ducktective on Monday October 03, 2022 @02:33AM (#33064146)
Thanks!