IRC channel logs

2020-05-19.log

back to list of logs

***catonano_ is now known as catonano
<wingo>o/
<janneke>\o
***jonsger1 is now known as jonsger
***amiloradovsky1 is now known as amiloradovsky
<pinoaffe>so I've started using geiser with guile, and every now I unthinkingly make the repl print a huge string / sexp / whatever, which then completely hangs up emacs and makes it pretty much unusable - is there anything I can do to change this / salvage such a situation?
<rekado_>pinoaffe: difficult
<rekado_>I still run into this once in a while
<rekado_>Emacs 27 has “so-long” mode, which might help
<pinoaffe>I'm working with a lot of decently sized (s)xml, so currently any ill-considered printing is likely to require a restart of emacs, which means I can't really use geiser
<civodul>there's the emacs-so-long package (in Guix at least) for 26.x too
<janneke>so-long...ooh, that souds great (as far as workarounds can be great)
<civodul>:-)
<civodul>i think i just had a vision: i envy C++ constexpr
*janneke has restarted emacs one or two times when debugging mes printing a circular
<janneke>list
<civodul>ah yes, that's terrible
<civodul>macros are great but sometimes you'd want to reason on types
*civodul feels heretic today
<janneke>dare i say that goops gives very nice errors, at times?
<civodul>no but i want some things to happen at compi^W expansion time
<lloda>pinoaffe: you can change the default repl printer with (repl-default-option-set! 'print (lambda (repl val) ...))
<janneke>ah, static typing
<civodul>well, there are macros like "uuid" or "base32" in Guix, which are really not rocket science
<janneke>mustn't let regtur hear about things guile could loarn from c++
<janneke>*learn -- typing is broken today ;-/
<civodul>these things call for a mechanism like constexpr, more than regular macros
<rekado_>pinoaffe: I use ,pp in the REPL for sxml
<civodul>and currently, you know that some computations happen at compile time through one of the compiler passes
<civodul>but it's not "official"
<janneke>hmm...
<civodul>anyway, random thought of the day
***jonsger1 is now known as jonsger
<dsmith-work>Tuesday Greetings, Guilers
<justin_smith>pinoaffe: the ice-9 pretty-print module comes with truncated-print, in other lisps I've been able to replace the repl printer with a custom function like truncated-print which can control the maximum output size
<justin_smith>this looks exactly like what I was thinking of https://www.gnu.org/software/guile-cv/manual/html_node/Configuring-Guile_0027s-repl_002dprint-procedure.html
<pinoaffe>rekado_, justin_smith, lloda: thanks, I'll try to change the repl printer to abbreviate by default
<justin_smith>oh I missed that someone else mentioned that already
<justin_smith>but that example from the "guile-cv" manual does work, if loaded from the ~/.guile config (or I guess more generally, if loaded before the repl runs)
<justin_smith>sadly it didn't work mid session
<wasamasa>hello, I think I've found a bug in guile 3.0.2
<wasamasa>before reporting it I'd like to make sure whether it's indeed a bug and what to include in the report
<wasamasa>when redirecting a length script into the repl, it eventually crashes with "Too many root sets", then does a coredump
<wasamasa>*lengthy
<wasamasa>is that expected behavior or abnormal?
<wasamasa> http://ix.io/2mIk
<dsmith-work>wasamasa: Not a guile dev, but I'm pretty sure any coredump should be considered a bug.
<wasamasa>ok, that's what I'm used to with emacs bugs, any crash there gets the same treatment
<wasamasa>if I don't redirect it, but execute it as normal script, it finishes, although it takes 10 minutes to do so
<wasamasa>hm, the error originates from the boehm garbage collector
<wasamasa>same behavior with guile 2.2.6 on arch
<lampilelo>you're still testing guile-emacs?
<wasamasa>no, guile --language=elisp
<lampilelo>ah, right, i read your blog about it yesterday
<wasamasa>I mean, if it's shipped with a sufficiently new guile, it's official and supported
<dsmith-work>wasamasa: Have a look at module/language/elisp/README in guile sources. Might help with expectations
<dsmith-work>wasamasa: Also, test-suite/tests/elisp*.test for what is currently tested
<wasamasa>ah, these I haven't found so far
<wasamasa>I'm tempted to say that's more tests than emacs has
<wasamasa>for some reason they don't test the core functionality, only the extra stuff
<wasamasa>anyhow, I've reported the bug: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41404
<RhodiumToad>lloda: I may have hit a bug in guile-cairo?
<RhodiumToad>yup
<RhodiumToad>cairo_surface_get_mime_data ( ..., &len ) where len is a size_t, but where the function prototype says it wants unsigned long *
***sputny1 is now known as sputny
***sputny1 is now known as sputny
<daviid>pinoaffe: here is what I do and recommend - https://www.gnu.org/software/guile-cv/manual/html_node/Configuring-Guile-for-Guile_002dCV.html#Configuring-Guile-for-Guile_002dCV - which I wrote for guile-cv users, but applies to any use that involves huge 'what-ever' in a repl and wrt the raised exception system ...
<daviid>oh, i see someone did paste that already, sorry
<daviid>justin_smith: i personally make the config 'global' -in the int.scm file at guile -c "(display (%global-site-dir))(newline)" - because I _never ever_ want to display huge 'what-ever (in guile-cv, it wold be like 20 million floats or so ...) and if I fce an exception, they I grab and ses a variable I can further 'inspect', using write, or sending its content to a file ...
<daviid>justin_smith: I was not waware those settings couldn't be done o the fly, that's unfortunate
<daviid>but i don't need, I never need, to fully repl display the content of huge 'wah-ever' - but if someone coes with a solution to toggle this dynamiclly, let me know ...
<justin_smith>daviid: surely it's nothing you couldn't solve with indirection and a global (lambda (repl obj) (if truncate? (truncated-print obj) (write obj)) (newline))
<justin_smith>it's a good candidate for dynamic binding, though that's not as popular in scheme as it is with other lisps
<justin_smith>daiia
<justin_smith>err, I should have figured the person who wrote that doc would be here
<manumanumanu>Finally I am on a linux computer!
<ZombieChicken>Did the build system for guile 3 change from guile 2.2?
<daviid>justin_smith: we can do that, but i thought yo wanted to fix the problem at the 'source', so one could dynamically set! the repl printer, which imo would be better ... then users who'd like to could toggle between truncated or non tuncated ...
<justin_smith>yeah, that would be better (though I assume harder to fix)
<cbaines>does anyone know how to work out why Guile is making a futex system call?
<RhodiumToad>locking between threads?
<RhodiumToad>it'll have to do that sometimes for the GC, at least
<cbaines>is there any way to confirm it's that?
<cbaines>I'm already disabling gc at points, as it appears to make forking unreliable
<RhodiumToad>well forking in a threaded program has a long list of caveats
<cbaines>I'm not trying to use threads in this case
<RhodiumToad>(which amount to "don't do it unless you're about to exec()")
<RhodiumToad>afaik, the default guile build is to use threads and put the GC into a separate thread
<cbaines>I am actually trying to do things in the forked processes
<cbaines>Is that not possible to do safely with Guile?
<RhodiumToad>maybe you want to build it without threads - I don't know if that even works, but I believe it should
<weinholt>cbaines, strace -k to show backtraces for syscalls, might give you the info you need
<RhodiumToad>doing nontrivial stuff after a fork in a threaded program is always dubious
<cbaines>I think I need to rebuild strace for -k to work....
<cbaines>strace: Stack traces (-k/--stack-traces option) are not supported by this build of strace
<cbaines>It seems that disabling garbage collection might work
<cbaines>but even trying to do it occasionally seems to quickly result in Guile getting stuck :(
<cbaines>I think I need to go back to the drawing board in terms of how to use processes...
<dsmith-work>It's possible to fork/exec with threads (otherwise system and friends wouldn't work), but you can
<dsmith-work>t use fork and then keep on running in the new process.
<dsmith-work>Not unless you handle all the locks properly.
<cbaines>At this point, I'm trying to avoid using primitive-fork
<cbaines>The primitive-fork docs suggest using (ice-9 popen), so I'm now trying to work out how to use that, given that I don't care about writing to or reading from the processes I want to run...
<dsmith-work>Will system* do?
<cbaines>I'm trying to use processes to do more than one thing at once
<cbaines>I think system* will just mean I have one process waiting for another to finish
<lampilelo>can't you use threads instead?
<cbaines>I think I was having problems because of using threads
<RhodiumToad>with threads, if you share any data you have to make sure you do appropriate locking
<cbaines>Or rather, because threads cause issues with forking
<lampilelo>fork doesn't copy threads
<lampilelo>just the calling thread
<RhodiumToad>the problem is that locks held by other threads stay locked in the forked child.
<RhodiumToad>so if you try and take those locks, you hang forever
<dsmith-work>Exactly
<dsmith-work>There is a fuction that's supposed to handle that, but the interface is not nice for Scheme.
<dsmith-work>It aquires all the locks and then releases them in the new process.
<dsmith-work>But of course, you must get them in the right order or you deadlock.
*RhodiumToad grumbling a bit about guile-cairo
<dsmith-work>All they needed to do was include a few void *'s for context..
<RhodiumToad>my own fault of course for thinking "it's not a big update, I don't need to test it on many platforms"
<dsmith-work>Ah. pthread_atfork is what I meant.
<ZombieChicken>is it me, or goes Guile lack a for loop?
<RhodiumToad>it has several?
<RhodiumToad>(do) is one of them
<RhodiumToad>named-let is also commonly used
<ZombieChicken>Different name then. Thanks
<ZombieChicken>Trying to convert some Racket code to Guile, and it seems like a lot is 1:1 wrt names
<justin_smith>fascinating, racket's "for" looks like a hybrid of clojure "for" and the version from c
<justin_smith>probably clojure copied racket then made it more lispy
<ZombieChicken>racket seems to do a lot of interesting things
<RhodiumToad>this business of making horribly complex loop macros has always struck me as a bit iffy
<justin_smith>common lisp "loop" is insane, it's practically a punchline on its own
<ZombieChicken>Sometimes a nice do/for loop makes more sense than a recursive function
<ZombieChicken>justin_smith: How complex is CL's "loop"? I can't say I messed with CL too much; the hyperspec kind of scared me off. Plus it's weird way of handling printing to stdout
<justin_smith>ZombieChicken: it's a full programming language inside cl
<ZombieChicken>Fun
<ZombieChicken>DSLs are great
<ZombieChicken>Hmm. Seems like guile 3 takes a little while to compile...
<justin_smith>ZombieChicken: http://ix.io/2mKQ
<ZombieChicken>That looks fun
<justin_smith>I compare it to c++ templates or haskell monads - I'll agree that they are intreguing and unique features, but they are also kind of wild
<RhodiumToad>now that is insane
<RhodiumToad>and not in a good way
<ZombieChicken>I've always felt that I either didn't understand monads, or that they were little more than a weird object
<ZombieChicken>RhodiumToad: On the up side, it reads kind of like English?
<RhodiumToad>that's not a good thing
<justin_smith>it might have been influenced by COBOL in that aspect
<RhodiumToad>and I say that as an SQL expert and someone who has written COBOL in the past
<ZombieChicken>Given how CL developed, there is no telling