IRC channel logs

2015-04-04.log

back to list of logs

<cmhobbs>couple of questions: is there a package ecosystem for guile and is there a testing framework available?
<cmhobbs>a better second question might be how does one write tests in guile
<mark_weaver>SRFI-64 supports Guile. It comes with Guile 2.0.11, but you can also get the reference implementation which should work with any version of Guile.
<mark_weaver> http://srfi.schemers.org/srfi-64/
<cmhobbs>wonderful, thanks!
<mark_weaver>there are many packages available for Guile
<mark_weaver>but we don't really have a central directory of them
<mark_weaver>if you are looking for something in particular, web searches may find them, or you can ask here
<mark_weaver>there's something called guildhall which allows easy installation of some useful pure-scheme libraries
<mark_weaver>sneek: guildhall?
<sneek>Someone once said guildhall is https://github.com/ijp/guildhall/wiki/Getting-Started
<cmhobbs>great!
<cmhobbs>i'm embarking on a new commercial project and at this point i'm trying to decide between racket and guile
<cmhobbs>i'm kind of weighing that on ease of testing and package options
<mark_weaver>what kind of project?
<mark_weaver>(if I may ask)
<cmhobbs>sure
<cmhobbs>it'll all be released as free software anyway
<mark_weaver>cool!
<cmhobbs>i'm in the nascent stages of building an adapter and a set of plugins that will talk to one of our message queues and then pass signals to any given mta
<cmhobbs>the adapter will exist as one project
<cmhobbs>then i'll build plugins for different mtas
<cmhobbs>for whatever reason, i've had trouble picking a language
<cmhobbs>most of our stuff is being built in golang but i've done a few paid projects in it and procedural just isn't my style
<cmhobbs>ruby pays my bills and i think of adapters/plugins in an object oriented nature
<mark_weaver>heh :)
<cmhobbs>but i feel like the flow could go better with a functional approach
<cmhobbs>anyway, language soup
<cmhobbs>i nailed it down to a scheme, so i'm trying to pick between guile and racket at this point
<mark_weaver>okay
<cmhobbs>i've written a lot of guile but never did any testing
<cmhobbs>and i haven't used any packages
<cmhobbs>well, i've written a lot of sloppy guile
<cmhobbs>it's safer to say
<cmhobbs>much of my home network management stuff is a collection of gross guile
<cmhobbs>so i guess i've not really written guile so much as used it as a sledgehammer to automate some stuff
<mark_weaver>*nod*
<mark_weaver>well, based on what you've said, I guess that either guile or racket could do the job well
<cmhobbs>therein lies the problem :D
<cmhobbs>i'm not sure what advantages one has over the other
<cmhobbs>guile seems closer to the SFRIs to me
<cmhobbs>so i dig that
<cmhobbs>racket packages seem to have some sort of CI setup, so it seems like that could be beneficial if i could do the same for our project
<mark_weaver>CI ?
<cmhobbs>i've never written a single line of racket but i've used guile so i've got a leg up there
<cmhobbs>continuous integration
<cmhobbs>they have stuff that shows whether the builds pass
<cmhobbs>i also like how close to gnu and the fsf guile is
<mark_weaver>ah yes
<mark_weaver>GNU Guix, which is based on Guile, has a continuous integration system for all Guix packages.
<cmhobbs>i use guix as a package manager on my machine
<mark_weaver>we could add guile packages of interest to Guix, and then it would be covered by that continuous integration
<cmhobbs>on wheezy
<mark_weaver>ah, nice!
<cmhobbs>haven't used it as an os yet
<cmhobbs>i'm reticent to move off wheezy because that takes effort :D
<mark_weaver>I've been using GuixSD on my primary laptop for several months now.
<cmhobbs>wow
<cmhobbs>how buggy is it?
<cmhobbs>or has a stable release been cut?
<davexunit>it's still alpha
<mark_weaver>it works well for me, although admittedly my needs are modest
<cmhobbs>are there any guile packages that will talk to a common message queue? something like 0MQ or a related one?
<cmhobbs>my needs are pretty modest as well. my primary rig is an asus eeepc x101ch
<cmhobbs>1GB of ram, heh
<mark_weaver>there are certainly things that don't work right, but the rollback features mean that I don't ever have to deal with a broken system.
<cmhobbs>i have plans to look at guix as my primary os. i really need to test it out more first
<davexunit>cmhobbs: I think I may have seen someone writing zeromq wrappers, no idea where they are or if they work
<mark_weaver>hmm, I have a vague recollection of something for 0MQ, although I don't trust my memory.
*mark_weaver looks
<cmhobbs>racket has support with net/zmq
<cmhobbs> http://zguide.zeromq.org/rkt:hwserver
<cmhobbs>it might be a bit cavalier but it doesn't seem like it would be terribly difficult to reproduce that for the subset of features i'd need
<mark_weaver> https://gitorious.org/guile-zmq
<mark_weaver>it's also mentioned here: http://zeromq.org/bindings:guile-binding
<cmhobbs>oh no! https://about.gitlab.com/2015/03/03/gitlab-acquires-gitorious/
<cmhobbs>i just noticed that
<cmhobbs>i'll need to move my code off gitorious, i guess
<cmhobbs>thanks for the links, these look great
<mark_weaver>yeah, it's terrible
<mark_weaver>cmhobbs: you're welcome. if you try it, I'd be curious to hear how well it works for you.
<cmhobbs>at this point, i'm leaning heavily toward guile
<mark_weaver>:)
<cmhobbs>mostly because of its proximity to gnu/fsf
<cmhobbs>but also because i kind of fear that racket is drifting from the SFRIs a bit
<cmhobbs>i don't know if that's a huge concern
<cmhobbs>but it just feels off
<cmhobbs>i think maybe racket is a little better documented but i've not yet run into a guile problem that i wasn't able to sort out
<cmhobbs>is there a recommended gitorious alternative out there? i haven't been connected on pump.io or gnu social for a few weeks now, so i've lost ties to the world here, heh
<cmhobbs>i guess that's a question for #fsf :D
<mark_weaver>cmhobbs: http://jxself.org/goodbye-gitorious.shtml
<cmhobbs>should've figured jason would have a plan :D
<mark_weaver>racket is a very nice system, but they definitely seem to be moving away from the rest of the scheme community, for better or worse
<cmhobbs>alright, one last question re: guile
<cmhobbs>how well does it handle network programming?
<cmhobbs>i'll need it to communicate with MTAs so i'll need to dive into that a bit
<mark_weaver>I'm not aware of any problems there. Guix does all of its networking in native guile, e.g. http and ftp clients
<cmhobbs>great
<cmhobbs>i lied!
<cmhobbs>one more question :D
<cmhobbs>is there a common styleguide so i don't write this gross stuff i've got at home
<cmhobbs>tips for structuring files in a project and for laying out your functions?
<cmhobbs>and sorry for all the questions
<mark_weaver>no worries, we expect questions here!
<mark_weaver>well, there's this: http://mumble.net/~campbell/scheme/style.txt
<mark_weaver>although it's mostly about formatting of code
<mark_weaver>we like to break code into modules
<mark_weaver>Guix is an example of a project that IMO is written in a good, modern style.
<cmhobbs>i've not looked at its source but that's a great idea for an example
<mark_weaver>here's some advice: learn about the (ice-9 match) module. it is portable and has greatly improved the code we write
<cmhobbs>i think i've used that maybe
<cmhobbs>i'll look into it
<mark_weaver>I'm afraid that the docs in our manual are not very complete. there are more docs in the comments of the code, in module/ice-9/match.upstream.scm
<mark_weaver>e.g. in modern times we usually prefer to avoid using 'car' and 'cdr' directly. the 'match' macro generates very efficient code, so there's no speed penalty to using it.
<cmhobbs>most of my knowledge of guile came from the info pages available through emacs
<cmhobbs>what is ice-9?
<cmhobbs>that sounds really really familiar
<mark_weaver>many of the guile modules are in a directory called ice-9
<mark_weaver>sneek: ice-9?
<mark_weaver>I don't remember if we taught sneek about ice-9. I guess now
<mark_weaver>I guess not
<cmhobbs>various permutations of ice-9 and development/programming/lisp/etc. are just turning up rap artists and video games on duckduckgo
<cmhobbs>heh
<mark_weaver>there's some explanation of the ice-9 name here: http://wingolog.org/archives/2009/01/07/a-brief-history-of-guile
<mark_weaver>ice-9 is "a nod to the fictional substance in Kurt Vonnegut's novel, Cat's Cradle, capable of acting as a seed crystal to crystallize the mass of software"
<cmhobbs>ah, Vonnegut
<cmhobbs>right
<cmhobbs>that's why it sounds familiar
<mark_weaver>sneek: ice-9 is "a nod to the fictional substance in Kurt Vonnegut's
<mark_weaver> novel, Cat's Cradle, capable of acting as a seed crystal to
<sneek>So noted.
<mark_weaver>bah
<mark_weaver>sneek: forget ice-9
<sneek>Consider it forgotten.
<mark_weaver>sneek: ice-9 is "a nod to the fictional substance in Kurt Vonnegut's novel, Cat's Cradle, capable of acting as a seed crystal to crystallize the mass of software" <http://wingolog.org/archives/2009/01/07/a-brief-history-of-guile>
<sneek>Okay.
<mark_weaver>sneek: ice-9?
<sneek>ice-9 is "a nod to the fictional substance in Kurt Vonnegut's novel, Cat's Cradle, capable of acting as a seed crystal to crystallize the mass of software" <http://wingolog.org/archives/2009/01/07/a-brief-history-of-guile>
<mark_weaver>sneek: botsnack
<sneek>:)
<cmhobbs>i think i've settled on guile for at least the initial prototype of this project. if it gets too painful, i can always look into racket
<cmhobbs>is sneek an infobot or a port of an infobot?
<mark_weaver>okay, feel free to ask questions here as they arise
<cmhobbs>thanks a ton!
<mark_weaver>sneek: version?
<sneek>Sneeky bot running on Guile version 2.0.11 using bobot++ 2.3.0-darcs
<mark_weaver>cmhobbs: you're welcome. happy hacking!
<cmhobbs>wow, darcs
<cmhobbs>i haven't touched darcs in ages
<mark_weaver>I remember thinking it sounded interesting, but never used it
<cmhobbs>i used to use ion3 ad they used darcs
<cmhobbs>s/they/he
<cmhobbs>tuomo
<cmhobbs>yeah, i've been locked into git since i left svn
<cmhobbs>well, i didn't use svn long. i used cvs until the bitter end
<mark_weaver>heh :)
<mark_weaver>git is the only thing I use nowadays. the others I use only when I need to work with some other project
<cmhobbs>yeah, git appears to have pulled ahead
<mark_weaver>yeah
<cmhobbs>i use git daily at work so that's that
<cmhobbs>i can move between languages
<cmhobbs>moving between vcs's is a huge mental shift for me
<mark_weaver>yeah, I found git somewhat difficult to learn, but now I've paid that cost
<cmhobbs>i wish i could make the case for guile at my day job but we've got a small enough system that moving away from ruby doesn't make that much sense at this point
<cmhobbs>it's been pretty useful at home, even if the guile i've written is chaotic
<cmhobbs>my rationalization is that this pile of nonsense at home will never see the light of day
<mark_weaver>it's a tough sell for people who aren't already accustomed to lost of parentheses :/
<mark_weaver>s/lost/lots/
<cmhobbs>my team isn't lisp averse but we'd likely move to clojure before guile because of the popularity factor
<mark_weaver>sure
<cmhobbs>i used to write a lot of stuff in sbcl, guile seems to have less parens
<cmhobbs>or maybe that's my imagination
<cmhobbs>i like to think of the parens as the power emanating from my code! (((((((((( )))))))))
<mark_weaver>clojure has many good ideas around its data structures and concurrency model that we would like to import into guile at some point
<cmhobbs>i worry about clojure's scalability though
<mark_weaver>but I'm not fond of its syntax or its unhygienic macros
<cmhobbs>also, the last time i used it a lot of lispy features were missing
<cmhobbs>and the answer was 'drop to java'
<mark_weaver>bah
<cmhobbs>that may have changed more recently though
<mark_weaver>I have to go afk for a while. ttyl!
<cmhobbs>later!
<mark_weaver>cmhobbs: btw, I just noticed that guile-zmq was written by Andy Wingo, which bodes very well for it being competently written
<cmhobbs>very good to know, thanks!
<cmhobbs>i'll just have to figure out where it'll relocate to
<cmhobbs>what does a typical guile dev environment look like? is it mostly emacs?
<mark_weaver>emacs + geiser + paredit
<mark_weaver>paredit has a learning curve, but well worth the time to learn, imo
<mark_weaver>though it's a bit painful until you learn it well
<mark_weaver>gotta go afk again for a bit...
<cmhobbs>o/
<cmhobbs>can someone point me to docs on the compiler frontends?
<nalaginrut>cmhobbs: could you tell me why you want frontend docs? do you want to write a new frontend on Guile? ;-)
<cmhobbs>just curiosity
<cmhobbs>and i couldn't find the docs
<saul>nalagnirut, the first sentence of section 12 of http://www.gnu.org/software/artanis/manual/manual.html appears to have a typo (#:session should be #:cookies).
<mark_weaver>section 9.4 (Compiling to the Virtual Machine)
<mark_weaver>although note that everything below TreeIL has changed a *lot* in the master branch which will become Guile 2.2
<mark_weaver>and TreeIL itself has changed a little bit, but nothing too major
<saul>nalaginrut, even.
<mark_weaver>cmhobbs: ^^
<cmhobbs>rad, thanks
<cmhobbs>got it pulled up in info now :D
<nalaginrut>cmhobbs: oops! thanks for point out
<cmhobbs>nalaginrut, i'm happy to take credit for saul's findings
<nalaginrut>;-)
<nalaginrut>thanks saul
<nalaginrut>will be updated when 0.1 released
<nalaginrut>cmhobbs: I would recommend you read this article for basics frontend in Guile http://nalaginrut.com/archives/2014/04/15/simple%2C-but-not-so-simple
<cmhobbs>naboo, thanks a ton
<nalaginrut>np ;-)
<cmhobbs>hahaha
<cmhobbs>further misattribution
<cmhobbs>oh lordy it's been a long night
<paroneayea>hm, it's a bit surprising that there's no (define-method*)
<paroneayea>cmhobbs: btw I use smartparens instead of paredit
<paroneayea>it's like paredit, but less strict
<cmhobbs>is paredit just a paren matcher?
<paroneayea>cmhobbs: no
<paroneayea>cmhobbs: watch this
<paroneayea> http://emacsrocks.com/e14.html
<paroneayea>cmhobbs: ^^^
<cmhobbs>that's pretty amazing
<mark_weaver>I really don't know how I lived before paredit
<wleslie>this blog is AWESOME
***eMBee is now known as everyone
***everyone is now known as Guest62520
***Guest62520 is now known as eMBee
<jmd>I'm getting this error: [scm-error misc-error #f "~A ~S" ("no code for module" (ice-9 redelim)) #f]
<jmd>Do I have to install something special to get redelim ?
<mark_weaver>s/redelim/rdelim/
<paroneayea>redrum
<paroneayea>(ice-9 redrum)
*paroneayea not being helpful, making jokes, pay attention to mark_weaver :)
<mark_weaver>:)
<jmd>mark_weaver: Ahh thanks.
<mark_weaver>np!
*paroneayea was going to cleanly seperate his code into two nice modules today and then realized they both rely on each others' code
<paroneayea>into the same module they go :)
<please_help>I notice that around 40% of my runtime is dominated by array-copy!, probably originating from my array-ec. I tried removing the array-ec from my sigmoid function definition and using an array-index-map! instead, but the latter is a tiny bit slower actually. Is there a way to speed up array copying in general?
<jmd>How do I do "for i in *; do ... ; done" in guile ?
<ft>Something along the lines of opendir, readdir until eof-object? and closedir.
<daviid>jmd: 6.14.4 Iteration mechanisms, 6.7.2.8 List Mapping, SRFI-1 Fold and Map ...
<ft>I thought the major issue was the file system interaction. :)
<davexunit>jmd: the (ice-9 ftw) module has procedures for dealing with the file system
<daviid>jmd: see [in addition to davexunit suggetion] 7.2.3 File System
<davexunit>file-system-fold is handy
<daviid>sneek: guile-gnome?
<sneek>I've heard guile-gnome is at http://www.gnu.org/software/guile-gnome/
***karswell` is now known as karswell
<daviid>sneek: guile-clutter?
<nalaginrut>any one could remind me the proc to print error message in catch handler?
<jmd>Whats wrong with this code: (do ((x (read-line p))) (eof-object? x)
<jmd> (string-append str x))
<jmd>
<bipt>jmd, what do you expect it to do?
<please_help>He most likely expects this to append x to str unless it's eof, going over the port p. Of course, he forgot that string-append is pure, which is his problem.
<davexunit>yeah
<davexunit>a named let would be better for this
<davexunit>and you could do the fold
<davexunit>or, read the lines from the port and return a list of them
<davexunit>then pass it to 'string-concatenate'
<ijp>the other problem is that that there is only one set of parens around the test
<ijp>which means it is taking 'eof-object?' to be the code for testing when the loop ends, which as a function, is alway true
<please_help>Good point, so he would actually notice the infinite loop first, meaning that's the problem he was inquiring about really.
<please_help>is that how it works? do you receive infinite eof objects at the end of a stream?
<ijp>as far as eqv? is concerned, there is only one eof object
<ijp>which is returned every time you read from the port
<ijp>but the issue above is that the function is never actually called
<daviid>jmd: using do, which is fine: http://paste.lisp.org/+359K
<jmd>Thanks.
<please_help>yeah, but if you weren't returned infinite eof objects, you'd probably have an escape, or a crash, depending on the implementation.
<paroneayea>hello #guile
<paroneayea>wingo: mark_weaver: civodul: john replied via email to the guile and setting up a donation link thing
<paroneayea>I can answer one thing now -- We could definitely work with GNU Guile and I think that'd be cool. They should just contact me about it and I can explain the possibilities.
<paroneayea>so, email johns@fsf.org
<paroneayea>feel free to cc: me on it if you like, or not (cwebber@dustycloud.org if so)
<civodul>hey paroneayea, thanks for the quick and encouraging news!
<paroneayea>civodul: :)
<civodul>what was the "donation link thing" again?
<civodul>i remember discussing the web site mostly, but i guess i've been "dropping packets" lately
<paroneayea>civodul: ah, so there was some talk in here about getting a redesign of the guile website, and maybe compensating someone to do it
<civodul>ah ok
<civodul>i didn't get the second part
<civodul>sounds good
<paroneayea>maybe the guy who did the awesome new guix and guixsd logos? but if not, I know quite a few people in the intersection of "uses free software and does graphic design" and could query around :)
<paroneayea>anyway
<civodul>sure!
<civodul>Felipe would definitely be a good candidate
<wingo>oh dear upgrading glib and cairo means rebuilding erryting
<wingo>whoops, wrong channel :)
***michaniskin__ is now known as michaniskin
***michaniskin is now known as Guest61661