freenode/lisp - IRC Chatlog
Search
22:13:22
splittist
OK. After a few hours work I'm back where I started, with something that almost works, but now with a myriad layers of indirection. Time to declare victory and leave it for the evening. :P
22:18:23
splittist
the indirection/protocol thing actually works fine, now. It's just that I started the day with a slightly-broken thing and I'm ending it with exactly the same brokenness. But there is a slightly sleeker yak, so that's something.
22:26:14
splittist
It started yesterday as a bit of a distraction from something else docx-related. (Which itself is ...) Basically, it 's squirrels all the way down.
22:27:22
phoe
depends on your CPU architecture I guess, same question as "which direction does the stack grow"
23:12:36
no-defun-allowed
(defun lousy-or (value &rest values) (let ((next (apply #'lousy-or values))) (if (null value) next value))) ; but this has non-tail recursion and is slightly cursed
23:14:23
White_Flame
some of the cyc code very, very manually performs a non-shortcutting OR on 2 cleanup items for a "success" return, and I'm wondering if there's some little trick
23:15:45
Xach
White_Flame: so it evaluates everything (unlike OR) and still gives the semantics of only being true if something is true.
23:16:07
White_Flame
ah true, I didn't explore SOME because of that, although I know it's been used for such things
23:32:10
gabc
Is there any external requirement to use Qtools? Or this should be enough? (ql:quickload '(qtools qtcore qtgui))
3:54:11
reepca
I find myself needing to use native namestrings for passing arguments to another program, and it seems that calling (namestring (make-pathname :name "a.b.c")) produces "a\\.b\\.c". I'm quite confused why this is. Does SBCL think that "canonical form" means "shell-special-characters escaped"?
3:59:54
reepca
seems native-namestring is what I want... I vaguely remember running into this problem before
4:23:22
pjb
reepca: if you pass the argument to another program that is NOT written in SBCL, then you want to pass NOT a PATHNAME or a NAMESTRING, but a POSIX path!
4:26:52
White_Flame
reepca: the period is often used to separate name from type (extension), so that's probably the root of the backslashing
4:58:15
emaczen
What can I expect with regards to this $365 bounty: https://www.bountysource.com/issues/75202399-wanted-by-value-structures-in-sb-alien
4:58:15
minion
emaczen, memo from pjb: lisp itself is just an assembler. Just avoid the most sophisticated macros (or consider lisp as a macro assembler and use them!). See for example: https://groups.google.com/forum/#!msg/comp.lang.lisp/T3UZwLoN0lw/4r9q_8cwKoQJ THIS IS YOUR STABLE ASSEMBLER!
7:35:11
Nilby
Some very rare person already familiar with it might be able to do it in a few days, but I spent more than that just educating myself and doing background research.
7:37:43
_death
cffi can do that with libffi, though I had to patch things a bit to make things work for my use case
7:39:18
Nilby
Yes, but it isn't an ideal solution. It is hard to compile and find for some platforms, and then it dynamically creates a function call, which could "easily" just be compiled in.
7:46:16
Nilby
It's extra maddening because passing C structs by value is usually stupid anyway, and C struct layout can have a lot of edge cases.
7:48:08
emaczen
Nilby: Will you look at this and give me a few suggestions? I am stumped: https://plaster.tymoon.eu/view/1646#1648
7:51:53
emaczen
Nilby: Thanks, I think the biggest not is that test4 is the same as test3 (test3 works!) except test4 is using a C struct, which should rule out my other code from being problematic
7:52:35
emaczen
Nilby: Which to me would mean the most likely error is in the definition of the C struct for libffi
7:59:20
emaczen
Yeah, the error I get is an Unhandled memory fault at #x0 to during the ffi:ffi-call
8:03:18
Nilby
My recommendation would be to start with an easier struct. Like something with only a couple members. If there's one little thing out of place, you'll have trouble.
8:06:15
Nilby
For the x86_64 abi sometimes struct member values that can fit in 64 bit words are just put in registers, but sometimes it points to the stack, so for anything complex it usually involves doing some stack allocating.
8:09:16
Nilby
But one approach might be to get CCL to successfully make the call, and observe it very carefully. Or you could carefully observe objective C in the debugger.
8:10:35
emaczen
Or what exactly makes this struct not simple? I would think of it as just a 16 byte block -- pretty simple
8:18:44
galdor
emaczen: at less than 4 digits, I fail to see anyone investing real time and energy on it, given the fact that if it was trivial, it would already be done
8:19:32
galdor
and since some CL implementations need patching (+ cffi to use it instead of libffi, good luck to have cffi updated), you're looking at significant work
8:29:23
Nilby
I found my notes on it but it's for windows and ccl, and filled with expletives, so I don't think it will help.
8:30:52
emaczen
hah, I think I'm going to have to try using CCL with its ability to handle C structs...
8:31:20
Nilby
Here's I think a comment from CCL that I found educational https://plaster.tymoon.eu/view/1653#1653
8:35:08
Shinmera
The technical reason is that structs by value is a fucking mess in C and it's a pain to implement.
8:37:20
galdor
people usually work on what interests them, or on things they need for they personal projects
8:38:57
galdor
so if something is not developed, it's usually because no one needed it badly enough or it's such a PITA no one want to put their arm in the meat grinder
8:39:00
emaczen
galdor: Of course, I just saw that the bounty was originally filed as a bug/issue 10 years ago, then 7 months ago people put up $70 and now it is at $365 -- The specifics that you gave of 4 digits is what I really wanted to know
8:39:42
Shinmera
emaczen: The bounty went up because the bounty for CCL's PLNs was so successful I thought we could do it again for this problem that does affect me to some extent.
8:40:55
galdor
no one is patching something as tricky in SBCL, + CFFI support for what is barely 1 or 2 days of salary
8:41:57
galdor
of course not, but since it has not been implemented in 10 years, there is little chance of it happening because someone is bored one weekend
8:42:32
galdor
there's nothing wrong with it, it's just that generally if you want something done in the opensource world, you can either pay or do it yourself
8:43:13
jackdaniel
ACTION can testify, that many kind souls help him by fixing issues of their projects when he asks them nicely
8:44:13
Nilby
I only started working on it out of extreme conditions of trapped at my friend'ss house with a broken laptop and only a windows machine. So I was prepared to suffer.
8:47:55
emaczen
Nilby: In that note you showed me it says sizes of 8 16 ... below that 1-4 passed in regs
8:51:31
Nilby
But usually it's just the pointer is wrong, or it thinks something is a pointer that's not. Usually the error has the value which you can sometimes compare, by looking at the call it -tries- to create
8:57:22
Nilby
Nice. I usually just mash the stack till it works. There's finite combination of places to put values, then jump. You'll get some memory error until it works!
8:58:51
emaczen
Nilby: Unfortunately, I'm not too accustomed to lower level programming... There were a number of times that I messed up pointer of pointers in CFFI -- It can be tricky working through several interfaces too
9:26:04
phoe
Bad news: there are some tpln test failures on ACL. Any ACL user wants to investigate these?
9:45:00
phoe
Shinmera: it would, but I still need a little bit of help analyzing each of the test failures and producing proper bugtickets. That, or I'll need more time to properly figure all that out myself.