freenode/#lisp - IRC Chatlog
Search
18:26:54
p_l
It was more the accent and manner of being that suggested to me an English chat, even if rather retirement age
21:59:27
verisimilitude
I'm currently adding system buffering and echoing control to my ACUTE-TERMINAL-CONTROL, even though I despise the idea.
22:00:51
verisimilitude
I'm currently adding CCL code for this, but it can't find its queer little databases on my system and so I'm doing it blind.
22:33:46
simplegauss
in common implementations (I'm particularly interested in sbcl) is there a way to declare a lambda inline? of course this is going to be used in a macro
22:38:29
simplegauss
what i mean is a macro might produce a lambda which gets assigned or called, and i'd like this lambda to be declared inline. of course i could do something like "(flet ((f (x) (declare (inline f)) (1+ x))) f)" but i'd like to know the better solution if it exists
22:41:28
jmercouris
simplegauss: What is the question? A macro can produce any kind of code, and a lambda can be made with (lambda ())
22:47:47
White_Flame
if you put the inline declaration inside the function body itself, that's not where inlining needs to happen
0:22:19
drmeister
CFFI question - what encoding does not change a string at all? *default-foreign-encoding* :utf-8 is screwing me up.
0:58:35
White_Flame
what does "not change a string at all" mean? what format is the string currently? as it's a vector of potentially 21-bit or so codes, they need to map to bytes somehow
0:59:09
White_Flame
also, it highly depends on what the byte reader on the other side thinks the encoding is
1:00:45
simplegauss
i got disconnected earlier, so i apologize if someone already answered this, but i was wondering if a lambda function definition can be declared inline in any implementation (sbcl). concretely i have a macro that expands to some lambda, and i'd like that function to be inlined.
1:01:38
simplegauss
so for example does the declaration here make a difference?: (defmacro m () '(lambda (x) (declare (inline)) (1+ x)))
1:02:16
White_Flame
your declare affects code inside the lambda body, which isn't where the inlining decision you want will happen
1:02:37
White_Flame
from above: (flet ((func ...)) (declare (inline func)) ...something that uses func...)
1:02:52
simplegauss
White_Flame: oh, so something like (defun f (args) (declare (inline f)) body...) does nothing?
1:03:46
White_Flame
if you pass around lambdas dynamically, you can't inline them. You'd have to recompile to have that effect
1:06:00
simplegauss
hmm. does the hyperspec or some document go into more details on these rules? this link (http://clhs.lisp.se/Body/d_inline.htm) seems to suggest that (inline blah) before a function definition can trigger some information to be saved
1:06:29
simplegauss
also, i guess there is no way to insist that all uses of a function are attempted to be inlined?
1:07:13
simplegauss
nvm, i guess that's what declaim is for. for some reason I thought i've seen people write (defun f (args) (declare (inline f)) body)
1:08:33
White_Flame
right, the declaim is outside the defun, meaning the outer scope uses that declaration
1:11:58
simplegauss
White_Flame: thanks! are there some good optimization notes that deal with these questions, even if only specific to sbcl?
1:14:01
White_Flame
I believe implementations are free to ignore inline declarations, so your speed/safety/etc settings have to be enough to allow it, too
1:32:07
simplegauss
White_Flame: thanks! I decided to do that to try and learn something about sbcl, and now i've seen something that looks very much like an optimization bug
1:32:55
simplegauss
then compile (lambda (x) (funcall (mfoo) x)), the function given by mfoo does not inline
1:33:33
simplegauss
but if i compile (lambda (x) (funcall (lambda (z) (1+ (1- z))) x)), the lambda gets inlined
1:34:02
simplegauss
i'm surprised this kind of behavior is even possible; don't macros have to be expanded before compilation?
1:37:49
simplegauss
to be precise i'm compiling (lambda (x) (declare (optimize (speed 3) (safety 0))) (funcall (mfoo) x)) and (lambda (x) (declare (optimize (speed 3) (safety 0))) (funcall (lambda (x) (1+ (1- x))) x))
1:56:43
pierpa
pfdietz: so, an implementation where (mapcar #'upgraded-array-element-type '((unsigned-byte 16) (signed-byte 16) (unsigned-byte 15))) ==> ((UNSIGNED-BYTE 16) (SIGNED-BYTE 16) (UNSIGNED-BYTE 16)) is in error, if I understand correctly? sigh :)
2:05:47
jlarocco
Hi, I'm writing a wrapper for libgphoto2, and I'm running into a problem with two functions that take struct arguments on the stack.
2:06:23
jlarocco
Adding cffi-libffi as a dependency fixed an error with my defcfun declarations, but now when I try to call the functions I get "There is no applicable method for the generic function" with a pointer, my struct type, and another pointer.
2:08:00
jlarocco
I'm finding conflicting information on whether passing structs on the stack even works
2:39:35
clintm
Before I buy lispworks out of sheer frustration, I thought I might ask here: Does anyone else (try to) use FreeBSD and either sbcl or ccl? Between sbcl's random "interrupted system call" errors, and ccl randomly hanging with slime, I'm THIS close to dropping them both.
2:41:22
verisimilitude
Considering that the FreeBSD developers don't even use FreeBSD, perhaps you should drop it instead, if you can.
2:45:01
verisimilitude
There's also ABCL, if you don't mind running the JVM, which probably works well under FreeBSD.
2:45:24
verisimilitude
Considering how much a Lispworks license costs, it's worth your time to test these first.
2:48:19
clintm
Hrm... I think I'll bring up an openbsd instance and see how well things work there. I feel a bit embarrassed that I didn't suspect FreeBSD itself more, and only blamed the lisps.
3:00:05
simplegauss
I asked on the sbcl channel, but i am getting some strange disassembly and i don't understand how it's even possible for this optimization bug to happen: https://pastebin.com/SjBV06L2 . the top function compiles a separate lambda and calls into it, but the bottom two completely elide the lambda and have no extra function calls in their body.
3:04:46
simplegauss
and why would assigning to a name in the flet help if it's still wrapped in a funcall?
3:08:14
pierpa
what happens if you change that macro to (defmacro mfoo () #'(lambda (z) (1+ z))) ? (or equivalently to (defmacro mfoo () (lambda (z) (1+ z))) )
3:21:48
pierpa
pfdietz: so, ccl, lw, and acl got it wrong. only sbcl is right of the ones I have checked
3:25:07
pfdietz
Complex type upgrading in the spec is broken, though. They didn't get it right before the spec writing process ended.