IRC channel logs
2023-12-21.log
back to list of logs
<apteryx>how would I generate a backtrace programatically upon encountering a fatal crash (I want to log it?) <wingo>apteryx: see implementation of call-with-error-handling <wingo>there is also the backtrace procedure <wingo>starting to think we should merge fibers into guile :P <wingo>also we should make a release <apteryx>wingo: thanks! a new release would be nice! I have a bunch of NEWS items to make it more featureful if needed ;-) (new SRFIs and some R7RS fixes) <apteryx>wingo: is the 'backtrace' documented somewhere, or where is it defined? <apteryx>ah, SCM_DEFINE (scm_backtrace_with_highlights, "backtrace", 0, 1, 0, ... in backtrace.c ? <mwette>apteryx: there is something in system/repl/error-handling.scm, search for print-frames <cobra>dthompson: I see you're the maintainer of guile-sdl2. How does one create a surface with a background color? <cobra>Specifically, I want to make the surface transparent <cobra>The surface automatically has a black background though, so trying to use fill-rect with a transparent color will just overlay it on top of the black <cobra>I guess I will look into using opengl <apteryx>can I get the continuation from an exception to pass it to make-stack? <apteryx>I don't want to get the extra frames from my handler <apteryx>maybe, (call/cc get-backtrace) within my handler? <apteryx>with get-backtrace accepting a continuation object <dthompson>you absolutely do not need to use opengl to have a clear background <dthompson>it literally overwrites the color information with what you specify <apteryx>basically what I'd wish for is something like we have in Python: logging.exception("message"), with the current exception info (backtrace) added below the message. <cobra>dthompson: filling the surface with (fill-rect surf (make-rect 0 0 x y) color) where color is #xffffff7f and the surface format is 'rgba8888 results in this: https://0.vern.cc/dt.png <cobra>the same after replacing make-rect with #nil <cobra>where the surface isn't, the window is completely transparent <dthompson>cobra: #x7f is 127 which brings the full white down to a mid gray. looks correct to me. <dthompson>are you expecting to see through the entire window? <dthompson>that wouldn't be possible with what you're trying to do <dthompson>I thought you just wanted transparent color data in the surface, which you have achieved <dthompson>how are you blending when you blit the surface? <dthompson>perhaps if you blit with no blending at all then you will get the look you're after <cobra>I'm currently converting the surface to a texture with surface->texture, and using set-texture-blend-mode! setting it to none makes it not transparent at all <dthompson>yeah sounds like it's either not possible to do what you want with sdl or you need to lookup what the proper technique is <dthompson>all I can tell you is that your surface pixels are correct according to the code you've shown <apteryx>what's the smallest amount of resident memory guile daemon typically uses? <apteryx>random fact: the Guile 3.0.9 VM uses 1 MiB extra of resident compared to Python 3.10.7 (tested using a while loop on Guix) <apteryx>shared memory is nice; having Shepherd run with on Guile in Guix System means other Guile processes reuse that same memory for their main VM <apteryx>reading info '(guile) Smobs', there's this mention: "“applicable SMOBs” that's supposed to be discussed, but I don't see where? <civodul>apteryx: an “applicable SMOB” can be applied like a regular procedure <civodul>not formally deprecated, but “foreign objects” are the newer API for this <dthompson>and you can define new applicable data types without using C at all <dthompson>we use applicable structs in hoot for running wasm scheme inside guile scheme somewhat transparently :) <dthompson>a wasm scheme procedure that's plucked out of the wasm runtime can be called as if it were any old procedure <apteryx>hm. I'll need to ponder over all of this some to get a clue :-) <dthompson>there's just no nice high level api for it. gotta use the not-so-pleasant low level struct api <apteryx>can we define keyword arguments procedure from C? The closest I know to do is SCM_DEFINE with optional args <apteryx>define scheme procedures using keyword arguments* <civodul>in general, people tend to prefer (system foreign) over the C interface <civodul>there’s ‘scm_c_bind_keyword_arguments’ <apteryx>good to know about scm_c_bind_keyword_arguments! <apteryx>I think I'll stick to positional arguments and having two of them accept false values, for a very similar result