freenode/#lisp - IRC Chatlog
Search
21:03:31
aeth
There are several weaknesses, such as being really old (and thus favoring things like conciseness too much, like old languages usually do (with Lisp as an obvious exception)) and serving two fairly different roles (as I said before, attack one or the other, not both)
21:03:54
rpg
aeth: same for perl -- if you want to write a unix-style text file filter, it's really hard to beat.
21:05:24
aeth
pre-systemd, I'd say sh is going to be around as long as Unix is, but these days? Who knows.
21:15:04
jasom
I have a partial implementation of sh in lisp, that includes the ability to substitute in arbitrary lisp expressions
21:23:56
pookleblinky
Fish's attitude toward posix basically turned their scripting into an uncanny valley.
21:24:36
pookleblinky
If it'd stayed as compliant as zsh, it'd be a great shell. If it'd gone wild and chosen a modern scheme shell, it'd be amazing.
21:26:52
pookleblinky
Imagine a modern scsh, buit on chicken (scsh-process, etc) with modern autocompletion and paredit/etc so it can be used interactively.
21:32:13
aeth
I really think iteractive use vs. scripting use are too opposite to really work well (and they're probably a source of many of sh's flaws in the first place)
21:46:02
sukaeto
I like to take the view that the UNIX shell is a programmable interface to your computer, and sh (the language) is how you build new commands out of already existing ones
21:46:22
sukaeto
maybe you build a new command interactively and then make a function of it when you determine it's something you're going to do all the time
0:53:08
deba5e12
sukaeto: i was just saying the same thing today. it's a good way of explaining what a shell is (as a repl & a scripting lang).
2:48:43
axion
What does anyone think about naming reader/writer/accessors the same as slot names? I remember hearing good arguments in both directions here before, but I forgot.
3:11:57
beach
axion: I give them separate names so that client code would not be tempted to use SLOT-VALUE, etc.
3:13:55
beach
The counter-argument (Xach, for instance) is that SLOT-VALUE itself should set off as many alarms as `::%'.
3:17:58
axion
Well one typically does not prefix slot names, only accessors. The generic function approach of accessors amoung different objects is nice.
3:19:16
axion
(width instance-of-class-1) / (width instance-of-class-2) vs (class-1-width ..) / (class-2-width ..)
3:21:00
beach
That is why I use (defclass sheet (...) ((%parent :accessor parent))) so that I can write (parent pane) and (parent sheet).
3:21:27
axion
Thinking about it, it almost always makes sense to prefix all slot names with '%'. I disagree with SLOT-VALUE, WITH-SLOTS and the like in most cases.
3:22:46
beach
You disagree with what aspects of SLOT-VALUE etc? Using them? With me about not using them?
3:23:57
beach
I don't even use them internally anymore. I much prefer to establish an internal protocol so that I can extend my own software in a modular way.
3:24:34
axion
In some rare cases I use WITH-SLOTS when I'm accessing some long accessor name[s] multiple times in a verbose function
3:26:37
axion
In some even more rare cases i use WITH-SLOTS when I define only a reader method and I want to assign a slot after object creation, when I'm not using initialize-instance
3:30:55
axion
I have not visited any CLOS code in about a year until today, and looking at old code of mine made me question it a little bit.
3:31:12
beach
Sure. Discussions like this are always very helpful. I am convinced we (as suppliers of free Common Lisp software) must pay more attention to modularity etc., so as to decrease the total burden of maintenance.
5:24:09
jasom
something like: (defun mmap (name &rest lists) (map (lambda (&rest args) (apply #'send name args)))
5:24:50
jasom
something like: (defun mmap (name &rest lists) (apply #'map (lambda (&rest args) (apply #'send name args) lists))
5:26:38
jasom
the one advantage send has is that name collisions are not a problem with it; short names for generic functions can collide preventing you from importing two methods
5:29:26
pillton
i.e. One set of methods for a generic function perform a task that is different to what is done by others.
5:32:52
jasom
I was thinking of semantically differing overloads in less capable object systems (most famously C++'s (ash stream "foo") for output)
5:34:29
jasom
like much of C++ I waver between admiring it's cleverness and running away in horror at it's ugliness
5:36:08
beach
jasom: You would have to give up lots of Common Lisp standard functions, or make them harder to use. Consider the :TEST and :KEY of the sequence functions. You now have to wrap them in (lambda (object) (send 'key object)) etc.
5:36:54
beach
jasom: Again, I think part of the reason for CLOS generic functions was to maintain the usefulness of existing Lisp functions like the sequence functions, the mapping functions, reduce, etc.
5:37:14
jasom
I was wondering about the motivation for CLOS as the object systems that predate it were mostly of the SEND variety
5:37:56
pillton
Where they the send variety where the processing of the "invocation" was done asynchronously?
5:45:37
pillton
I guess it boils down to subjective concepts like granularity, modularity, reusability and some others I've forgotten.
6:07:53
flip214
> there is cl-cont which works by CPS transformation, so if performance is your concern it's not ideal.
6:41:47
flip214
well, I would have guessed that compilers are smart enough to translate "CALL function; RET" into "JUMP function" anyway, and then there shouldn't be any differences
6:47:35
Bike
i mean, say you have (+ (+ a b) c). you'd rewrite that as like (cps+ a b (lambda (v) (cps+ v c k))). the compiler is maybe not smart enough to figure that v is always a number so it might put in an extra check that's obviously unneeded.
6:51:55
flip214
IIRC only calls to function that got explicitly _marked_ as "may sleep" resp. "may switch tasks away" would get transformed?!