IRC channel logs


back to list of logs

<mwette>convention in unix/c is to return 0 on success (and often -1 on error)
<daviid>mwette: thank you
<daviid>lloda: thanks. I see, but quite honestly, I actually (much) prefer the approach I came up with, since the code is a lot shorter, cleaner imo, with no alloc at all on the C side ... but again, thanks for your ideas and example. The only convcern I had was to grab the pointer address size at run time, which I beleive I solved with this snipset
<daviid>size_t pointer_address_size_c ()
<daviid> size_t n = sizeof(float *) * CHAR_BIT;
<daviid> return n;
<daviid>mwette: is size_t any diff from int in C?
<mwette>daviid: can be
<daviid>ok, I'll stick to it then
<mwette>on my mac/x86_64, sizeof(int)=4, sizeof(size_t)=8
<daviid>thanks for this clarification
<happy_gnu[m]>I don't understand how to use http-get
<happy_gnu[m]>if i do (http-get "")
<happy_gnu[m]>I get
<happy_gnu[m]>ERROR: ERROR: Wrong type to apply: ""
<daviid>it seams this is not a valid http address
<happy_gnu[m]>but what is a valid address? :/
<daviid>i get an error trying to open the site in a browser ... I get http-get <my web site>) with no error ...
<daviid>scheme@(guile-user)> (http-get "")
<daviid>ERROR: In procedure getaddrinfo:
<daviid>ERROR: In procedure getaddrinfo: Name or service not known
<daviid>try another site ...
<daviid>I'm not (by no ean) an http guy by the way, just trying to help ...
<happy_gnu[m]>I know daviid :)
<daviid>so, try another site
<happy_gnu[m]>I did with
<happy_gnu[m]>I get the same error :/
<happy_gnu[m]>(http-get "")ERROR: ERROR: Wrong type to apply: ""
<daviid>scheme@(guile-user)> (http-get "")
<daviid>$8 = #<<response> version: (1 . 1) code: 200 reason-phrase: "OK" headers: ((date .…>
<daviid>$9 = "<!DOCTYPE html PUBLIC \\"-//W3C//DTD XHTML 1.0 Strict//EN\\" \\"http://www.w3.o…"
<daviid>just as an example ...
<happy_gnu[m]>ohh thansk!
<daviid>this is sing ""
<happy_gnu[m]>daviid: is working now :)
<happy_gnu[m]>now I have to learn how to output that to a file or something ahah
<mwette>I get code 301 from
<artyom-poptsov1>Oh wait, I was wrong: there's a chapter named "(guile) GOOPS Object Miscellany" in the manual where's object equality is discussed, including 'equal?' overloading. I just overlooked it for some reason.
<amz3>funny this search, returns nothing instead of an error:
<amz3>I mean in theory it should return every document that do not contain 'duckduckgo' but in pratice it's easy to compute, so it should be an error
<amz3>it's not easy to compute
<amz3>it's easy to compute but it will take a lot of ressource
<amz3>also if there is no positive tokens in the query, you can not score the results
<amz3>what is best in terms of performance: to keep the computation exact until the end or use inexact numbers from the beginning \\cc ArneBab_
<ArneBab_>manumanumanu: well, that sounds cool!
<ArneBab_>amz3`: that depends on the size of the problem. If exact numbers can handle it, I’d stick with them (because they are exact), but exact fractions can baloon in memory consumption.
<amz3`>ArneBab_: tx
<ArneBab_>amz3`: if you want real big data stuff, you might want to adjust your algorithms to do optimized operations, like operating on the logarithm of the values to turn every multiplication into a plain (and much faster) addition.
<ArneBab_>(I only saw that being done and know in theory how to do it, but I don’t have much real-life experience in doing that with Guile)
<amz3`>ArneBab_: oh, I did not know about that trick
<amz3`>ArneBab_: anyway, it's just to have an idea, it's very early in the project, I don't think optimising right now is a good idea
<ArneBab_>I knew about the possibility in theory, but seeing it done in practice to speed up an algorithm by factor 1000 was something else :)
<amz3`>I need to unit test the querying part of my search engine and then I will be *almost* ready for a demo
<amz3`>hopefully it will be finished today
<amz3`>so mescc is in guix pipes
<janneke>amz3`: guix pipes?
<amz3`>#guix mentioned mescc
<amz3`>I am not sure for what purpose
<thomassgn>I apparently don't understand how to get the output from a system command...
<thomassgn>trying this: (with-input-from-port (system "ag -l guile /home/thomas/bin") (lambda () (display (read-line )))) But keep getting the error:
<thomassgn>ERROR: expected an input port 0
<thomassgn>I thought 'with-input-from-port' would set the output of command to current-input-port...?
<thomassgn>(obviously it does not... )
<amz3`>thomassgn: try with open-pipe
<amz3`>thomassgn: if doesn't work use open-process
<thomassgn>amz3`: great, thanks.
<mwette>thomassgn: open-input-pipe
<amz3`>I made good progress, /me need to fix the UI now
<amz3`>but I will do this another day
<janneke>amz3`: mescc is part of mes, which goal is to replace GuixSD's bootstrap binaries with a full source bootstrap path
<cbaines>I'm pretty sure that something in my Guile code is wrong, but Guile says the crash happened in ice-9/eval.scm...
<cbaines>ice-9/eval.scm:155:9: ice-9/eval.scm:155:9: In procedure struct_vtable: Wrong type argument in position 1 (expecting struct): #<unspecified>
<cbaines>Is there a way to get some more specific information about where the error occured?
<mwette>try "guild compile -O0" on the file then run
<amz3`>fwiw the code of culturia is @
<amz3`>sneek: what is culturia
<sneek>Its been said that culturia is a search engine
<cbaines>mwette, thanks, I ended up running the code directly from the REPL, which seemed to give a better backtrace
<janneke>do we have a guile-2.2 specific cond-expand?
<janneke>ACTION is having troubles with disabling an ellipsis macro for 2.0 only
<janneke>hmm, it seems i cannot disable with-ellipsis test for guile-2.0 :-(
<janneke>no guile-2-2 cond-expand
<civodul>janneke: is "guile-2.2"
<janneke>a string, where guile-2 is a symbol?
<janneke>ah, the dot
<janneke>civodul: perfect!
<janneke>removed ugly sh scripting again and better psyntax with/without ellipsis test for mes :-)