IRC channel logs


back to list of logs

<amz3>ArneBab: hi!
<amz3>ArneBab: how are you doing?
<amz3>ArneBab: tx for the reply, I will _maybe_ look at it, not sure because I pondering the idea of abandonning webdev
<brettgilio>Will somebody seeing this ping me? Checking my elisp code for notifications. thx
<amz3>brettgilio: pong
<brettgilio>amz3: Thx, unfortunately it works but not as intended.
<brettgilio>(defun call-libnotify (matched-type nick msg)
<brettgilio> (let* (
<brettgilio> (cmsg (split-string (clear-string msg)))
<brettgilio> (nick (first (split-string nick "!")))
<brettgilio> (msg (mapconcat 'identity (rest cmsg) " ")))
<brettgilio> (shell-command-to-string
<brettgilio> (format "notify-send -u critical '%s says:' '%s'" nick msg))))
<brettgilio>Oh shoot, my bad. I did't think it'd send as 10 messages.
<amz3>brettgilio: it looks like scheme code
<brettgilio>amz3: will you ping me again?
<brettgilio>I fixed my buggy code.
<brettgilio>Hey all, who here regularly embeds scheme with guile into their C/C++ projects?
<civodul>brettgilio: i suppose many people extend Guile, rather than embedding it into C app
<civodul>to volatile or not to volatile, thoughts wingo?
<civodul>i was thinking maybe this:
<civodul>* (union scm_vm_stack_element *volatile) vp->fp = new_fp;
<brettgilio>civodul: Indeed, my reason for asking is that I'm planning on rewriting a C++ application of mine's logic into Guile Scheme, but keep the front-end in C++/Qt, a clean and distinct separation of logic from the "MVC". That way to not complicate my work by having to wrap too much C++ into Guile.
<brettgilio>And was wondering if anybody had any experience with such embedding.
<brettgilio>Because i've never used Guile as an embedded lisp, but I've read that it is really good for such.
<civodul>brettgilio: yes, overall it makes embedding quite easy
<civodul>with C++ it may be slightly more complicated
<civodul>in particular with exceptions
<civodul>IIRC OpenCog is in C++ and embeds Guile
<civodul>LilyPond is in C++ too, but they had troubles switching to Guile 2
<wingo>civodul: what precisely does accessing via a volatile pointer mean?
<wingo>my understanding is that C leaves volatile somewhat underdefined
<wingo>but that most compilers force that volatile to be a memory access
<wingo>but, we mostly just want the barrier effects, right? specifically the compiler barriers
<civodul>i think i'll just leave it out for 2.2.4
<wingo>yeah i don't know what kinds of barriers a volatile access implies
<civodul>it does not imply a memory barrier like the 'lock' instruction prefix on x86_64
<wingo>there are many kinds of memory barriers :)
<civodul>what i mean is that it's really a compiler barrier
<wingo>between other volatile accesses or also other accesses?
<wingo>b/c there are other non-volatile assignments to the stack that probably shouldn't be reordered either, by the compiler, in code that also assigns ->sp and ->fp
<civodul>AIUI, it's just that loads and stores to volatile references cannot be reordered by the compiler
<brettgilio>Goodnight, friends.
<brettgilio>Thanks for your help civodul .
<wingo>night brettgilio :)
<wingo>civodul: i think we would want a stronger compiler barrier -- between sp/fp writes and any other write to the stack
<civodul>how stronger? :-)
<wingo>specifically that the barrier should also prevent a compiler from moving a non-volatile write to the stack across an assignment to sp or fp
<wingo>your inline assembly barrier did the job nicely i think
<civodul>i think so, but it has the disadvantage of being GCC-specific (or almost GCC-specific)
<wingo>civodul: i think we can do what bdw-gc does
<wingo>#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
<wingo># define GC_reachable_here(ptr) \\
<wingo> __asm__ __volatile__(" " : : "X"(ptr) : "memory")
<wingo> GC_API void GC_CALL GC_noop1(GC_word);
<wingo># define GC_reachable_here(ptr) GC_noop1((GC_word)(ptr))
<wingo>i.e. the fall-back case can be to call out to a function whose memory effects are unknown
<civodul>wingo: oh right, sounds like a good plan
<civodul>Guile 2.2.4 is out!
<wingo>woo hoo!!!!!!
<civodul>pretty cool to get that done :-)
<wingo>congrats :)
<wingo>lightning seems to increase libguile size by 1 MB (to 6.17 MB from 5.17 MB)
<wingo>on x86-64 anyway
<civodul>it's statically-linked?
<wingo>yes, built into libguile
<wingo>actually let me push a branch
<civodul>that's with debugging symbols no?
<civodul>sounds really exciting :-)
<wingo>see "lightning" branch in git
<wingo>yes with debugging symbols etc
<wingo>heh it is mostly autotoolery at this point :P
<wingo>note, i haven't actually implemented the jit yet :P
<wingo>just integrated lightning into the build, with an --enable-jit option that defaults to --enable-jit=auto
<wingo>which enables the jit if it's supported
<civodul>neat! crazy stuff
<civodul>we've been discussing this for so long
<civodul>really exciting
<dsmith-work>Hey Hi Howdy, Guilers
<rekado>congratulations on releasing Guile 2.2.4! I’m very happy about the bug fixes.
<civodul>it's not the end of the story, though
<atw>ArneBab: I've figured out the answers to those questions now, but it's the type of question that seems likely to come up when starting with any language: "what libraries are there? How do I get and use them?"
<manumanumanu>wingo: yeah! Is there any info on the JIT process?
<manumanumanu>oops. sorry, didn't see the guile-devel post
<dsmith-work>wingo: Anything else I can do to help with that segfault?
<lavaflow>is there a guile package for dealing with zip files (extraction particularly) ?
<weinholt>lavaflow, if you're willing to swallow a whole package manager (or get the dependencies by hand):
<janneke>lavaflow: there's
<lavaflow>weinholt: janneke: thanks, one of these should work
<stis>Hej guilers!
<manumanumanu>stis: long time no see!
<manumanumanu>Ahoy hoy!
<manumanumanu>stis: what are you up to?
<manumanumanu>Anyone here good with (ice-9 match) ?
<manumanumanu>Say I want to check whether a procedure returns true using (? predicate) but I also want to bind the result of that predicate to use in the match body... Is that possible or will it get ugly?
<manumanumanu>What I really want is to check whether regexp "rxp" matches against the object I'm matching against and bind the match object
<manumanumanu>I know I know, it's a code smell, but it is also exactly what i want to do
<lavaflow>weinholt: do I need to do anything special to use a akku installed library? I did `akku install compression` and `source .akku/bin/activate` in my project directory
<lavaflow>GUILE_LOAD_PATH is set, but when I try to use (compression zip) it tells me "no code for module"
<manumanumanu>ah yes, found it out
<weinholt>lavaflow, guile -x .guile.sls -x .sls, possibly also reader options... i should do some work on this :)
<weinholt>going to bed now, good luck!
<manumanumanu>ah, no, didn't make it work
<stis>manumanumanu: not much scheming atm, mainly mathematics in my hobby time
<stis>manumanumanu: doesn't (? pred? (set var)) work
<manumanumanu>(and symbol (= symbol->string s)) does
<stis>manumanumanu: doesn't (? pred? var) work
<manumanumanu>that binds var to the original match
<manumanumanu>so (and symbol (? symbol->string s)) binds s to a symbol
<stis>yeah that's true
<manumanumanu>so there is no way to bind the result of a predicate
<stis>(= pred? (? truep x)) ?
<stis>ouch bonuspoints for mixing cl and scheme nomeclature for predicates
<manumanumanu>I don't even know how that is supposed to work. = binds the result of pred? to (? true? x), which seems wonky
<stis>now = outputs the result of pred to the matcher (? true? x) which will check for it to be true and then bind it to x
<stis>I would prefere the racket macther here, one can construct custom matchers and gte quite nice end result
<stis>Then you could have written (=? pred? x), with a suitable defined =?
<stis>There is a racket matcher in guile-syntax-parse
<manumanumanu>stis: you are a genious
<manumanumanu>thank you
<ArneBab>amz3: why do yo want to abandon webdev?
<ArneBab>wingo: so … I can … actually try this now? … still feels unreal … I want to test it …
<ArneBab>sneek: later tell atw: you’re right. I hope we can tackle that better and better with time. It feels like there are barriers to entry which prevent reaching the documentation which works pretty well — even offline.
<sneek>Got it.
<amz3>ArneBab: too much cruft, it seems to me gtk / clutter or something like that will be more lightweight
<apteryx`>how do I accumulate stuff in a loop in Guile? I could use cons, and reverse, but isn't this imperative rather than functional?
<apteryx`>I'm reading a file and upon a regexp match on a line, I want to accumulate the matched group text in a list.
<rekado>apteryx`: you can use “fold” from srfi-1.