freenode/lisp - IRC Chatlog
Search
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.
12:13:22
frodef
phoe: It's why I ask :) Just looking for basic "verify this form returns these values"
12:15:36
phoe
which is a good idea in theory but the fact it has a core written in C makes me wonder if I should ever recommend it for anything more than auto-installing new SBCL versions by means of `ros install sbcl`
12:16:27
phoe
quicklisp autodownloads ASDF systems; roswell manages and autodownloads CL implementations.
12:22:47
jackdaniel
I was curious who put rove on recommended list for unit tests, but apparently "recent changes" on cliki is limited to only few months
12:24:25
jackdaniel
I did not said I have a problem with rove, I've said.. well, you have it written above
13:22:02
beach
It works well with all kinds of testing paradigms, including my favorite one, namely randomly generated operations and comparison to a simple but inefficient implementation.
14:31:20
XenophonF
it's choking on a my package's reference to cl-json, which in Lisp has a package name of "json", not "cl-json"
14:32:42
XenophonF
most of the problems I've encountered up to this point are due to my ignorance, not bugs, so I thought I'd start there ;)
14:47:20
beach
ebrasca: But it is obviously not guaranteed to work. If it were, you could use the personal edition of LispWorks, and figure out all the source code.
14:48:09
jackdaniel
for some reason always when I try to check out the sbcl function I log into Xof's computer :-)
14:57:56
seok
I am trying to move my webserver to cloud, and trying to figure out best way to deploy
14:59:12
jackdaniel
if you have a clean build process then you may want to build it on the host machine
15:00:15
jackdaniel
(putting aside architecture differences, libraries you depend on may be in different locations, so image may get confused, signals may be different so you'd need to do a cold-reinit etc)
15:01:48
jackdaniel
n.b I know as a fact that on AWS instances mutexes were not fair under SBCL, I think that it could be an emulation problem, but we've never got down the rabbit hole to find what's the real problem)
15:02:59
jackdaniel
speaking of a "cloud" - that's just a wet fog which does not belong to you, if you ask me ;)
15:29:43
pfdietz
Trying to add an argument to the constructor that says "default to the slots in this object"
15:37:53
pfdietz
(make-instance 'foo :original obj-to-be-copied :bar 17) ==> copes obj-to-be-copied, but sets the bar slot to 17 instead.
15:39:38
pfdietz
Boa lambda lists let you add extra keyword arguments, and use them in default values for others.
15:44:49
pfdietz
(defstruct (foo (:constructor make-foo (&key (original nil original-p) (bar (if original-p (foo-bar original) nil)))) bar)
15:47:07
ebrasca
It gives me error (:ERROR "Error: The value \"#<CLOSURE (:MACRO SETF) {1000C4388B}>\" is not of type SYMBOL")
15:51:16
ebrasca
with this I get : (:ERROR "Error: The value \"#<FUNCTION (MACRO-FUNCTION SETF) {223DCFCB}>\" is not of type SYMBOL")
16:30:44
ebrasca
This "(swank:find-definition-for-thing (symbol-function 'command-inspect))" does what i need.
16:30:50
Shinmera
but then I don't know what you're doing either. Did you actually try to resolve the definition's source location with definitions:source-location ?
18:43:48
jmercouris
trying to figure out how to do it best, I was thinking Closure may be a good starting point
18:44:04
jmercouris
yeah, that's the problem, the rendering part is a webkit port, or webengine port depending on your choice
18:45:12
jmercouris
jackdaniel: or were you saying that closure uses webkit to calculate position of things etc?
18:45:43
jackdaniel
Xach: froggey created https://github.com/froggey/Iota , so I wouldn't be surprised if he did that ,)
18:46:49
jackdaniel
jmercouris: no, I've just said that "porting" your project to "pure" CL is not possible
18:48:11
jackdaniel
to me "web engine" is what constitues the majority of work (ux is important of course, I'm talking about time requirements though)
18:50:11
jackdaniel
in other words you say: "we have 0.01%, all we should do is to port another 99.99%", htat's what I mean that you'd have to write the browser from scratch
18:51:32
jackdaniel
(again, I'm not saying that UX is not important, for some it might be even the most important thing)