5 ms·
What's a good Lisp dialect to write small programs in? I have some Emacs Lisp experience but I wouldn't use it to automate small tasks. For that, I typically us
by hesk 5y ago
What's a good Lisp dialect to write small programs in? I have some Emacs Lisp experience but I wouldn't use it to automate small tasks. For that, I typically use Python.
- deleted 5y ago[deleted]
- zonotope 5y agoI think babashka [1] is what you're looking for. It's a limited Clojure interpreter suitable for anything a bash script is suitable for. 1: https://github.com/babashka/babashka https://github.com/babashka/babashka
- spicybright 5y agoI'd say the "python of lisp" is definitely racket. Beginner friendly, lots of batteries included, large community with lots of libraries. Here's an example of a simple webserver using the standard library: https://docs.racket-lang.org/web-server/run.html#%28part._servlet-env%29 https://docs.racket-lang.org/web-server/run.html#%28part._se... I'm also a fan of the first tutorial on the site. Instead of the boring stuff like hello world, 2+2, print your name etc, they use a built in library for drawing shapes to the console, and learn how to build up procedures for drawing more complex objects. It feels like learning to code with logo (which they also have a clone built in of https://docs.racket-lang.org/logo/index.html https://docs.racket-lang.org/logo/index.html) All the good stuff said, I've never used it for system plumbing scripts like I do with python. I'd imagine it's worse for that due to the sheer popularity python has. https://racket-lang.org/ https://racket-lang.org/
- hesk 5y agoThe homepage looks really interesting. I'll give it a try. Thanks!
- sometimesweenie 5y agoClojure through Babashka[0]. It's great for small tasks not related to your favorite editor. I use it for most of my scripting except for the really easy things in bash. [0] https://babashka.org/ https://babashka.org/
- CraigJPerry 5y agoI’ve been having decent luck with babashka and more recently with nbb which is from the same developer but an npm install to start using it. They both work really well for little scripts and tools where i found clojure startup time annoying.
- omaranto 5y agoWhy wouldn't you use Emacs Lisp to automate small tasks? I think it's great for that purpose, it's usually pretty easy to give a utility a very comfortable user interface in Emacs.
- hesk 5y agoI happy with command line interface. That's just my workflow.
- Siira 5y agoDefinitely Common Lisp. Instant startup time (load all your dependencies and then dump a new SBCL compiler with ‘save-lisp-and-die’), great emacs support, a mature ecosystem, and fast. Clojure is great if you don’t care about the startup time, as it has good emacs support, and you can fall back on the JVM ecosystem. It’s the most concise of all the lisps I have tried, but also a tad opinionated.
- S4M 5y agoI haven't tried it, but there is Janet (https://janet-lang.org/ https://janet-lang.org/) that seems pretty well suited for building small scripts. It was submitted a few times recently here on HN.
- hajile 5y agoChicken Scheme is probably a nice middle-of-the-road scheme to try. It's "eggs" offer a lot of the functionality you'd want, the FFI for calling C is decent, and the documentation isn't bad.
- masak 5y agoIf I may be so bold as to recommend my in-progress Bel implementation: https://github.com/masak/bel https://github.com/masak/bel Caveat: I'm still working towards being able to recommend Bel _unconditionally_, not just for small programs. Right now you'll experience unreasonable slowness, terse/uninformative error messages, and missing documentation -- probably in that order. All of those are being addressed. But already today, it's fun to play with.
- metroholografix 5y agoEmacs Lisp is better than fine. You get a powerful Lisp (with a lot of goodies from CL) that is both portable and ultra-stable whilst having a self-contained VM and an enormous library of code available (Emacs) on every system imaginable. Here is an example of scripting a small task: https://gist.github.com/atomontage/64b767731b5896f1c6113adb9fd0a231 https://gist.github.com/atomontage/64b767731b5896f1c6113adb9...
- gilch 5y agoIf you're already familiar with Python libraries, check out Hissp (https://github.com/gilch/hissp https://github.com/gilch/hissp), which compiles to Python expressions.