Ask HN: Do you write quick and dirty hacks using Lisp?
To those who know both Lisp and Python: Which one you prefer to use to write quick and dirty hacks? Which one you prefer for writing applications that will be used and maintained over a long period of time?
I know Python, Common Lisp and Scheme but I find myself reaching out for Python every time I have to write a quick and dirty hack. This is due to more familiarity with Python which makes me more comfortable with Python. What are your experiences? Maybe it will convince me to go all in and use Lisp all the time. :-)
2 comments
[ 2.5 ms ] story [ 18.1 ms ] threadThere is a Lisp dialect for the "C-and-Unix crowd": TXR Lisp.
Similarly to traditional tools like Awk, TXR Lisp has no external dependencies and builds into a single native executable (plus a collection of satellite files that go into /usr/share). It is documented by a single giant man page ("man txr"), which also exists in the form of a hyper-linked HTML document with a collapsible, two-way navigable table of contents.
Though fine for larger applications, it scales down to throwaway scripting, including one-liners on the command line.
It includes a whole-document scraping language called the TXR Pattern Language that is good for extraction tasks. Especially for "messy" text that consists of multiple ad hoc structures slapped together.
1. Way better REPL experience with multi-line editing.
2. No "import this from that" disease. The entire language/library is simultaneously available.
3. No this.that.foo.bar() disease: The entire language/library is named by flat symbols. Posix things mostly have their normal names:
There is a package system, but everything predefined by TXR is in one package called usr, all of which is visible in the pub package in which code is read by default.3. Free structure: your code is not a "module" that has to obey someone's conventions.
4. No analog of __pycache__: no pollution of your current working directory. You compile code yourself using (compile-file "yourfile.tl") which pops out a "yourfile.tlo", or use the code interpreted.