IRC channel logs

2017-11-10.log

back to list of logs

<ArneBab_>manumanumanu: it’s trivial to install, but that still means you don’t always have it at hand.
<ArneBab_>you can’t just tell new users in a tutorial to code like that
<happy_gnu[m]>What do I need to know for making a bot that requests Open Weather and outputs weather of requested city
<happy_gnu[m]>Besides Open Weather API of course
<happy_gnu[m]>Will it work just with Guile web client?
<happy_gnu[m]>Or should I use something more?
<affinespaces>kind of a dumb question -- sorry. it's not clear to me how to import the peg parsing module. how does one do that?
<affinesp1ces>i tried (use-modules (ice-9 peg)) to no avail
<ArneBab>did you check the info-pages?
<ArneBab>hm, I don’t find it there
<affinesp1ces>yeah I looked pretty thoroughly -- no luck.
<ArneBab>(use-modules (ice-9 peg)) should work
<ArneBab>which version of guile do you use?
<ArneBab>PEG was added in 2013, so you’ll need a 2.x guile
<affinesp1ces>2.0.11
<affinesp1ces>hmhm
<ArneBab>hm, then it should be included (that’s from 2014)
<affinesp1ces>[scm-error misc-error #f "~A ~S" ("no code for module" (ice-9 peg)) #f]
<affinesp1ces>that's the specific error i'm getting
<affinesp1ces>hm strange
<ArneBab>how did you build Guile?
<affinesp1ces>i installed using apt
<affinesp1ces>maybe i'll purge and try a fresh install
<ArneBab>find /usr/share -name peg.scm
<ArneBab>^ this is empty for me …
<ArneBab>on my computer 2.2 has peg.scm, but 2.0 does not
<affinesp1ces>oh huh
<ArneBab>do you have a way to get Guile 2.2?
<affinesp1ces>building it now
<manumanumanu>affinesp1ces: hold on to your chair when using it the first time. The speed-ups might blow you out of your chair :)
<affinesp1ces>haha beautiful :)
<affinesp1ces>guile: error while loading shared libraries: libguile-2.2.so.1: cannot open shared object file: No such file or directory
<affinesp1ces>nooooooo
<affinesp1ces>oh all good
<affinesp1ces>and (use-modules (ice-9 peg)) works woo
<ArneBab>affinesp1ces: Happy Hacking with Guile!
<affinesp1ces>thanks for your help :]
<manumanumanu>I have thought about building a markdown parser for guile using PEG. It should be rather simple, since there are already PEG parsers for markdown out there
<affinesp1ces>oh neat
<manumanumanu>like porting jgm's peg-markdown
<manumanumanu>that would be a lo of work, but very doable
<manumanumanu>a lot less work than porting something like pandoc's markdown parser :)
<lloda`>wish Guile had raw strings
***lloda` is now known as lloda
<civodul>lloda: raw strings?
<lloda>like R"xxx(I can freely use \\ and " and ' inside this raw string literal)xxx" in c++
<manumanumanu>lloda: you could probably hack something together using hash reader extensions
<manumanumanu>or write an automatic escaper for emacs :)
<lloda>yes I should write the reader ext...
<manumanumanu>lloda: https://www.gnu.org/software/guile/manual/html_node/Reader-Extensions.html
<lloda>manumanumanu: thx. I have written extensions before, I'm just being lazy :-/
<manumanumanu>I have two extensions in my prelude: #l(x (length x)) => (lambda x (length x)) and #c(char=? #\\a <>) => (cut char=? #\\a <>)
<manumanumanu>I had one where {blah <> 1} =
<manumanumanu>became (cut blah <> 1}, but that required hijacking curly-infix
<lloda>interesting
<lloda>I wrote one for reading arrays https://github.com/lloda/guile-newra/blob/master/mod/newra/read.scm
<manumanumanu>haha, mine were a lot easier :D you can ust read the whole expression using read and then just `(cut @,splice) it in.
<lloda>manumanumanu: I think I wouldn't a reader ext to save two characters compared to a macro...
<lloda> I see the value if you do something a lot, though
<manumanumanu>It is mostly a matter of principle. I think cut and lambda is line noise in a language that relies so much on higher ordered functions.
<manumanumanu>I understand what you mean though. I only use it at the repl
<lloda>manumanumanu: the famous toenail soup
<lloda>I use λ etc sometimes
<lloda>characters that stand out somehow.
<ArneBab>lloda: can’t you use (read-enable 'r7rs-symbols) and then (symbol->string |…|)?
<ArneBab>ah, no, there it escapes, too
<ArneBab>manumanumanu: I use wisp, and there lambda is just: λ() ... — for short expressions, saving the outer parens saves a lot of (relative) noise
<rekado>amz3`: here’s a little bit of feedback: “There is no package manager outside of guix which is still experimental”; Guix is not experimental.
<rekado>amz3`: also, as an intro to Guile it seems to try hard to convince people to use some other language instead
<rekado>like Python or even Rust.
<rekado>I think it’s not a good idea to crush the reader’s motivation so soon.
<rekado>you can always crush motivation later ;)
<rekado>amz3`: “A procedure is equivalent to what other languages call a function” – depends on what other languages you mean. “procedure” is used in C, for example. A function is a certain kind of procedure.
<manumanumanu>ArneBab: I don't have a neat way of writing the lambda char, but #l( is still rather convenient. at the repl i still have {} for cut, but sometimes it borks with readline, so I have started to avoid it
<manumanumanu>So, I am an emacs user, unlikely to change. However, friends of mine are interested in guile, but fiercly anti-emacs. What, preferrably nice gui colourful with flashy wobbly animations, editors are there that provide decent lisp/scheme editing
<jlicht>manumanumanu: spacemac ;-)
<jlicht>*spacemacs
<jlicht>but on a more serious note, I know of some people using vim for lisp-related coding. Not sure whether the editors support any shiny features though
<manumanumanu>jlicht: yeah, I have already tried, but they want "an editor that has entered the 21st century" to quote one of them
<manumanumanu>I don't condone that sentiment, but they are sincere
<manumanumanu>They will find the right path with time
<nee`>manumanumanu: I never used it myself, but maybe Atom? It's not proprietary and it seems to have a parinfer addon: https://atom.io/packages/parinfer
<manumanumanu>neat.
<manumanumanu>nee`: thanks.
<OrangeShark>manumanumanu: there is Light Table http://lighttable.com/ but I think it only has support for clojure. I don't see any plug ins for other lisps
<manumanumanu>there is apparently parinfer for vscode
<ArneBab>manumanumanu: for me the λ char is M3-Shift-l — you could add a shortcut in your emacs
<lloda>I use C-\\ tex and then \\lambda
<ArneBab>manumanumanu: I think Emacs has pretty much entered the 21st century, after all Blender and Atom are modelled after it, but Atom seems to be something they could use. Especially if by 21st century they mean "cool web app" ☺
<manumanumanu>ArneBab: I have used emacs since 1999. You don't need to convince me :D
<OrangeShark>ArneBab: lloda: there is also prettify symbols mode that allows you to replace strings with symbols. So you can have lambda be replaced with the lambda symbol while that mode is turned on
<lloda>manumanumanu: ArneBab: wrote that reader extension https://github.com/lloda/guile-raw-strings
<ArneBab>lloda: wow, cool!
<lloda>OrangeShark: didn't know, thx
<ArneBab>"char-please" ☺
<ArneBab>^ nice
<OrangeShark>lloda: It a pretty cool feature and you can add your own symbols
<ArneBab>lloda: I think it could be cleaner to name loopa and loopb by their task — for example reader and raw-reader.
<ArneBab>or … no, I misunderstood them
<ArneBab>(loopa → char-reader) (loopb → delimiter-tester)
<lloda>ArneBab: thx :) I'll clean it up later
<ArneBab>thank you!
<ArneBab>lloda: next question: Can we get this into Guile? ☺
<lloda>ArneBab: all I can do is take it to the list
<ArneBab>lloda: that sounds already good
<ArneBab>how can I set the sitedir to be in my home in a configure script ← autotools question
<ArneBab>want to get GUILE_SITE to be at ~/.local/share/guile/VERSION/site
<OrangeShark>./configure GUILE_SITE=~/.local/share/guile/VERSION/site?
<OrangeShark>assuming the project uses GUILE_SITE as the variable
<ArneBab>OrangeShark: is there a way to only set something to ~/.local/share/ and have it finde guile/VERSION/site itself?
<ArneBab>hm,
<OrangeShark>you could
<OrangeShark>if you use datadir in automake
<OrangeShark> https://www.gnu.org/prep/standards/html_node/Directory-Variables.html#Directory-Variables
<OrangeShark>datadir default to /usr/local/share
<OrangeShark>so if in your automake file, you use datadir, you can then do ./configure datadir=~/.local/share/
<OrangeShark>moddir=$(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)
<OrangeShark>you can even just change prefix to change everything's install location
<OrangeShark>./configure preifx=~/.local
<OrangeShark>./configure prefix=~/.local
<OrangeShark>ArneBab: I wrote https://erikedrosa.com/2017/10/29/guile-projects-with-autotools.html for setting up a guile project, did my best to explain everything
<ArneBab>OrangeShark: cool!
<ArneBab>that tutorial is awesome!
<ArneBab>something I wished to have for a long time
<OrangeShark>ArneBab: I've wanted one too :)
<ArneBab>thank you for making it!
<happy_gnu[m]>Hello \\o/
<ArneBab>hello happy_gnu[m] ☺
<manumanumanu>Wahoo!
<manumanumanu>Guix is installed
<manumanumanu>sweet times
<davexunit>OrangeShark: nice post! much needed
<davexunit>nice choice of static site generator ;)
<OrangeShark>ArneBab: davexunit: thanks :)
<OrangeShark>davexunit: was better than the static site generator I wrote and also has some decent support for markdown ;)
<johrpan>Hi guys! How do I hide the copyright and help information shown at Guile's startup (if that's possible)?
<manumanumanu>johrpan: nothing in the man-file. maybe there is some voodoo you could do
<davexunit>OrangeShark: you've got yourself to thank for the markdown support :)
<johrpan>manumanumanu: Yes, I also searched before, but it's not that important. I just don't wanna see it every time.
<davexunit>AFAIK it's non-optional
<davexunit>yeah, just read the repl code to verify
<johrpan>Actually something I could have down, yes.
<davexunit>you may not have known where to look
<davexunit>this is a request I've heard several times, so perhaps a REPL option could be added which we could hook up to the CLI
<davexunit>doesn't seem too hard to accomplish
<lloda>johrpan: I remember answering this on IRC a couple years ago... all you have to do is define away *repl-welcome* in (system repl common).
<lloda>like, put this in .guile:
<lloda>(set! (@@ (system repl common) repl-welcome) (const #f))
<lloda>that's it
<bavier>was just what I was going to suggest
<johrpan>Ok, I'll give it a try.
<johrpan>lloda: Oh yeah, this works perfectly well, thanks a lot!
<johrpan>May be I'll miss it soon...
<lloda>johrpan: yw
<happy_gnu[m]>ArneBab: hi :)
<mwette>thanks for that.
<davexunit>lloda: good hack!
<davexunit>should've thought of that
<davexunit>we have a fully hackable environment
<ArneBab>lloda: oh, wow, that shoould be in the manual…
<amz3`>rekado: tx
<ArneBab>can I create an array which is used as function properties without using the #((...)) syntax?
<ArneBab>(define (f) "docstring" #((test '(foo))) #f)
<ArneBab>(procedure-properties f)
<ArneBab>((name . f) (documentation . "docstring") (test (quote (foo))))
<ArneBab>(define (f) "docstring" #((test (foo))) #f)
<ArneBab>what does not work:
<ArneBab>(define (f) "docstring" (list->array 1 '((test (foo)))) #f)
<manumanumanu>So, anyone using guix? I have guile2.2 installed. I have installed guile-colorized, but it is not available anywhere
<OrangeShark>manumanumanu: is it on your load path?
<OrangeShark>you should see it in .guix-profile/usr/share/guile/site/2.2/ice-9
<manumanumanu>OrangeShark: yup, and it is installed by guix, but I have no usr/share directory in my guix profile dir
<manumanumanu>this is all very weird
<manumanumanu>I might have messed up my config
<manumanumanu>I think I have, by using a sudo shell and not a proper root shell
<manumanumanu>because trying to install things as root gives me errors relating to incoherent packages
<OrangeShark>oh you are installing it on root?
<manumanumanu>no, but I probably was in a sudo -s shell sometime
<manumanumanu>and that has borked everything
<OrangeShark>actually it should be installed in .guix-profile/share/guile/site/2.2/ice-9
<manumanumanu>OrangeShark: it isn't there :( I'm starting over
<OrangeShark>okay, be sure after you finish installing guix, you install stuff as a regular user
<manumanumanu>I know. and I will use a proper root shell for root work
<manumanumanu>this has bitten me so many times
<manumanumanu>OrangeShark: is there any way to force a package to a specific guile version? both guildhall and colorized is installed in the 2.0 site dir :(
<OrangeShark>manumanumanu: with guix?
<manumanumanu>yu
<manumanumanu>p
<OrangeShark>there needs to be a separate version for guile 2.2
<manumanumanu>I'll just place them in the site dir in my home dir
<happy_gnu[m]>hi
<happy_gnu[m]>can anyone here help me with a Guix package for Chickadee, I have a recipe but I am having trouble to build it
<manumanumanu>is anyone running guildhall for 2.2?
<janneke>happy_gnu[m]: didn't chickadee have a guix.scm, ready to use?
<manumanumanu>that'll be my first try at writing a guix package
<daviid>manumanumanu: guildhall does not work with 2.2, but potluck does, which is our next guildhall (thou I don't use it myself yet, just saying this to help...)
<manumanumanu>ah
<happy_gnu[m]>janneke: guile-sly had one
<happy_gnu[m]>I am using that as a base
<daviid>manumanumanu: there is a long and very nice eamil written by andy about potluck
<daviid>manumanumanu: https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00250.html
<manumanumanu>ah!
<manumanumanu>neat!
<stis>whos nick is working on nyacc and the ffi helper
<ft>Is it mwette?