IRC channel logs

2015-11-08.log

back to list of logs

<Petit_Dejeuner>Hi, I was explorig my loadpath and now I have some questions about guile. What does "ice-9" mean, why does the top of the "match.upstream.scm" file look like a scribble document, and why is match partioned into two files with one named upstream?
<ft>ice-9 is a reference to this: https://en.wikipedia.org/wiki/Ice-nine
<ft>That's somewhere in the manual as well, IIRC.
<ft>match is based on someone's portable implemenation, IIRC. I would guess the upstream file is that person's original code.
<koz_>I'm trying to write a tool to convert .arff files (semi-structured text format) to SQLite database files. Does Guile have something similar to flex/bison I can use for this?
<ft>Guile ships this: https://github.com/schemeway/lalr-scm
<ft>The module is (system base lalr)
<koz_>Oooh, a lalr parser. Exactly what I needed - thanks!
<Partmedia>I'm a bit late to the new-website party, but it's really nice :)
<iyzsong>oh, the new website. it's beyond my imagination!
<koz_>Could someone help me make sense of the LALR parser Guile comes with? None of the examples are very helpful.
<amz3>héllo
<amz3>sneek: help
<amz3>sneek: later tell davexunit there is a bug in (ice-9 json) regarding UTF-16 decoding, if I'm not mistaken UTF-16 is variable length? I can provide a test json if you need.
<sneek>Will do.
<amz3>sneek: later tell davexunit I could also make patch but I need to sort the spec first, why not use libunistring?
<sneek>Okay.
<amz3>And... the script is running (with a quick fix in ice-9 json), this afternoon, I will have a wikidata.base ready to be inspected }:>
<amz3>meh the database crash, let's wait another 4 hours
<amz3>I added a transactions, maybe that was the issue some how
<chrmod>Hello everybody. I'm trying to figure out how to use sqlite with guile and have found `dbi` - which look totally alright. But cannot find a way to install it in other way then building it from source. This leads to my question: Does guile have any sort of module manager, like gems for ruby or npm for node, pip for python, etc. ?
<healer>There's guild; but it's not ready for primetime yet
<chrmod>guild is same as guildhall https://github.com/ijp/guildhall ?
<healer> https://wingolog.org/archives/2011/07/04/guile-2-0-2-building-the-guildhall
<amz3>the other solution is to use guix
<healer>chrmod: Yes
<amz3>I'm building from source tho
<healer>amz3: Are guile packages available on guix now?
<amz3>yes
<healer>That's encouraging
<civodul>healer: see http://www.gnu.org/software/guix/packages/
<amz3>^
<amz3>guile-gnunet is packaged :)
<healer>Just checked out http://www.gnu.org/software/guix/packages/
<healer>Nice to see a couple of guile packages in there
<healer>Guix might be a good option; while waiting for guildhall
<chrmod>is it possible to use guix on top ubuntu?
<healer>From what i understand; yes
<healer>It can co-exist with the apt-ecosystem just fine
<healer>Downside just appears to be the limited number of available packages
<healer>No personal experience with it though
<amz3>usually, I use guix on top of debian/ubuntu. It works. I did not install it yet, because I did not bother going outside my confort zone
<amz3>and TBH I don't use the programs packaged in guix so...
<amz3>but I'm not a good example I guess
<chrmod>do you think that guix will be capable to manage modules for multiple versions of guile at the same time?
<amz3>to say all the story, I'd say that guildhall is not useful when guix. It's more powerful.
<amz3>If I had software to package, I'll only package them for guix
<amz3>chrmod: yes, but I don't have experience with that myself, I install everything globaly.
<amz3>like I said I'm not a power user
<amz3>it can do containers, virtualenv and vm
<amz3>actually there is a project to replace python-tox with guix called guix-tox
<chrmod>sounds promising. will give it a try. Thank you for helping
<amz3>yw!
<amz3>the irc channel is #guix
<kkrev>Does the linking exception allow for static linking? I can't easily figure this out. Thanks.
<Petit_Dejeuner>Is there not a way to open a file with a specific mode when using "with-output-to-file"?
<ArneBab_>amz3: I think guildhall is useful for all those who just need a simple way to get modules.
<ArneBab_>guix takes that a bit too far for many tasks — for example by using its own locales instead of just using the host system
<ArneBab_>(though that can be useful — for example my guile-emacs works thanks to guix)
<chrmod>just make guix working, and it is kinda cools as it installed guile locally for my user (not system wide)
<ArneBab_>chrmod: yepp, that’s really cool
<ArneBab_>guix can do things for a normal user which normally only work in the distro, and as such massively simplify development.
<ArneBab_>decouples users on a machine
<ArneBab_>and the machine keeps working when I break something
<chrmod>ArneBab_, there is <catern> asking about it at #guid atm
<chrmod>ArneBab_, there is <catern> asking about it at #guix atm
<ArneBab_>just answered :)
<ArneBab_>bbl
***thorwil_ is now known as thorwil
<wirrbel>what is the preferred way to assert things in guile?
<davexunit>wirrbel: call a predicate and throw an error if it returns #f
<paroneayea>hello #guile!
<Petit_Dejeuner>hi
<Petit_Dejeuner>Any reason why open-input-file and friends don't use dynamic-wind?
<davexunit>Petit_Dejeuner: because they return to you an opened file port
<davexunit>you probably want to use call-with-input-file
<Petit_Dejeuner>Okay, but why doesn't call-with-input-file use it?
<Petit_Dejeuner>Or is that logic inside with-input-from-port? (I need to look for its definition now.)
<paroneayea>davexunit: an almost working websocket implementation!!!!!?
<paroneayea>ACTION just saw twitter message
<paroneayea>davexunit: that is THRILLING btw
<davexunit>Petit_Dejeuner: call-with-input-file ensures that port is closed when the user supplied proc is finished or an exception occurs
<davexunit>surely it uses dynamic-wind
<Petit_Dejeuner>Alright, good.
<davexunit>paroneayea: :)
<Petit_Dejeuner>There isn't an easier way to find definitions than grep, is there?
<davexunit>inspect the source information from the repl
<paroneayea>Petit_Dejeuner: are you using emacs + geiser?
<paroneayea>you can do C-c C-d C-d to get info on a symbol
<paroneayea>and then there will be a link from there to jump to source, too
<rlb>daviid: I think maybe I was talking to you about this - but I can't recall where I ended up. I can see that (srfi-9) records define a <<foo>> class that can be used with goops. And I seem to recall thinking that records might be slightly preferable for some reason (maybe wrt immutability?). Do you happen to recall what the recommendation was? (Use case, building immutable clj types, currently on top of pfds.)
<rlb>Right now I'm using goops for some of the types and srfi-9 for others, but I'll probably want to clean that up.
<rlb>I suppose as long as I can do everything I need to do with srfi-9, there's also the increased portability argument.
<rlb>(Though I'll still be using generic functions, so that only goes so far.)
<Petit_Dejeuner>paroneayea: I am using Emacs and geiser, but the [manual] and [source] links don't work. I guess I should go find out why not.
<davexunit>I use M-. all the time in geiser
<davexunit>to jump to definitions
<davexunit>note that it only works for definitions that are actually written in scheme. it can't help with stuff that was written in C.
<daviid>rlb: I don't remember :)
<Petit_Dejeuner>Well, I must have done something wrong because M-. doesn't seem to work on anything.
<Petit_Dejeuner>Do you install from source?
<davexunit>how you installed it shouldn't matter
<davexunit>if guile is installed, you have the module source.
<daviid>rlb: I'm not very familiar with records, do we have immutable records ? otherwise, mutable/immutable, imo, should _always_ remain the responsiility of the programmer, not being imposed by the language itself
<davexunit>call-with-input-file doesn't work with M-.
<davexunit>which leads me to believe that it is implemented in C
<davexunit>paroneayea: https://git.dthompson.us/guile-websocket.git
<davexunit>(warning: hastily thrown up there. need to add license and stuff)
<davexunit>(it will be LGPL)
<Petit_Dejeuner>Ah, it does work. Just not on stuff I load into the repl from another file.
<davexunit>(would like it in guile core eventually)
<Petit_Dejeuner>I guess it has to be imported?
<davexunit>things like call-with-input-file are already imported.
<Petit_Dejeuner>No, I mean I had a buffer that I was compiling to load code in and I couldn't use M-. to jump to my file.
<Petit_Dejeuner>But when I imported ice-9 list, I could just to rassoc.
<davexunit>yes, the current module needs those symbols to be imported
<davexunit>geiser is aware of the module you are working in.
<daviid>rlb: i see, define-immutable-record-type ... great, you're saved then! :lo:
<paroneayea>davexunit: there's a GPL file in there, but yeah, the code looks generally good!
<paroneayea>those should have been two statements :)
<paroneayea>not that it wouldn't look good because of the GPL file
<paroneayea>just commenting on the LGPL part, given the base64 one
<davexunit>that needs updating
<daviid>rlb: it is unfortunate that records promote the use of <name> traditionally reserved for goops classes
<Petit_Dejeuner>ty
<davexunit>paroneayea: https://github.com/weinholt/industria/blob/master/weinholt/text/base64.sls
<davexunit>upstream is expat licensed
<paroneayea>davexunit: ahhhh, it's just taken from guix
<paroneayea>got it
<davexunit>it seems that industria *used to* use GPL
<davexunit>and then changed to expat
<paroneayea>davexunit: I see
<paroneayea>I was going to say, the guix file should probably follow https://www.softwarefreedom.org/resources/2007/gpl-non-gpl-collaboration.html
<paroneayea>but
<paroneayea>maybe it came from before then
<davexunit>because I had a sha-1 module from the same library from awhile back and it has a GPL license statement
<davexunit>but now that same file has an expat license statement.
<davexunit>I guess the author realized that using the GPL for stuff like a base64 encoder and a sha-1 hasher isn't the best idea.
<daviid>rlb: in addition to immutability, code written using srfi-9 will be [probably much] faster then corresonding code using goops. that is if you don't use goops at all of course
<daviid>if you do use goops to dispatch methods among your record types, then no win, and except if your want to impose immutablity, I would use goops
<paroneayea>oh right
<paroneayea>I forgot about industria
<paroneayea>cool project
<kori>has anyone used sly?
<paroneayea>kori: I have, rumors are davexunit has too
<paroneayea>;)
<paroneayea>davexunit is Sly's principal author
<paroneayea>kori: it has its own channel, #sly
<paroneayea>though! I'm sure sly-related discussion is welcome in #guile too
<kori>aye, well, that's nice
<paroneayea>kori: thinking of giving Sly a go?
<kori>the recent guile website redesign brought both guile and sly to my attention
<paroneayea>kori: so, two comments on Sly:
<paroneayea>kori: using it is an absolute joy and also an interesting mental exercise, in that you end up reapproaching a lot of how you normally think of doing programming, which I find fun
<ArneBab_>daviid: is the performance of GOOPS documented somewhere?
<paroneayea>kori: but also it's still not really at a stable point, and drawing a lot of objects is currently slow
<paroneayea>kori: (davexunit has plans to improve that)
<kori>paroneayea: this should be extra fun then, because I currently -don't normally think of doing programming-
<paroneayea>kori: :)
<paroneayea>kori: have you seen this?
<paroneayea> http://dthompson.us/functional-reactive-programming-in-scheme-with-guile-2d.html
<paroneayea>kori: that video is really useful for understanding why coding in Sly is interesting
<kori>not yer
<kori>t'
<kori>this should be fun, thanks
<paroneayea>kori: so, if you're interesting in exploring, davexunit loves feedback, and Sly is a joy to play around in. Just realize that it's young and thus has some limitations.
<paroneayea>kori: the demos section has interesting stuff in it
<paroneayea>including fun implementations of minesweeper and 2048
<paroneayea>and an implementation of conway's game of life by me that abuses the heck out of the minesweeper tiles ;)
<daviid>ArneBab_: not officially, but i kind of remember someone posting benchmarks comparing the perfs of recent goops redesign comparing to the previous one
<kori>paroneayea: theoretically, for an initially small 2d fighter game it should be fine, right?
<kori>street fighter style?
<ArneBab_>daviid: same for me, but it would be nice to actually have that readily available.
<daviid>ArneBab_: slot access can be as fast as record field access, the problem [it's not a problem, it is a design :)] is method dispatch which is run time
<kori>davexunit: also, have I seen you anywhere else? your nick is familiar.
<ArneBab_>ACTION remembers starting datastructure benchmarking but not yet getting it anywhere…
<paroneayea>kori: it depends on how many sprites there are on a screen at a time
<paroneayea>kori: but davexunit can answer better than I can
<daviid>rlb: I hope my last two comments help
<rlb>daviid: indeed, thanks - for some things I may end up providing access from "normal scheme", and if I can make that more efficient, I will. Though for things like the sequence abstraction, you're going to have generic functions, i.e. distinct, filter, remove, partition, shuiffle, split-with, etc. Anyway, bbl.
<rlb>"shuffle"
<daviid>rlb: iiuc, your records will only be there to hold on to the lower level datastructure effectivly used for a particular type, goops used to dispatch methods ... if that so, the immutability won't be effective on the lower level datastructure itself, that's 1 thing, the other being that slot access is as fast as record access and since you'll use goops anyway, I'd use goops 'all the way down': the code will be much cleaner, easier to
<daviid>read, maintain ... imo, but I only have a very 'superficial' picture of your design so I might be wrong as well
<davexunit>kori: 2d games should work well with guile
<davexunit>ah, I see you've been invited to #sly :)
<Petit_Dejeuner>Does readline not respect with-input-from-file?
<Petit_Dejeuner>I think I'm probably doing something wrong if I'm using readline to read a file though.
<davexunit>readline isn't for reading files
<davexunit>readline is a gnu library for dealing with interactive prompts
<Petit_Dejeuner>Alright, that makes sense.
<davexunit>if you want to read a line from a port, using 'read-line' in (ice-9 rdelim)
<Petit_Dejeuner>ty