freenode/#lisp - IRC Chatlog
Search
9:47:01
McParen
hello, does somebody have experience with cffi-groveler? i am considering including the groveler to substitute a hard-coded set of constants in my ncurses library, and I cannot assess how risky it is to have a groveling step when the library is built.
9:50:57
heisig
McParen: I use the groveler for cl-mpi (https://github.com/marcoheisig/cl-mpi), if you need some inspiration.
9:54:04
McParen
the cl-test-grid often reports problems (or so i udnerstand it) with the groveler: https://common-lisp.net/project/cl-test-grid/library/cl-mpi.html
9:55:39
heisig
Oh, but that is because cl-mpi requires a particular C compiler (mpicc). If are happy with the default, or with something widely used like gcc, there shouldn't be any problems.
9:57:45
McParen
it is not only cl-mpi, other projects i checked also show problems on cl-test-grid: https://common-lisp.net/project/cl-test-grid/library/cl-charms.html
10:00:50
heisig
Is there a reason why cl-test-grid only tests sbcl-1.3.2 on arm, or does it only show test failures?
10:01:34
McParen
this varies from month to month, i think that depends on who contributes the test cases.
10:02:55
McParen
I only need a few integer constants, so I dont know whether it is less problematic to simply hardcode them or to add a dependence to a C compiler, include files, etc.
10:03:56
heisig
No, don't hardcode constants. C is not dynamically typed, so you can get some very bizarre bugs that way.
10:05:05
heisig
Asking the C compiler is the right way. Or, you could rewrite all the C dependencies in Lisp :)
10:07:32
McParen
I do not know how often the integers behind the defines are changed or whether they are equal between different systems
10:07:52
heisig
Fun fact: A C constant is not even a Lisp constant, because the Lisp process might live longer than the version of the C library in use.
10:08:21
heisig
This can actually happen if you reload dynamic libraries after resuming from save-lisp-and-die.
10:11:59
aeth
heisig: I assume that C type sizes won't change, although of course, that's only an assumption
10:13:40
McParen
Shinmera: does any of your systems have cffi-grovel as a dependence? if yes, did it cause problems for users?
10:14:11
Shinmera
I hard-code constants per platform and have not had issues because of that so far.
10:14:56
aeth
edgar-rft: I assume that the language I'm using is constant, which works for CL so far
10:14:56
Shinmera
Well, not just the C compiler dependency, but also the dependency on the library being installed (with header files to boot)
10:15:07
aeth
oone of these days someone's going to remove the deprecated functions like remove-if-not, though
10:18:13
heisig
Shinmera: I think you can re-grovel, if you really care about the life of your Lisp image. But nowadays, I just try to avoid C dependencies.
10:20:10
heisig
Only if your goal is to deploy long-lasting images. If you just want to obtain an executable, feel free to forget about this issue.
10:21:20
heisig
You can only have one active MPI implementation at a time. But for testing, it is nice if you can change the implementation while your REPL stays alive.
10:22:00
aeth
heisig: they could remove remove-if-not via (remove-if-not (complement #'deprecatedp) functions)
10:24:38
heisig
Nah. Should there ever be people with enough influence to release a new CL standard, they will also have enough wisdom not to change the CL package.