News for hackers. Stuff that matters.
Re:Why Lisp? (2015) by hesk on Tuesday October 26, 2021 @07:08PM (#29007537)
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.
Re:Why Lisp? (2015) by spicybright on Tuesday October 26, 2021 @07:52PM (#29007960)
I'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._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)

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/

Re:Why Lisp? (2015) by hesk on Wednesday October 27, 2021 @06:55AM (#29011543)
The homepage looks really interesting. I'll give it a try. Thanks!
Re:Why Lisp? (2015) by Siira on Tuesday October 26, 2021 @08:28PM (#29008216)
Definitely 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.

Re:Why Lisp? (2015) by zonotope on Tuesday October 26, 2021 @08:04PM (#29008033)
I 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

Re:Why Lisp? (2015) by masak on Tuesday October 26, 2021 @11:39PM (#29009290)
If I may be so bold as to recommend my in-progress Bel implementation: 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.

Re:Why Lisp? (2015) by metroholografix on Wednesday October 27, 2021 @03:45AM (#29010574)
Emacs 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/64b767731b5896f1c6113adb9...

Re:Why Lisp? (2015) by sometimesweenie on Tuesday October 26, 2021 @08:10PM (#29008074)
Clojure 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/

Re:Why Lisp? (2015) by S4M on Tuesday October 26, 2021 @09:16PM (#29008530)
I haven't tried it, but there is Janet (https://janet-lang.org/) that seems pretty well suited for building small scripts. It was submitted a few times recently here on HN.
Re:Why Lisp? (2015) by omaranto on Tuesday October 26, 2021 @08:24PM (#29008193)
Why 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.
Re:Why Lisp? (2015) by hesk on Wednesday October 27, 2021 @06:51AM (#29011525)
I happy with command line interface. That's just my workflow.
Re:Why Lisp? (2015) by gilch on Wednesday October 27, 2021 @07:51PM (#29020604)
If you're already familiar with Python libraries, check out Hissp (https://github.com/gilch/hissp), which compiles to Python expressions.
Re:Why Lisp? (2015) by CraigJPerry on Tuesday October 26, 2021 @08:11PM (#29008079)
I’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.

Re:Why Lisp? (2015) by hajile on Tuesday October 26, 2021 @11:12PM (#29009170)
Chicken 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.