IRC channel logs

2016-05-02.log

back to list of logs

<datagrok>paroneayea: i've recently been learning guile along with wisp (srfi-119) mostly due to your praise for it (https://twitter.com/dustyweb/status/646788662361849856)
<datagrok>paroneayea: now i'm comparing wisp to sweet (srfi-110) to see if i have a preference for one or the other. did you have any critique of sweet that makes wisp superior?
<amz3>Good Morning #guile!
<civodul>moin!
<janneke>morning!
<random-nick>what is the reason for using hashv-* and hashq-* procedures instead of hash-* procedures?
<taylan>random-nick: do you know the differences between eq?, eqv?, and equal? ?
<random-nick>equal? checks value equality, eqv? checks object equality (as in are those the same objects in memory)
<random-nick>eq? does both?
<random-nick>oh eq? is the one with for memory
<taylan>IMO the best way to think about it is that eqv? checks (an approximation of) "operational equivalence", i.e. whether two objects are "the same" in the semantics of the language. eq? is merely a performance hack over eqv?; it's specified to be undefined on numbers and characters because they may be allocated several times on the heap (thus not be pointer-equal) despite actually being the same
<taylan>number/character. equal? does lax content equality, so e.g. two (mutable) strings that currently have the same characters are equal even though they're different objects.
<taylan>but sometimes I wonder whether this abstract way to look at it is really beneficial, when many programmers are already accustomed to think in terms of implementation details :)
<random-nick>yes but I am asking what impact the differences have on hashtables
<taylan>in any case, hashv uses eqv? and hashq uses eq? to compare the keys of the hash table. for instance when I store an association from '(foo bar) to 42 in the table, then looking it up with hashq-... will not give a result when one uses a newly allocated (foo bar) as the lookup key
<taylan>sorry, I diverged on the eq?/eqv?/equal? thing
<random-nick>so basically hashq might be faster but you have to keep your key from being garbage collected?
<taylan>yeah, or if you really want to associate values to individual objects (you can use a weak-key table then, so when the key object is GC'd, the association in the table goes poof)
<taylan>'make-object-property' uses that under the hood
<wleslie>garbage collection doesn't enter into it. if you create the tuple '(foo bar) more than once, it won't be the same object, so it won't be the same in hashq.
<wleslie>(eq? (cons 'foo 'bar) (cons 'foo 'bar))
<random-nick>TIL that Guy L. Steele Jr. worked with RMS on Editor MACroS
<paroneayea>datagrok_: glad you like it! mostly I think wisp is cleaner/simpler than sweet expressions
<taylan>+1
<mejja>Please...
<b4283>Listen to me
<jmd>ACTION Finallly realises the bug in guile-ncurses which causes random crashes.
<wleslie>ACTION Segfault (core dumped)s
<mejja>a bugfix a day keeps the m-x doctor away
<mejja>Chez scheme is wicked fast...
<jmd>mejja: The question is can one fix the bugs faster than getting caught by them!
<random-nick>have you guys figured out why is guile-ncurses larger than ncurses?
<mejja>random-nick: it adds stuff?
<random-nick>mejja: yeah, but guile-ncurses doesn't include any ncurses functionality, it depends on ncurses
<davexunit>random-nick: if it depends on ncurses then it by definition will have a larger closure size.
<jmd>davexunit: He means the LOC
<random-nick>davexunit: LOC
<davexunit>random-nick: wrappers and things can add up.
<davexunit>but I have never seen the code.
<random-nick>davexunit: without counting any dependencies, guile-ncueses has more LOC than ncurses
<davexunit>anything statistic measured in LOC is suspect to me.
<random-nick>davexunit: http://git.savannah.gnu.org/cgit/guile-ncurses.git/tree/
<davexunit>I shouldn't have said anything. I thought this was #guix.
<jmd>davexunit: lol! Yeah complaining about large loc in #guile not a good idea!
<davexunit>ah guile-ncurses is one of those old libs written exclusively in C.
<jmd>davexunit: Nothing wrong with that. However it makes a lot of implicit assumptions that object B always survives object A.
<jmd>If those assumptions don't hold then bad things happen :(
<davexunit>:(
<davexunit>if the bindings were written in Guile then there wouldn't be GC issues
<jmd>You may be right.
<davexunit>you have to be careful when programming in C to make sure your objects are visible to the boehm gc
<peterbrett_work>The compile-time lifetime analysis is one of the nice things about Rust
<peterbrett_work>It would be pretty cool if the Guile compiler could do that to a limited extent (to help with mem optimisation)
<davexunit>peterbrett_work: this is orthogonal to the guile compiler
<peterbrett_work>Indeed
<peterbrett_work>When I look at guile-ncurses I think "This needs a rewrite in Guile using FFI" ;-)
<davexunit>guile 2.2's compiler does do certain optimizations by analyzing effects
<wleslie>region and effect disciplines are closely related
<random-nick>wow the bootstrap compiler is slow
<mark_weaver>random-nick: that's because the compiler has not yet been compiled
<mark_weaver>the interpreter is running the compiler while it compiles itself, essentially
<random-nick>isn't the bootstrap compiler a compiler written in C?
<mark_weaver>whereas many other language implementations these days don't even bother trying to bootstrap from source, and require that you download a binary version of their compiler
<mark_weaver>random-nick: no
<mark_weaver>random-nick: guile's compiler is written in guile
<random-nick>mark_weaver: yeah but isn't the bootstrap one written in C
<random-nick>or is it an interpreter
<peterbrett_work>mark_weaver: Even C language implementations require you to have a C compiler around! It's dreadful!
<mark_weaver>random-nick: you asked a question and I answered "no". I don't want to answer it again
<mark_weaver>there's no compiler written in C in guile
<random-nick>why can't guile detect for a guile on the system with autoconfigure?
<mark_weaver>it's possible to use an existing guile to compile guile, but only if it's the exact same version
<mark_weaver>anyway, I have to go afk
<peterbrett_work>N.b. I've found that it's important that it's the same version _compiled with the same options_
<random-nick>can't 2.0 for example compile 2.0.11?
<mark_weaver>random-nick: no
<random-nick>is the bytecode changed a lot?
<peterbrett_work>I don't know why it is exactly, but mark_weaver or wingo would be able to explain.
<peterbrett_work>Anyway, it's a bit of a moot point: you _must_ compile the compiler with the same version of the compiler.
<wingo>i wrote a blog post about this issue :) https://wingolog.org/archives/2016/01/11/the-half-strap-self-hosting-and-guile
***sbp_ is now known as sbp
<dsmith-w`>Morning Greetings, Guilers
***dsmith-w` is now known as dsmith-work
<akkad>ACTION hunts for a guile example in Makefile that is not totally mutalated
***dje is now known as xdje
<stis>ACTION is working to get persistance working - almost there to get continuations stored on disk
<cojy>stis: continuations can be serialized???
<stis>well my continuations can, but I'm working with logic programs, those are a little different
<stis>not less powerful, but I control them on the side.
<cojy>oh i was thinking guile had some hidden serialization stuff i never found nevermind
<stis>I serialize quite a lot of guile objects but you need c code that grovel in them and this is for the brave one. all else need to wait for an official interface
***ozzloy_ is now known as ozzloy
<stis>yeah got the persistance working, check out
<stis> http://paste.lisp.org/display/315218
<stis>ACTION constantly fight against bitrottening
<random-nick>nice
<random-nick>how close is prolog to lisp?
<random-nick>s/lisp/scheme/g
<stis>Very different I would say, the ideomatic way to solve problems is very different.
<stis>but in some sense it is also close in that iteration is based on recursion
<stis>And prolog backtracks e.g. can undo state you enter.
<stis>which yuo solve by programming functionally in scheme
<stis>anyway the backtracking property means overhead and prolog programs are a bit slow in my experience.
<stis>the simplest example where scheme and prolog differens is that building a list can be done by enlarging at the end and not do the cons and reverse dance
***mjl_ is now known as mjl