4 ms·
I am a mono-linguist: Common Lisp for everything, from the hand-optimized webserver (hunchentoot), to the parser scripts that feed the database, to the data-ent
by mahmud 18y ago
I am a mono-linguist: Common Lisp for everything, from the hand-optimized webserver (hunchentoot), to the parser scripts that feed the database, to the data-entry software that lets my affiliates/contractors feed the database, and the daemon that runs routinely analyzing the database tables and building in-memory caches of frequently used objects and doing scheduling for the queue, and the other daemon that does backup and reporting. Even the twilio voice menu for the phone is generated by a CL-WHO app :-P
Sometimes I go for so long not touching anything but Lisp, I end up writing weird stuff like "defstruct foo { int bar, char name};" whenever I need to wrap a C library to call out to :-P
[If any Lispers are reading this: I have this weird problem where I have a slime session running on screen for weeks, during which I write something in a temporary file, or inside another file, evaluate and edit it until it works .. but I forget it there! over time, the running application has little resemblance to the textual representations I have spread over several files, and it gets worse when I delete entire useless regions and refactor them. At least other languages have the decency to bondage-and-discipline me into naming my files and organizing the project hierarchy :-]
- Zak 18y agoOne thing that could help is to put everything like that in one place - say, a file called scratch.lisp in the root of the source tree. While it's not an ideal place to store any code long-term, it lets you know what still needs to be filed.
- mahmud 18y agoI have a misc.lisp file that I religiously copy stuff to. But usually, things go to misc first but later migrate to component level "package-misc" type locations, usually at the top of the component's file (I add stuff to the bottom and prefer to have a screenful of my working code, with less relevant code a PgUp or two away -- so stuff at the top is defpackage, in-package, defvars, conditional compilation stuff then the misc tools.)
- kriyative 18y agoThis may seem really "out there", but I keep all the code of a package in one file. Not only does this reduce or eliminate asdf/defsystem maintenance, which I loathe doing, it also helps avoid the kind of habit you described. After all, the edits are all in one place. To borrow a quote from the movie Highlander - "There can be only one (file)!"
- mahmud 18y agothe first thing I do with any new project is create a directory for it, the package.lisp file and the .asd. That much I do (though I should automate it, like weblocks does with defproject, hmmm) but after that it's one file, until it gets too bloated and redundant, then i break it to two small redundant pieces. Thought sometimes its too tempting to do everything in the repl: cramming a fat piece of code into one form and save the result as (setf foo *) if I like what I see :-D usually for experimentation with a new library I'm using for the first time.