IRC channel logs

2017-03-05.log

back to list of logs

<daviid>spk121: but how do i 'cast to int'
<spk121>daviid: i don't know how to do that in FFI.
<daviid>spk121: so just using libguile won't work for this case then
<daviid>spk121: could you kindly paste the 'all story', tell me how to compile it (if specal options, then I'll try that
<spk121>daviid: there really ought to be a fast round to integer procedure in core Guile. It is a common operation.
<daviid>spk121: yes, it would be a must!
<spk121>daviid: something like this https://github.com/spk121/libguile-math
<daviid>spk121: thanks!
<daviid>spk121: instead I could make things based on your work, but so i use the dynamic ffi
<daviid>but anyway, thanks a lot
<daviid>spk121: just cloned, it fails here, let me paste the erros
<daviid>spk121: here http://paste.lisp.org/+7AS6
<spk121>daviid: huh. try replacing (scm_t_inum) with (long)?
<daviid>spk121: that seems to work
<daviid>spk121: does chop stands for ...?
<spk121>daviid: chop = truncate, sorta. It is not my best work. ;-)
<daviid>spk121: i see. i see you tired (define C (map (lambda (x) (numerator (rationalize x 0))) nums))
<daviid>* tried
<daviid>spk121: so, i went ahead an wrote a terrific C function:
<daviid>int floattoint (float f)
<daviid>{
<daviid> int i;
<daviid>
<daviid> i = (int)f;
<daviid> return (i);
<daviid>}
<daviid>
<daviid>and used the dynamic ffi instead, float->int just born :). of course I'm ot a pure schemer anyore and will go to hell I guess :):)
<adhoc>what is the aim? to truncate the fractional component?
<daviid>this binding makes it a 0.15 sec win, compared to inexact->exact, while processing a f32vector of 521000 cells moreless (which in the world of digital image processing is a very small image still), which means 14% faster (Iwas hoping more, but I'll take the 14%)
<daviid>adhoc: yes, see the log if you are interested, I've been talking here about this since yesterday, with the great help of spk121
<daviid>now I need to change my autotool files to (a) get this compiled installed and (b) understand how it works for make check (before installation, how do we tell guile to find the lib ...)
<daviid>never did this before
<adhoc>daviid: sometimes speed is paramount, especially when doing many, many iterations
<adhoc>i was wondering if something else like floor() would be faster?
<adhoc>daviid: is the aim to keep the float or do you need to move to int?
<daviid>adhoc: to move to int, as you did read/see in the snipset I pasted
<daviid>what inexact->exact does
<adhoc>ah ok
<amz3>So, the racket sat solver is now free software and it has a test suite https://github.com/Kraks/SAT.rkt/
<amz3>it seems like now I have a working sat solver. I am using the same test suite as SAT.rkt
<amz3>it's slow...
<amz3>with 3000 '(or foo bar)
<amz3>I need to fetch all the results not only the first result it finds
<amz3>I am wondering which continuation style I should use for that
<amz3>I am not even sure I understand the problem
<amz3>here is the code https://framagit.org/a-guile-mind/culturia.one/blob/guildhall/src/sat.scm
<amz3>basically I want solve procedure to compute all the solutions S of the given PROBLEM.
<amz3>Right now at L98, there is `or' statment that does try the other branch of the subtitution to see if there is good result
<amz3>IIRC that's the only branching done in the solution space
<amz3>IIUC or whatever
<amz3>it instead of doing: (or substitution-one substitution-two)
<amz3>I'd like to retrieve the results of both branches
<amz3>looks like what I want to do https://epsil.github.io/gll/#continuation-passing-style
<amz3>python for bigdata overview http://www.xmind.net/m/WvfC#515
<wleslie>it's a big ecosystem
<stis>hej guilers!
<wleslie>hello(Stis)?
<stis>:-)
<stis>symbol scm_assert_cell_valid, version GUILE_2.0 not defined in file libguile-2.2.so.0 with link time reference
<stis>any ideas?
<stis>ahh, need to remove the compiled lib in extension dir
<stis>ACTION is working with c-lambda again.
<stis>intend to make a better version of it and add docs
<ArneBab>sneek later tell daviid guildhall also failed for me on 2.1.x, but I did not see how to fix that :( — it works for 2.0
<sneek>Okay.
<ArneBab>amz3: culturia.one looks awesome!
<ArneBab>amz3: why do you use by-nc-sa instead of by-sa? (by-sa is GPLv3 compatible)
<ArneBab>sneek: botsnack
<sneek>:)
<amz3>ArneBab: ok i didn't know that
<amz3>tx
<hiphish>Hello. I'm trying to write a 'zero?' predicate for a '<vector3>' class, but I am having trouble.
***hiphish is now known as HiPhish
<HiPhish>The predicate is '(define-method (zero? (v <vector3>)) (and (zero? (get-x v)) (zero? (get-y v)) (zero? (get-z v))))
<HiPhish>This should be simple enough: a vector is zero if all of its components are zero. But when I try using the vector module Guile complains that there is no generic 'zero?' for numbers.
<HiPhish>What is weird is that I was able to define a component-wise '+' method for vectors just fine. Am I missing something here?
<wingo>hi HiPhish
<HiPhish>Hello wingo
<wingo>which guile version?
<HiPhish>I built from HEAD a few days ago.
<HiPhish>wingo: It says 6fff84d in my package manager, so that might be the hash of HEAD.
<wingo>ok. i think you have found a bug; something early in the compilation process expands out zero? to (= x 0) :/
<wingo>which is probably not the right thing.
<wingo>i think 2.0 has this problem too fwiw
<HiPhish>wingo: OK, I will replace the component-wise 'zero?' with '(= 0 ...)' until it's fixed. I wasn't sure if that was a bug or intended behaviour, that's why I thought it would be best to ask first.
<wingo>would you mind sending a note to bug-guile with the problem? that way we won't forget
<HiPhish>wingo: Is that a mailing list like guile-users?
<wingo>HiPhish: sorta! it is a list managed by a bug tracker
<wingo>you don't have to be subscribed
<wingo>sending a mail to bug-guile@gnu.org makes a new bug and gives it a number
<wingo>replying to that mail will add comments on the bug as it cc's NNNN@debbugs.gnu.org, where NNNN is the bug number; the bug has its own email address
<amz3>ArneBab: I started working on guildhall but then got diverted, did you see http://guildhall.hypermove.net/
<wingo>then eventually when it is closed someone will mail NNNNN-done@debbugs.gnu.org and that will close the bug
<HiPhish>wingo: OK, I'll do that. Thank you.
<wingo>tx & happy hacking :)
<amz3>people started using guildhall.hypermove.net actually
<amz3>except I don't know how to continue
<amz3>I could try to debug guildhall for 2.2... that would be a good start
<amz3>here is the error I have http://dpaste.com/2VR6TK5
<amz3>unbound variable: =>
<amz3>but there is no mention of => in the file
<wingo>amz3: i suspect you are hitting this problem:
<wingo>** Fix literal matching for module-bound literals
<wingo>
<wingo>`syntax-rules' and `syntax-case' macros can take a set of "literals":
<wingo>bound or unbound keywords that the syntax matcher treats specially.
<wingo>Before, literals were always matched symbolically (by name). Now they
<wingo>are matched by binding. This allows literals to be reliably bound to
<wingo>values, renamed by imports or exports, et cetera. See "Syntax-rules
<wingo>Macros" in the manual for more on literals.
<wingo>or rather, guildhall plays fast and loose with the binding of =>
<wingo>in cond, etc. dunno tho
<amz3>it's as if => was not imported
<amz3>actually it appears in a foof-loop and cond
<wingo>i think r6rs defines it, guile core doesn't
<wingo>so if code is matching on => from r6rs, a => that isn't that binding won't match
<amz3>if I import the foof loop module found in guildhall in a guile REPL and paste some foof loop it works
<amz3>maybe it's related to r6rs module because all guildhall use that
<wingo>dunno. just saying, if you are porting things to 2.2 be sure to read NEWS closely :)
<wingo>of course you may have found a bug in guile somewhere too; that's possible
<amz3>tx!
<amz3>btw I tried to review stuff on guile-devel but I wasn't much interested by that particular contribution
<amz3>it was about getting an abstraction to validate inputs and outputs in ffi
<amz3>by inputs and outputs I mean function arguments and return value
<daviid>heya! happy sunday
<sneek>Welcome back daviid, you have 1 message.
<sneek>daviid, ArneBab says: guildhall also failed for me on 2.1.x, but I did not see how to fix that :( — it works for 2.0
<daviid>wingo: gentle ping, did had a chance to look at my guile-devel email https://lists.gnu.org/archive/html/guile-devel/2017-02/msg00076.html ?
<amz3>sorry for messing with whitespace cleanup in my last patch to debbugs
<amz3>I should have checked the diff once more
<amz3>daviid: I had a look at the bug in guildhall but the bug seems to be in a heavy macro area of the code. It seems like the loop macro from foof-loop doesn't understand that => is a keyword
<amz3>I mean I stumble on this error when I comment the guard that catch the error...
<daviid>amz3, ArneBab, you two can solve it! :) good luck!
<amz3>ahah
<amz3>OrangeShark: did you see this bug https://github.com/waylan/Python-Markdown/issues/551
<wingo>daviid: not yet, tx for ping
<daviid>wingo: ok, I cross my fingers then :)
<amz3>someone remembers the name of the package manager for guile that is not guildhall that was released on guile-user a few month back?
<amz3>I found an chap photo here → https://www.gnu.org/software/guile-rpc/guile-logo.png
<amz3>that's the project i was looking for https://github.com/plande/compan
<OrangeShark>amz3: No I have not seen that bug. Doesn't seem like an issue for my implementation.
<amz3>catonano: what's up? I see you did some commits to your project recently
<amz3>I think I will fork compoan for use in guildhall