Search
Sunday, 25th of February 2018, 14:09:04 UTC
14:52:12
asarch
I found this: https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule
15:04:44
phoe
asarch: this is a valid finding
15:11:40
fe[nl]ix
nydel: did the script work ?
15:56:44
jmercouris
I saw that post on reddit about Lush, and it had me thinking, are there any usable shells written in lisp?
15:57:25
random-nick
there's eshell, but that's emacs lisp
15:57:54
jmercouris
I meant something not tied to emacs though
15:58:34
Shinmera
I recall hearing of multiple such projects, but they never really took off because Lisp is a bit verbose for scripting.
15:58:54
Shinmera
Can't recall names, though.
15:59:19
beach
I recall at least one written in Scheme.
15:59:26
beach
scsh or something like that.
16:00:28
jmercouris
Shinmera: Can you expand what you mean by it being verbose?
16:00:50
Shinmera
Uh, it takes a lot of characters to do a thing.
16:01:12
jmercouris
Huh? I'm still not following you
16:01:17
jmercouris
Lisp doesn't seem very verbose
16:01:37
random-nick
it's a lot more verbose than bash
16:02:06
jmercouris
I guess it's all relative, I was never good at shell scripting, so I've not had this "succinct" experience
16:02:08
beach
(with-unix-commands-linked-together-with-pipes "ls" "more")
16:02:28
jmercouris
You could ship the shell with a set of macros that make operations like that easier
16:02:54
Shinmera
Sure. But at some point you'd just be writing bash again (or your variant of it).
16:03:34
beach
jmercouris: Oh, you want the syntax to be just like sh or bash, but you want it written in Common Lisp?
16:03:35
jmercouris
What I think would be cool though would be that your "shell scripts" could be written in lisp
16:03:46
jmercouris
but at the repl you could use the "succinct" syntax
16:03:58
jmercouris
beach: yeah, something like that, so you can still use Lisp
16:04:00
Shinmera
Well you can already. Many implementations support the shebang header.
16:04:14
Xach
jmercouris: rob warnock wrote about his "OPFR" syntax on comp.lang.lisp from time to time. it was interesting to me.
16:04:32
Xach
https://www.xach.com/rpw3/articles/search?q=opfr
16:04:54
jmercouris
#!/bin/sbcl and it'll work?
16:05:02
phoe
jmercouris: SBCL works like this, I think
16:05:04
jmercouris
or whatever the path to your implementation is
16:05:23
jmercouris
how is this achieved?
16:06:00
Shinmera
You can put #!/whatever/dude at the top of a file and the shell will call that executable with the file.
16:06:19
jmercouris
Ah, so it is not up to the implementation to support that
16:06:27
jmercouris
but the implementation must be able to be piped to?
16:06:30
Shinmera
Well the implementation needs to know not to choke on the shebang
16:06:54
phoe
Shinmera: a funny corner case
16:06:56
jmercouris
ok so it will literally invoke /bin/sbcl path/to/file/invoked
16:07:02
phoe
what if I implement a #! reader macro?
16:07:28
Shinmera
I'm quite sure the shebang will be processed before your file reaches the reader.
16:08:06
jmercouris
Xach: interesting, thanks for sharing
16:48:38
dim
https://gist.github.com/posener/73ffd326d88483df6b1cb66e8ed1e0bd is about Writing Scripts with Go and contains some info about the #! Linux tricks that we might be able to re-use for CL
16:50:30
dim
that's not the document I thought this was
16:50:37
dim
google-fu is failing me today it seems
16:51:22
dim
https://blog.cloudflare.com/using-go-as-a-scripting-language-in-linux/
16:52:51
dim
they play with binfmt_misc to have /usr/local/bin/gorun take care of #! scripts that are *.go
16:53:08
dim
I guess we could do something for *.lisp in the same vein
16:53:23
Xach
rob warnock has a nice trampoline for lisp stuff for shells
16:53:30
dim
isn't roswell already doing that btw?
16:55:28
Xach
https://www.xach.com/rpw3/articles/ne2cnUA7sqeQe7ndXTWc-w@speakeasy.net.html
17:03:12
dim
why not just create a binary?
17:15:02
Xach
dim: It's not to illustrate an ideal situation, but a tool in the toolbox that may come in handy
17:15:52
Xach
It's pretty lightweight and doesn't rely on your lisp supporting shebang or anything.
17:16:38
Xach
I had a variation that took advantage of # starting a shell comment and #| starting a multi-line CL comment...something like (short paste a-coming)
17:17:05
Xach
exec sbcl --load <compute path to this file>
17:17:27
Xach
lisp didn't see the shell part, and vice versa
17:47:15
shka_
i have lparallel question
17:47:46
shka_
is it possible to deadlock lparallel by calling pmap inside pmap?
17:48:10
shka_
you don't know, don't you?
17:48:18
phoe
I can imagine how it is possible to deadlock them
17:48:29
phoe
so your workers will be blocked, waiting for PMAP to complete
17:48:37
phoe
but PMAP will never complete because all workers are blocked
17:48:49
shka_
yes, that' why i am asking
17:49:34
shka_
but on the other hand, since pmap blocks thread, it can designate it's home thread for computation
17:49:57
shka_
this way, it will never deadlock, unless you explicitly put it in future
17:51:11
shka_
i guess i check the source code
17:51:14
phoe
from what I understand, PMAP should never be put in code that the workers are executing.
17:51:28
phoe
or calls to any other PFOO, for the matter.
17:54:20
shka_
phoe: you are not mistaken, but it is not in docs
17:55:00
phoe
shka_: you can theoretically put calls to parallel functions in there, as long as you redefine *KERNEL* to something else
17:55:12
phoe
which kind of misses the point
17:55:20
shka_
that's kinda defeats the point
17:56:02
phoe
it's like creating a thread that waits for itself to join
17:56:11
shka_
well, in future we trust!
17:59:44
shka_
having said that, i can't do this for everything
19:53:09
krwq
what's the most generic specialization for strings in defgeneric? I've tried using just `string` but it seems that when element is #<(SIMPLE-ARRAY CHARACTER (3)) {10099D919F}> this doesn't worl
19:58:50
phoe
krwq: (stringp (make-array 10 :element-type 'character)) ;=> T
19:58:55
phoe
I have no idea what's going on
19:59:25
krwq
phoe: I'll try restarting lisp - I think something weird happened
19:59:34
krwq
maybe some symbol got interned in the wrong package
20:04:58
krwq
I legitimately don't know wtf
20:05:06
krwq
it's not about string though
20:06:10
krwq
I'm seeing method specialization with the exact types compiler claims it cannot find
20:07:10
krwq
is there a way to force errors when generic functions are created implicitly when defmethod is used?
20:08:18
Bike
not in any way that's not overcomplicated, i don't think.
20:08:54
krwq
omg i know, I got (foo) instead of foo and couldn't see the brackets on the error
20:08:58
fourier
fe[nl]ix: I've fixed that you've requested in osicat pull requests(there are 2 from me), but there is something strange on travis - sbcl unable to install.. I guess
20:30:52
comborico1611
I've got some newb questions in the other channel, if anyone is up for it.
20:49:31
phoe
comborico1611: sure, I'm there.
1:28:20
borei
i have several methods on top of generic function
1:28:33
borei
how to disassemble particular method ?
1:28:59
Bike
I guess (disassemble (mop:method-function (find-method ...)))
1:29:05
Bike
but i'd probably just throw the method body in a lambda and disassemble that.
Monday, 26th of February 2018, 2:09:04 UTC