IRC channel logs

2016-01-21.log

back to list of logs

<austrinus>is there anywhere that has the documentation for the scheme language in guile?
<austrinus>i tried just using general scheme docs, but it seems some functions (like reduce) are not implemented
<holomorph>guile has a reference manual
<austrinus>i looked through that. it didn't seem to have the listed core scheme functios
<mark_weaver>austrinus: what's an example of a core function that you didn't find there?
<paroneayea>austrinus: try reading r5rs
<paroneayea>if you want a compact document explaining what might be "core" scheme
<paroneayea>notice the "might" :)
<paroneayea>illuminating read, though!
<austrinus>paroneayea: r5rs is just what I needed. thanks
<mark_weaver>reduce is not part of r5rs though
<mark_weaver>reduce is part of SRFI-1
<austrinus>is map part of r5rs?
<mark_weaver>yes
<paroneayea>austrinus: yes you will also find the SRFI documents useful probably
<paroneayea>they're interesting to read
<paroneayea>but they aren't core scheme
<paroneayea>to the extent such a thing exists ;)
<paroneayea>(okay maybe that last sentence is taking things too far!)
<frofroggy> austrinus: reduce is In the Guile Manual (2.0.9 dunno about latest), API Reference > Compound Data Types > Lists > List Mapping contains a note linking to SRFI-1 Fold and Map, which documents the reduce procedure.
<frofroggy>(I too should upgrade from the Ubuntu's older distribution of guile!)
<mark_weaver>there's a procedure index in the manual.
<mark_weaver>and info readers typically have a command to search the index. in the emacs' info reader, you just type 'i' and then "reduce" and return, and it will bring you to the relevant section.
<austrinus>mark_weaver: i saw that section in the manual
<austrinus>however, i don't think that the implementation of guile scheme we're using has reduce defined
<austrinus>so i was looking for docs that were appropriate for the implementation we're using
<mark_weaver>austrinus: what version of guile are you using?
<austrinus>the r5rs commands that i've tried have all worked, so i'm convinced that's what it is
<austrinus>1.8.7
<mark_weaver>austrinus: you need to (use-modules (srfi srfi-1)) to get reduce
<mark_weaver>austrinus: oh, that's ancient. you should update to guile-2.0.x
<austrinus>if i could, i would
<mark_weaver>we haven't supported 1.8.x in years.
<austrinus>it's for a class. i don't have root access
<austrinus>so i have to make due with the old tech they have
<mark_weaver>you don't need root access to build guile from source and run it
<austrinus>true
<austrinus>but they're going to test the code i write against the system's 1.8.7 version
<mark_weaver>just set --prefix=/home/foo/local or something like that
<austrinus>so they'll dock me if i use things from a newer version
<mark_weaver>that's a damn shame :-(
<austrinus>tell me about it.
<austrinus>it's extremely frustrating
<mark_weaver>what class is this? what school?
<austrinus>Programming Paradigms
<austrinus>at Uni Notre Dame
<mark_weaver>okay, well, I'm fairly sure that guile-1.8.7 has SRFI-1 as well. you just need to load it first.
<mark_weaver>(use-modules (srfi srfi-1))
<austrinus>we're doing guile scheme as part of the functional language paradigm
<austrinus>part of the class
<mark_weaver>well, I'm glad that they're teaching guile at least :)
<austrinus>awesome that worked!
<austrinus>cool
<mark_weaver>yay :)
<austrinus>so now i have reduce
<austrinus>et al
<austrinus>thanks
<mark_weaver>I use SRFI-1 in almost every piece of code I write.
<mark_weaver>can't live without it :)
<austrinus>do you script with it?
<austrinus>i wanted to try to get a hang of the language by trying out some scripting, but it seemed difficult
<mark_weaver>I'm one of the Guile maintainers, and I also work on GNU Guix which is written in Guile.
<mark_weaver>Guile is my preferred language for most purposes
<austrinus>very cool
<mark_weaver>except for rare cases where I need the efficiency of C.
<austrinus>it's my second time learning a Lisp style language
<austrinus>big fan
<austrinus>hard to get others to adopt
<mark_weaver>what was your first Lisp style language experience?
<austrinus>Clojure
<mark_weaver>ah yes, lots of good ideas there too.
<austrinus>it was the minimization of state that brought me in the first place
<mark_weaver>excellent! many of us here, including me, prefer to write in functional style whenever feasible.
<mark_weaver>feel free to ask questions as they arise.
<austrinus>will do. thanks again
<mark_weaver>I have to go afk for a while. happy hacking!
<austrinus>see ya around :)
***DeeEff_ is now known as DeeEff
***petercom1and is now known as petercommand
<wingo>meep
<peterbrett_work>?
<wingo>ACTION just making sounds
<civodul>hello!
<peterbrett_work>:)
<peterbrett_work>I discovered file-system-fold in Guile 2 yesterday
<peterbrett_work>It's really nice :)
<civodul>heh :-)
<peterbrett_work>The only way it would be nicer is if you could pass #t instead of do-nothing procedures
<civodul>you can pass (const #t)
<peterbrett_work>No you can't — the do-nothing procedures need to return their third argument (fold, remember)
<civodul>right
***nalaginrut_ is now known as nalaginrut
<davexunit>I really like this "box and cat" diagram of lisp lists. https://pbs.twimg.com/media/B2gIGShCYAE7IUw.jpg
<davexunit>(cons 'cat (cons 'cat '()))
<mark_weaver>heh, yeah, that gave me a laugh :)
<mark_weaver>you used that in your presentation yesterday, didn't you?
<davexunit>yes
<davexunit>just had to
<mark_weaver>:)
<davexunit>a few people there had lisp experience and enjoyed it.
<amz`>funny
<amz`>did anyone watch 'om next by david nolen' ? https://www.youtube.com/watch?v=MDZpSIngwm4
<amz`>if yes, what the transaction are about?
<amz`>maybe I could ask on #clojure :)
<amz`>sorry
<amz`>fwiw apparently it's "applying change to the state"...
<davexunit>so I finally picked up "The Little Prover" last night since I happened to walk right past the MIT Press shop.
<davexunit>I've barely been able to even open the cover but just reading "The Insights" (like the commandments from "The Little Schemer") on the inside cover has me excited.
<xyh>is it true that 'hashq-ref' uses 'equal?' and 'hash-ref' uses 'eq?' ?
<amz3>xyh: why do you ask?
<xyh>because I use list as key
<civodul>xyh: it's the opposite
<xyh>thx civodul
<civodul>try running: info "(guile) Hash Table Reference"
<xyh>I should have readed the doc more carefully
<civodul>or: info -k hashq-ref
<xyh>is there a function 'void' to let a function do not returns #<unspecified>
<xyh>* does not return
<ArneBab_>davexunit: I finally ordered The Little Prover yesterday — after finishing the final examination for my PhD last friday :)
<davexunit>ArneBab_: congrats on finishing your PhD!
<ArneBab_>thank you :)
<ArneBab_>I took my first vacation in month (for today and tomorrow) and promptly got sick :)
<amz3>xyh: no
<amz3>xyh: you must return something
<amz3>xyh: sorry for asking earlier, I am also confused about which is which, I wanted to be sure you did not do a mistake...
<amz3>congrats ArneBab_ :)
<ArneBab_>thank you :)
<xyh>I have just added a guile version of this :: https://github.com/cicada-language/threaded-code-interpreter/tree/master/native-array-memory/guile
<xyh>:)
<amz3>xyh: why does it bothers you that procedure returns #<unspecified>
<xyh>amz3: not a matter anymore, some other interpreters print the returned values, so I asked.
<amz3>hmm
<amz3>I read something about forth some time ago, it's really inspriring
<amz3>IIRC it use useful to pilot embedded devices or at least create drivers
<amz3>the story was about a person, who built a forth from scratch and was using it in every professional project he was doing
<xyh>I do this repo just for fun. it is simple, just 200+ lines of guile :)
<xyh>can be used to implement something like the '->' macro of clojure
<xyh>and be different from the clojure macro (because one can do more forth-like things with it)
<xyh>the new site is beautiful, by the way.
<xyh>it would be even better if the documentation page is updated too.
<civodul>wingo: the unboxing post is very pleasant & didactic
<civodul>and indeed, it's going to change what we program
<davexunit>I'm hoping it allows me to remove a dependency on GSL for Sly
<davexunit>no more BLAS for matrix multiplication
<civodul>BLAS is efficient for other reasons too
<davexunit>civodul: in my case it's waaaay overkill.
<davexunit>a 4x4 matrix multiplication loop can just be unfolded.
<civodul>ooh, indeed!
<civodul>BLAS for a 4x4 matrix is overkill :-)