<jackdaniel>
I think that it is generated with cl-autowrap and that there is no "source file"
<aeth>
It's not easy to understand at all. It's very clever, very undocumented, and also kind of incomplete. It tried to add some higher level framework on top of SDL2
shka has quit [Ping timeout: 252 seconds]
<aeth>
The stuff that maps 1:1 with the foreign documentation is comparatively easy, though
<Seok__>
yeah, I assumed there was no documentation for it since it doesn't mention any at the github page
shka has joined #commonlisp
<Seok__>
a lot of the stuff in the source are just 1:1 wrapper for C SDL2, but there are some new stuff like you said
gxt has quit [Remote host closed the connection]
<aeth>
what really got me when I was trying to understand it is that some things don't even exist at all
gxt has joined #commonlisp
<aeth>
implicitly defined macrolets inside of macros
<aeth>
Good luck.
<Seok__>
: )
<aeth>
maybe #lispgames can help
<jackdaniel>
I'd stick to the C-defined interface and build from there; then all sdl2 tutorials are directly translatable
<aeth>
There are other wrappers that are closer to just being the C-defined interface. I've been meaning to migrate for a while.
<aeth>
cl-sdl2 felt to me more like reverse-engineering the design of cl-sdl2 rather than learning SDL2 the documented C library.
OlCe` has quit []
OlCe has joined #commonlisp
<aeth>
It does some weird things (that probably affect performance, too) like wrapping C pointers in CL structs... iirc so finalizers can be written for it.
ec has quit [Remote host closed the connection]
anticomputer has quit [Remote host closed the connection]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
anticomputer has joined #commonlisp
ec has joined #commonlisp
<Seok__>
if I want to use the auto-wrapped functions, do I have to pass the appropriate CFFI objects to the functions?
attila_lendvai has joined #commonlisp
attila_lendvai has quit [Read error: Connection reset by peer]
scymtym_ has quit [Quit: ERC 5.4.1 (IRC client for GNU Emacs 29.0.50)]
eddof13 has joined #commonlisp
* jackdaniel
is appreciating little things like PSETF
tane has joined #commonlisp
tane has joined #commonlisp
tane has quit [Changing host]
<phoe>
ah yes, parallel SETF - assigns multiple values to one variable by creating a new parallel universe for each value assigned
<phoe>
too bad there is no standard operator for collapsing them back
<semz>
aeth: I had the same experience with cl-sdl2 and ended up wrapping the necessary parts of SDL myself with cffi. Probably the 120th guy to do so...
tyson2 has joined #commonlisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
<jolby>
Seok__: Another option might be borodust's aw-sdl bindings. They are basically a thin 1-1 mapping to the C API. https://github.com/borodust/aw-sdl
<ixelp>
GitHub - borodust/aw-sdl: Common Lisp bindings for SDL2
<aeth>
semz: what I did was I just directly accessed a bunch of internals from cl-sdl2 instead of going through its high level stuff.
semz_ has joined #commonlisp
semz has quit [Ping timeout: 252 seconds]
semz_ is now known as semz
<aeth>
semz: what I did was I just directly accessed a bunch of internals from cl-sdl2 instead of going through its high level stuff.
<aeth>
iirc the (C?) structs required some ugly, manual parsing based on an internal representation or something.
<aeth>
but the rest was basically just there, at a lower layer
<aeth>
jolby: I wouldn't be surprised if that wrapper's close to a drop-in replacement because borodust basically just wrote an improved fork of autowrap
<aeth>
at least, once you get past the initialization
<jolby>
aeth: Yeah I like the bindings generated by CLAW better than cl-autowrap. I like having the generated lisp source to consult rather than some inscrutable macrology.
Cymew has quit [Ping timeout: 248 seconds]
<aeth>
afaik, the author of autowrap wanted to write some incredibly clever code, was dissatisfied with the performance of this clever code, decided to write a big C++ framework to foreign-call into instead, and then basically just stuck with C++
cosimone has quit [Remote host closed the connection]
shka has quit [Ping timeout: 252 seconds]
<thuna`>
Is it possible to do DEFINE-CONDITION so that ERROR doesn't want key arguments? I want to be able to do something like (ERROR 'FOO-ERROR FOO-VALUE)
tyson2 has quit [Remote host closed the connection]
mfiano has quit [Quit: WeeChat 3.7.1]
mfiano has joined #commonlisp
<Bike>
No.
<thuna`>
That's too bad. Something similar to DEFSTRUCT would have been nice.
<Bike>
You can define your own function to signal an error. at that point you're not getting too much out of inheritance anyway.
mfiano has quit [Quit: WeeChat 3.7.1]
mfiano has joined #commonlisp
mfiano has quit [Client Quit]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
_cymew_ has quit [Ping timeout: 246 seconds]
epony has quit [Quit: QUIT]
<Bike>
Is anyone familiar enough with Staple to know how to make documentation that's more than one page, with links between them? I have a pretty complex system and I'd like to not cram everything into one README file.
igemnace has quit [Remote host closed the connection]
epony has joined #commonlisp
<Bike>
Or am I barking up the wrong tree here
willfish has joined #commonlisp
mfiano has joined #commonlisp
mfiano has quit [Client Quit]
matt`` has joined #commonlisp
<Shinmera>
jolby: I've been using GLFW instead of SDL with pretty much zero issues.
<Shinmera>
it does less for sure, but everything it doesn't do that sdl does is solveable with pure-lisp libraries these days.
<Shinmera>
Bike: hello.
matt` has quit [Ping timeout: 252 seconds]
<Shinmera>
Bike: You're meant to create a custom PROJECT that has the PAGE instances you want.
tane has quit [Ping timeout: 252 seconds]
<Bike>
mhm, figured it would come to that. do you know of any examples i could look at? i've been looking at some of yours, but so far i'm only seeing one page per system.
<jolby>
Shinmera: Thanks, that's good to know and good to hear that more of what SDL does can just be done in common lisp.
<Shinmera>
Bike: I've only used multiple pages in two ways, both of which are mostly automated. For instance, in Radiance I have an english and japanese version. Staple picks that up automatically and generates the pages and links: https://shirakumo.github.io/radiance/
<ixelp>
Radiance
<Shinmera>
In Alloy for instance I use the automated "subsystems" which splits other ASDs into their own pages: https://shirakumo.github.io/alloy/
<ixelp>
Alloy
Guest5966 has quit [Quit: WeeChat 3.7.1]
<Shinmera>
If you want to customise beyond those automatic ways, you'll want to specialise on FIND-PROJECT and create your own PROJECT instance with the appropriate PAGE instances attached. IIRC it's fully generic, so for instance a project by itself just has a PAGES generic function you can specialise. Or you can make a SIMPLE-PROJECT instance and push to its PAGES slot.
<Shinmera>
The different PAGE types are all documented, there's ones for just emitting a page based on a markdown/whatever file
<Shinmera>
As for cross-referencing, you just use a relative link to whatever you decide to name the other pages.
mfiano has joined #commonlisp
<Bike>
I saw the different languages thing, but that's not quite what I have in mind. So I will have to play around with a PROJECT. thanks for the tips
<Shinmera>
Sure. To be clear, the split pages thing was never properly explored in practise by myself, so if it's more annoying than it should be, please let me know.
<Shinmera>
It's also possible that INFER-PROJECT could be improved to automate such setups, as well.
mfiano has quit [Client Quit]
<Bike>
Yeah, I figured it would be a bit of an uphill battle. That's fine, I know I have something complex here. so far I've tried just throwing another .md file into the repo to see if staple would pick up on it, but that does not seem to be happening
<Shinmera>
See the DOCUMENTS generic function
tane has joined #commonlisp
tane has quit [Changing host]
tane has joined #commonlisp
<Shinmera>
And also possibly the *DOCUMENT-PATTERNS*
tane has quit [Remote host closed the connection]
<Shinmera>
The problem with doing it that way though is that Staple will add the full system index to the end for each of those documents
<Shinmera>
which is proooobably not what you want :)
<Bike>
indeed, not quite. i also already tried DOCUMENTS and that doesn't seem to have helped. probably i just need to make that PROJECT and go from there
<Shinmera>
yeah, it's what you're meant to do.
<Shinmera>
Feel free to braindump / pester over in #shirakumo at any time.
<Bike>
Sure. I noticed it fell off my autojoin earlier today, oops
Guest72 has joined #commonlisp
Guest72 has quit [Client Quit]
cosimone has joined #commonlisp
bilegeek has quit [Quit: Leaving]
willfish has quit [Ping timeout: 255 seconds]
jeosol has quit [Quit: Client closed]
cosimone has quit [Remote host closed the connection]
<frodef>
Does anyone know of a library function that will compute a checksum of an arbitrary data-structure?
sedzcat has quit [Quit: sedzcat]
<Shinmera>
No
<Shinmera>
This feels similarly perilous as trying to clone an arbitrary object.
<Shinmera>
Or trying to do a generic "equality" test
mfiano has joined #commonlisp
lucerne has quit [Read error: Connection reset by peer]
akoana has joined #commonlisp
<frodef>
Shinmera: it's to decide whether a full reload of data is needed.
<Shinmera>
My point is, a generic library cannot determine which bits in a data structure are relevant to the hashing process or not.
ec has quit [Ping timeout: 258 seconds]
<Shinmera>
As long as the structure isn't cyclical it should be fairly easy to do it yourself just feeding bits into an ironclad digest.
ec has joined #commonlisp
<Shinmera>
And, well, as long as you're not using something like a hash table where the iteration order isn't guaranteed to be consistent, I suppose. It gets tricky fast :)
<phoe>
frodef: you need to define it yourself, see e.g. how cl-murmurhash does it
<frodef>
Think I'll just do sxhash
thuna` has quit [Remote host closed the connection]
Spawns_Carpeting has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
jmdaemon has joined #commonlisp
Spawns_Carpeting has joined #commonlisp
dipper has joined #commonlisp
matt``` has joined #commonlisp
matt`` has quit [Read error: Connection reset by peer]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]