jackdaniel changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook> | Pastebin: <https://plaster.tymoon.eu/>
mwnaylor has quit [Read error: Connection reset by peer]
mwnaylor has joined #commonlisp
mwnaylor has quit [Remote host closed the connection]
mwnaylor has joined #commonlisp
istewart has joined #commonlisp
mmk2410 has quit [Quit: ZNC - https://znc.in]
mmk2410 has joined #commonlisp
emaczen has quit [Read error: Connection reset by peer]
random-nick has quit [Ping timeout: 252 seconds]
Akbar-Birbal has joined #commonlisp
markb1 has quit [Ping timeout: 260 seconds]
markb1 has joined #commonlisp
Oddity has quit [Ping timeout: 244 seconds]
jonatack has joined #commonlisp
jonatack has quit [Ping timeout: 244 seconds]
jonatack has joined #commonlisp
<Bubblegumdrop> How do I convert a lisp array for use as a C array? is there somewhere I can read more about this? http://paste.debian.net/1328263/
<ixelp> debian Pastezone
Lord_of_Life has quit [Ping timeout: 260 seconds]
Lord_of_Life has joined #commonlisp
<kanuba> You'd have to allocate the array of rects with cffi, or build one from the fields of the rect struct of the rects in that list. CL lists and CFFI don't match very well
<kanuba> If you had a vector of the proper numerical elements, and they weren't boxed, you could pin the array, or use cffi:with-pointer-to-vector-data
mgl__ has joined #commonlisp
<aeth> bilingual Lisp vectors + C arrays are https://github.com/sionescu/static-vectors
<ixelp> GitHub - sionescu/static-vectors: Allocate SIMPLE-ARRAYs in static memory
<aeth> vectors, not lists
<aeth> even if you start out with a list or a non-static-vector adjustable vector, using REPLACE on a static-vector may be more convenient than doing it the CFFI way
<kanuba> static-vectors will allow you to allocate a foreign array with a lisp interface for manipulating it, but getting a pointer to an existing lisp data structure is different.
<kanuba> cffi:with-pointer-to-vector-data is handy for wrapping the foreign sdl api, for things like creating a surface from a simple-array of pixels
<Bubblegumdrop> I think that's what I want, thanks...
<kanuba> autowrap adds a whole new complexity though, as I see you're using cl-sdl2. it uses objects that wrap pointers, rather than pointers.
<Bubblegumdrop> I did this once before with libpng but honestly have no idea what I did to get it right...
<aeth> wrapped pointers (as in cl-sdl2/autowrap) are not a good idea
<aeth> I think they exist because cl-sdl2 used to have finalizers, which got removed because they are not a good idea?
walee_ has quit [Ping timeout: 252 seconds]
<aeth> you really want the C stuff in unwind-protect instead of random magic happening in places
<Bubblegumdrop> I'm using sdl2kit, I think it wraps the ,@body in unwind-protect
<aeth> iirc, sdl2kit is just added magic on top of cl-sdl2, of the wrong kind of magic
<kanuba> Note that you will have to ship libsdl2-compat in addition to libsdl2 soon if not wrapping sdl yourself
<kanuba> (sdl3 is finalized and will be hitting distribution package managers relatively shortly)
<kanuba> it has a fairly different API, and shaders
<kanuba> the compat will allow sdl2 apps to run on sdl3
<aeth> good opportunity for something to finally replace cl-sdl2, though
<aeth> which most people still seem to use
<Bubblegumdrop> well I'd like to be using trial but it's just too fancy for me
<kanuba> I like to keep things simple and use my own sdl2 bindings (which do not include the software rendering api functions that you are using, so it wouldn't be of much use).
<Bubblegumdrop> I really ought to spend more time looking at gilberth's ffi thingy
<Bubblegumdrop> It's probably a lot simpler
<aeth> cl-sdl2 (and to some extent autowrap) has some really bizarre design decisions, which you will encounter if you encounter bugs or incomplete parts of cl-sdl2, which you will, because its author afaik stopped using Lisp 7 or so years ago
<aeth> though cl-sdl2 does get some bug fixes
<kanuba> as the former maintainer of cl-sdl2, i concur. currently it is maintainer-less.
<aeth> it was supposed to be higher level than a mere SDL2 wrapper (unlike e.g. cl-opengl and OpenGL), which means that there's a lot of performance-affecting, buggy, incomplete, undocumented, hard-to-explore stuff added on top
<aeth> as opposed, again, to cl-opengl where you can just take C OpenGL references/tutorials and basically just translate them into CL
<aeth> for an example of hard-to-explore, there's iirc a macrolet inside of a macro, so just a completely magical (form) that just exists inside of a macro body
<kanuba> cl-sdl2 is also full of memory leaks and unimplemented (often needed) functions, some of which are not even caught by the low level bindings package, because autowrap can't parse C preprocessor macro decorations
<aeth> a macrolet inside of a macro isn't M-.able in Emacs (to find the reference) so it will lead you down a several day wild goose chase. I don't care how fancy your macros are. Implement an entire language if you must. But somehow find a way to make M-. resolve for everything.
<Bubblegumdrop> currently what I'm battling
<Bubblegumdrop> thanks for the help everyone
<kanuba> Luckily there are not very many of them, and most of them should be implemented in pure lisp anyway: https://github.com/libsdl-org/SDL/blob/b233beca47c0ab1dd00df041134726f7f2ccb6da/include/SDL3/SDL_rect.h#L155
<ixelp> SDL/include/SDL3/SDL_rect.h at b233beca47c0ab1dd00df041134726f7f2ccb6da · libsdl-org/SDL · GitHub
<kanuba> The real problem with sdl2 (or 3) is its api, particularly its automatic memory management functionality, is poorly documented (it does reference counting and automatic freeing of some things)
<kanuba> wrapping it can be tricky and double free corruption will haunt you (cl-sdl2) even does things wrong and causes leaks or corruption in cases)
<kanuba> a testament that autowrap is not a cure, even a magical one
<aeth> I wasn't aware of this. Is this the 2D API?
<kanuba> It's everywhere
<kanuba> SDL subsystem initializations are ref-counted. surfaces have an internal refcount slot, etc.
<kanuba> SDL_GetNumAllocations() is exposed to show the number of allocations it tracks
<kanuba> Which can be useful when trying to wrap things correctly, if you are insane enough to play that trial and error game across the kitchen sink
<kanuba> some things are not meant to be manually freed, like pixelformat objects, but only in certain cases when they are not constructed automatically. It's really a mess.
triffid has quit [Remote host closed the connection]
`Pixel_Outlaw has quit [Quit: Leaving]
triffid has joined #commonlisp
decweb has quit [Ping timeout: 252 seconds]
rakka has quit [Remote host closed the connection]
rakka has joined #commonlisp
istewart has quit [Quit: Konversation terminated!]
wacki has joined #commonlisp
mgl__ has quit [Ping timeout: 255 seconds]
pve has joined #commonlisp
rodrigo-morales has quit [Remote host closed the connection]
DragonMaus has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
DragonMaus has joined #commonlisp
rodrigo-morales has joined #commonlisp
wacki has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Th30n has joined #commonlisp
kamafam has joined #commonlisp
amb007 has quit [Ping timeout: 244 seconds]
kamafam has quit [Ping timeout: 248 seconds]
shka has joined #commonlisp
kamafam has joined #commonlisp
amb007 has joined #commonlisp
terrorjack4 has quit [Remote host closed the connection]
alternateved has joined #commonlisp
donlcn has joined #commonlisp
alternateved has quit [Remote host closed the connection]
alternateved has joined #commonlisp
Oddity has joined #commonlisp
Th30n` has joined #commonlisp
Th30n has quit [Read error: Connection reset by peer]
amb007 has quit [Ping timeout: 246 seconds]
amb007 has joined #commonlisp
Th30n`` has joined #commonlisp
Th30n`` has quit [Remote host closed the connection]
Th30n` has quit [Ping timeout: 248 seconds]
amb007 has quit [Ping timeout: 265 seconds]
mgl__ has joined #commonlisp
jonatack has quit [Ping timeout: 264 seconds]
amb007 has joined #commonlisp
jonatack has joined #commonlisp
jjnkn has joined #commonlisp
Cymew has joined #commonlisp
jjnkn has quit [Ping timeout: 276 seconds]
kamafam1 has joined #commonlisp
kamafam has quit [Read error: Connection reset by peer]
kamafam1 is now known as kamafam
thuna`` has quit [Read error: Connection reset by peer]
thuna` has joined #commonlisp
lagash has quit [Ping timeout: 248 seconds]
rogersm has quit [Quit: Leaving...]
kaskal has joined #commonlisp
kaskal has quit [Client Quit]
Cymew has quit [Quit: Konversation terminated!]
Cymew has joined #commonlisp
Cymew has quit [Ping timeout: 252 seconds]
random-nick has joined #commonlisp
yitzi has joined #commonlisp
mwnaylor has quit [Ping timeout: 252 seconds]
donlcn has quit [Remote host closed the connection]
Th30n has joined #commonlisp
donleo has joined #commonlisp
lagash has joined #commonlisp
jason__mw has quit [Remote host closed the connection]
jason__mw has joined #commonlisp
rogersm has joined #commonlisp
terrorjack4 has joined #commonlisp
Cymew has joined #commonlisp
thuna`` has joined #commonlisp
yitzi has quit [Remote host closed the connection]
X-Scale has joined #commonlisp
thuna` has quit [Ping timeout: 246 seconds]
Cymew has quit [Quit: Konversation terminated!]
Cymew has joined #commonlisp
terrorjack4 has quit [Ping timeout: 246 seconds]
Cymew has quit [Quit: Konversation terminated!]
Cymew has joined #commonlisp
terrorjack4 has joined #commonlisp
yitzi has joined #commonlisp
Cymew has quit [Quit: Konversation terminated!]
Cymew has joined #commonlisp
Cymew has quit [Quit: Konversation terminated!]
Cymew has joined #commonlisp
edgar-rft_ has joined #commonlisp
edgar-rft has quit [Ping timeout: 272 seconds]
edgar-rft_ is now known as edgar-rft
awlygj has joined #commonlisp
spdegabrielle has joined #commonlisp
decweb has joined #commonlisp
jason__mw has quit [Remote host closed the connection]
jason__mw has joined #commonlisp
Cymew has quit [Quit: Konversation terminated!]
Cymew has joined #commonlisp
Cymew has quit [Quit: Konversation terminated!]
Cymew has joined #commonlisp
jeffrey has joined #commonlisp
alcor has joined #commonlisp
Cymew has quit [Quit: Konversation terminated!]
Cymew has joined #commonlisp
rogersm has quit [Quit: Leaving...]
jonatack has quit [Read error: Connection reset by peer]
jonatack has joined #commonlisp
fitzsim has joined #commonlisp
lucasta has joined #commonlisp
zxcvz has joined #commonlisp
<Bubblegumdrop> bruh
<Bubblegumdrop> SDL2:LET-RECTS
<Bubblegumdrop> thanks.
kamafam has quit [Ping timeout: 264 seconds]
zxcvz has quit [Quit: zxcvz]
Cymew has quit [Quit: Konversation terminated!]
Cymew has joined #commonlisp
yitzi has quit [Remote host closed the connection]
varjag has joined #commonlisp
Cymew has quit [Ping timeout: 252 seconds]
rozenglass has quit [Ping timeout: 244 seconds]
mgl__ has quit [Ping timeout: 244 seconds]
rozenglass has joined #commonlisp
kamafam has joined #commonlisp
Krystof has joined #commonlisp
<jasom> Shinmera, fitzsim: Ciel is in the process of (or maybe already has) making the osicat dependency optional by switching out the two systems that depend on it (file-finder and moira).
<Shinmera> I guess filesystem-utils would now be useful for replacing the former at least
randm has quit [Remote host closed the connection]
randm has joined #commonlisp
bjorkint0sh has quit [Quit: "Every day, computers are making people easier to use." David Temkin]
bjorkintosh has joined #commonlisp
bjorkintosh has joined #commonlisp
spdegabrielle has quit [Quit: Connection closed for inactivity]
<jasom> Shinmera: yes, I just tried it in the program I was writing and it was 10x faster than using sb-posix, which was already 4-8x faster than using the CL utilities
yitzi has joined #commonlisp
yitzi has quit [Ping timeout: 276 seconds]
<Shinmera> now that's what I like to hear :)
<jasom> Shinmera: though map-directory in filesystem-utils-7433b4a01c70ed9f82f360ec76a7a760990d65ae from the shirakumo ql dist appears to leak open file descriptors? If I run my test enough times it stops working.
<Shinmera> really? that's surprising
<jasom> Maybe it's something I'm doing; I'll try to reduce.
<Shinmera> the fds should be closed via unwind protects.
<Shinmera> indeed I can't reproduce an out-of-fd error.
<Shinmera> just doing (dotimes (i 10000) (org.shirakumo.filesystem-utils:do-directory (f #p "/usr/include/" :recursive T)))
<ixelp> Seems to leak open fils · GitHub
<jasom> I run that twice with a directory tree that contains quite a few files; the length of the output is 705, which is the number of 2-deep directories. The second time it shows an error about nil not being an (or STRING PATHNAME) and if I try to e.g. compile a file with C-c C-k SBCL says "Too many open files"
<jasom> does it maybe only happen with :type :directory ?
rozenglass has quit [Ping timeout: 246 seconds]
rozenglass has joined #commonlisp
yitzi has joined #commonlisp
yitzi_ has joined #commonlisp
yitzi has quit [Ping timeout: 248 seconds]
yitzi_ has quit [Remote host closed the connection]
yitzi has joined #commonlisp
<Shinmera> shouldn't matter, the type only governs whether the callback is invoked
alcor has quit [Remote host closed the connection]
<Shinmera> If you have the time, stracing would probably be useful to figure out what it isn't closing
cage has joined #commonlisp
cage has quit [Excess Flood]
cage has joined #commonlisp
varjag has quit [Ping timeout: 246 seconds]
kaskal has joined #commonlisp
kaskal has quit [Client Quit]
kaskal has joined #commonlisp
<jasom> Shinmera: it's doing an openat() with O_DIRECTORY followed by a readlink() on the FD, but not closing the resultant FD; this appears to be to test if it's a directory?
<Shinmera> oh, I see, I was expecting it to recurse, in which case closedir will close the fd
<Shinmera> easy fix, then
<Shinmera> 154903f
mgl__ has joined #commonlisp
<jasom> Fixes my test-case
<jasom> Thanks
rozenglass has quit [Ping timeout: 246 seconds]
waleee has joined #commonlisp
rozenglass has joined #commonlisp
<Shinmera> thanks for the test
mgl__ has quit [Ping timeout: 252 seconds]
Pixel_Outlaw has joined #commonlisp
lucasta has quit [Remote host closed the connection]
rozenglass has quit [Ping timeout: 246 seconds]
wacki has joined #commonlisp
rozenglass has joined #commonlisp
yitzi_ has joined #commonlisp
yitzi_ has quit [Ping timeout: 260 seconds]
amb007 has quit [Ping timeout: 244 seconds]
amb007 has joined #commonlisp
msv has quit [Remote host closed the connection]
msv has joined #commonlisp
ezakimak has quit [Quit: No Ping reply in 180 seconds.]
ezakimak has joined #commonlisp
Opus has quit [K-Lined]
phantomics_ has quit [Quit: Leaving]
phantomics has joined #commonlisp
wacki has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
skin has left #commonlisp [#commonlisp]
treflip has joined #commonlisp
mgl__ has joined #commonlisp
Akbar-Birbal has left #commonlisp [#commonlisp]
wacki has joined #commonlisp
treflip` has joined #commonlisp
treflip has quit [Ping timeout: 265 seconds]
spdegabrielle has joined #commonlisp
easye has joined #commonlisp
mgl__ has quit [Ping timeout: 248 seconds]
_cymew_ has joined #commonlisp
varjag has joined #commonlisp
treflip` has quit [Ping timeout: 248 seconds]
ec has quit [Remote host closed the connection]
ec has joined #commonlisp
Opus has joined #commonlisp
wacki has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
X-Scale has quit [Quit: Client closed]
kevingal has joined #commonlisp
mgl__ has joined #commonlisp
jonatack has quit [Ping timeout: 245 seconds]
jonatack has joined #commonlisp
<younder> In SBCL when asking prompt> <reply>.. reply ends up on the next line. How do I fix it?
<younder> I cant see where the newline is coming from
mgl__ has quit [Ping timeout: 248 seconds]
jonatack has quit [Read error: Connection reset by peer]
<jasom> younder: It's probably that the terminal is echoing back characters typed in, including the newline that occurs when you hit enter.
cage has quit [Remote host closed the connection]
X-Scale has joined #commonlisp
jonatack has joined #commonlisp
<jasom> younder: but that's just a guess on what you've said; if you can give an example of what you mean, that would be good.
cage has joined #commonlisp
cage has quit [Excess Flood]
cage has joined #commonlisp
ym has joined #commonlisp
jonatack has quit [Read error: Connection reset by peer]
mwnaylor has joined #commonlisp
jonatack has joined #commonlisp
awlygj has quit [Quit: leaving]
_cymew_ has quit [Ping timeout: 246 seconds]
shka has quit [Read error: Connection reset by peer]
shka has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 29.4]
kamafam has quit [Read error: Connection reset by peer]
akoana has joined #commonlisp
X-Scale has quit [Quit: Client closed]
ym has quit [Ping timeout: 252 seconds]
X-Scale has joined #commonlisp
spdegabrielle has quit [Quit: Connection closed for inactivity]
mala has quit [Ping timeout: 260 seconds]
spdegabrielle has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
luna-is-here has joined #commonlisp
pve has quit [Quit: leaving]
bjorkintosh has quit [Read error: Connection reset by peer]
easye has quit [Remote host closed the connection]
easye has joined #commonlisp
bjorkintosh has joined #commonlisp
bjorkintosh has joined #commonlisp
shka has quit [Ping timeout: 246 seconds]
alternateved has quit [Remote host closed the connection]
jason__mw has quit [Remote host closed the connection]
Akbar-Birbal has joined #commonlisp
mala has joined #commonlisp
varjag has quit [Ping timeout: 246 seconds]
yitzi has quit [Remote host closed the connection]
Krystof has quit [Ping timeout: 248 seconds]
kevingal has quit [Ping timeout: 260 seconds]
Akbar-Birbal has left #commonlisp [#commonlisp]
molson_ has joined #commonlisp
molson has quit [Ping timeout: 252 seconds]
donleo has quit [Ping timeout: 246 seconds]
akoana has quit [Quit: leaving]
robin is now known as lispwitch
lispwitch is now known as robin
screwlisp has joined #commonlisp
<screwlisp> Lispy gopher climate sooon -> anonradio.net . Aside from kmp's haiku and some of my programming stuff, talking a little about the parallels between one of artyom's articles, mine, many on loop and format and things.
<screwlisp> I will look here during the show a bit.