IRC channel logs

2016-02-05.log

back to list of logs

<paroneayea> https://microca.st/guile/note/7SEPVzayT4CJTRDu5e9VoQ
<paroneayea>a bit late, but promoted
<paroneayea>wingo: I just read through your blogpost
<paroneayea>I feel like elisp optimization, and helping guile-emacs is something I really care about, though of course my plate is already really high. Maybe at some point I should try diving into it though and asking you more about it
<paroneayea>I really just don't know much about compilers though, aside from what I've learned from little schemer / sicp though!
<berndj>idiomatic value to return for a "function" that is all side effect and no result value? SCM_UNDEFINED?
<zxq9>berndj: I'm sort of curious, too. I usually return something like "ok". In a complex or likely to fail operation I might check for success this way and either continue or halt with a message based on this value.
<zxq9>I don't know if that's really idiomatic, though.
<Jookia>Is there a convention for optional/maybe values in Guile?
<wleslie>check for nil?
<wleslie>a bit icky I suppose.
<Jookia>Is it an antipattern, should I be doing something else? (Newbie)
<OrangeShark>I think in general #f is used as a Nothing value
<wleslie>berndj: I think SCM_UNSPECIFIED is more idiomatic
<Jookia>OrangeShark: and then it's matched to check?
<OrangeShark>well since all other values are considered true, you can use any conditional expression like if
<OrangeShark>(if maybe-value (do-something maybe-value) (do-something else))
<Jookia>Neat
<OrangeShark>the only problem is if the optional/maybe value can actually be #f...
<Jookia>in this case, it won't be
<amz3>does anyone has a html parser for guile?
<amz3>héllo btw :)
<amz3>sneek: later tell peterbrett_work, here is an example stream, it (stream-cons) json objects lazily by reading the file line by line
<sneek>Got it.
<amz3>sneek: later tell peterbrett_work, later L70, I call the lazy *ahem* stream version of `for-each` proc to process each json assoc to save it inside a database
<sneek>Will do.
<amz3>sneek: later tell peterbrett_work, this is very minimal example, the real fun is when you have to chain stream procedures, to build a pipeline. I do that to traverse a graphdb using an API similar to Gremlin DSL
<sneek>Will do.
<amz3>sneek: later tell peterbrett_work, https://gist.github.com/amirouche/ef651d20b83f51a53fc7#file-wikidata-scm-L25
<sneek>Will do.
<civodul>wingo: great post, BTW, and i like all the work items
<wingo>tx!
<civodul>i think it's very import to post to guile-devel as weell
<civodul>*well
<civodul>reaching "insiders" should be the easiest thing to do
<civodul>*important
<civodul>damn it
<wingo>yeah
<wingo>yeah i agree, i just wanted to reach other people too :)
<wingo>will do
<civodul>but you cannot reach "other people" without reaching "insiders", IMO
<civodul>otherwise insiders will have to become "other people"
<civodul>infinite recursion! :-)
<wingo>:)
<ArneBab>amz3: didn’t davexunit have a html->sxml tool somewhere?
<amz3>I ask him later, but I think it's sxml->html
<amz3>thx for helping in my struggle, otherwise two possibilities remain A) to write bindings of libxml B) port html5lib to scheme
<ArneBab>I’m currently using xml->sxml and it’s very useful.
<ArneBab>(parsing xml files with match)
<amz3>wait until you stumble upon sxpath ;)
<ArneBab>what does that do?
<ArneBab>filesystem as s-exp?
<amz3>no xpath over sxml
<ArneBab>oh, nice! https://de.wikipedia.org/wiki/XPath
<amz3>stis_: héllo!
<amz3>stis_: what are you up to?
<stis_>amz3: I am i low period when it comes to hacking. But got persistance of logic program state working
<stis_>this means that you can save a computational state, store it on disk. and move it to another machine and continue the work in another guile session there
<stis_>it's a neat functioinality that can be used by minikanren as well.
<wleslie>awesome
<stis_>The hard part was to get persistance of closures working - which is a hack without support from guile api
<stis_>I talked with wingo: this feature may get into the guile api later in the 2.2 cycle. But not for the initial 2.2 release.
<wingo>tbh i am not sure how much support you need from the guile api. serializing a closure to an image does rely on guile internals -- it has to -- but i don't know that you need changes to guile itself in order to implement it
<wingo>in practice the guile abi will be stable over 2.2 so there's no problem there. there can be additions to the instruction set, but your serializer could error if it saw an unknown instruction
<stis_>I expect that you need access some of the internal datastructures.
<stis_>what you can get is the adress of a closure. But that will differ from innvocation to invocation
<stis_>So I calculated relative adresses to the bytevector holding the elf read in data
<stis_>and use module trickies to manages the adresses of those bytevectrs
<stis_>That enabled the calculation of a closure adress from persistant information like module and relative adress in the module
<stis_>then you have different types of procedures primitive ones etc.
<stis_>Of cause this is dangerous magic, like getting wrong go version etc and the system craches.
<wleslie>out of curiosity, do either of you know anything about the current state of the art for range analysis?
<stis_>wleslie: no I don't know that.
<wleslie>seems to be chains of recurrences, which seems more of a start than anything
<wleslie>thanks stis
<stis_> constraints
<stis_>wleslie: not sure if it helps but have you checked out what clpfd in prolog land can do?
<stis_>constraint programming in finite domains
<stis_>so it deduces allowed ranges of variables resulting from applying different constraints
<stis_>that does not need to be linear
<stis_>just an idea.
<stis_>yey guile-2.1.2 is up and running
<stis_>wow, the compiler unboxing magic is awesome
<stis_>ACTION is drooling over some assembly output in guile
<stis_>wingo: primitive-load-path "syntax/parse/src/runtime-progress" ...
<stis_>this fails compiling for me on 2.1.2
<stis_>No such file or directory
<stis_>Other files in the directory compiled, but this one failed. Hmm strange.
<stis_>2.1.1 could compile this.
<stis_>wingo: removing the old files in the ccache fixed the issue
<stis_>yey guile-syntax parse compiles on 2.1.2.
<wingo>ok :)
<wleslie>stis_: yes, I have lpfd and nlpfd libraries but I want better bounds without having a 4-billion element domain
<stis_>compiling guile-log, hmm primitive? is missing.
<wleslie>the range analysis is one part of the input to an injectivity-preservation analysis
<stis_>wleslie: cool. so those librarys can't constrain it to fewer elements, right. and you want to know the state of the art.
<wingo>stis_: primitive? is gone
<stis_>wingo: alternatives?
<wingo>(primitive-code? (program-code program))
<stis_>thx
<wingo>i didn't mention it in NEWS because it was an interface added in 2.1.1 i think
<stis_>n.p I know that I used scary stuff. I'm prepared to eat the turd I made.
<wingo>hehe
<wingo>see the git log of module/system/vm/program.scm for the reasons
<wleslie>hmm, I should try out clpfd anyway
<stis_>wleslie: If you need to know anything I know quite well the author of clpfd.
<stis_>ACTION got clpfd working in guile-log
<wleslie>it has disjunction, so I can actually represent phi nodes
<stis_>cool
<wleslie>and recursion, so I can actually implement... recursion
<stis_>cool^100
<stis_>guile-log is compiling just fine now
<stis_>yey and the persistance still works.
<stis_>wingo: thx for your splendid work!!
<wingo>yay that it works :)
***davidh` is now known as davidh
<taylan>wingo: this is hacky but is there something akin to 'resolve-interface' which will also force loading the autoloads declared in the module? background: autoloads in guix modules cause problems during the parallelized compile-file calls.
<civodul>taylan: i think we could have an explicit (use-modules (language scheme spec))
<civodul>at least for this specific module...
<taylan>civodul: I tried, and then it coudn't find the objcode language
<civodul>bah
<civodul>(for-each resolve-interface ...)
<civodul>kludge kludge kludge
<wingo>:)
<wingo>it's possible to grovel in the (module-uses mod) for a module, looking for modules whose (module-kind mod) is 'autoload
<wingo>however i don't think that you can then know what bindings the autoloaded module exports
<wingo>as in, that information isn't available to you. it's all dynamic in a way: resolving the unbound variable reaches the "autoload interface", and then a magical closure gets invoked
<wingo>~~~~magic~~~~
<wingo>it's a pretty sad form of magic tho!
<taylan>hmm
<wingo>we should certainly fix this
<taylan>trying to do some tests, (module-uses (resolve-interface '(ice-9 format))) returns () although there are #:autoloads in its define-module form...
<wingo>taylan: you have to do it on the module, not the interface
<wingo>so s/module/interface/
<wingo>er
<wingo>the other way around
<taylan>I see
<wingo>it's possible to fix with a hack, making interfaces say which bindings they are providing "lazily"
<wingo>but it would be better to fix the thread-unsafety of our modules :)
<taylan>once I have this module of the autoload kind, can I not somehow force loading the module it represents?
<taylan>well, I get #<autoload (ice-9 pretty-print) 27f2d80> so certainly I could extract the (ice-9 pretty-print) from there and call resolve-interface on it...
<taylan>(not literally from the write output, of course :P)
<taylan>(for-each (lambda (mod) (resolve-interface (module-name mod))) (filter autoload? (module-uses mod)))
<taylan>would that work? Imma try
<wingo>you could do that, though it's really hacky; that module name does not have to correspond to an actual module name. it probably does tho. but still, there's still going to be some lazy mutation going on
<taylan>hm yeah, didn't make a difference
<wingo>when the autoload interface lazily adds modules to its hash table when lookup happens on it
<peterbrett_work>Does anyone know which of the FOSDEM videos have sound?
<sneek>Welcome back peterbrett_work, you have 4 messages.
<sneek>peterbrett_work, amz3 says: here is an example stream, it (stream-cons) json objects lazily by reading the file line by line
<sneek>peterbrett_work, amz3 says: later L70, I call the lazy *ahem* stream version of `for-each` proc to process each json assoc to save it inside a database
<sneek>peterbrett_work, amz3 says: this is very minimal example, the real fun is when you have to chain stream procedures, to build a pipeline. I do that to traverse a graphdb using an API similar to Gremlin DSL
<sneek>peterbrett_work, amz3 says: https://gist.github.com/amirouche/ef651d20b83f51a53fc7#file-wikidata-scm-L25
<alirio>new year and everyone is wanting to reimplement unexec independently: http://lists.gnu.org/archive/html/emacs-devel/2016-01/msg00956.html, http://wingolog.org/archives/2016/02/04/guile-compiler-tasks
<peterbrett_work>amz3: Thank you, that's really interesting!
<bgardner>That's the most useful bot I've ever seen...
<wingo>peterbrett_work: not mine, apparently!
<peterbrett_work>wingo: It's so disappointing! Yours was the one I was most looking forward to watching once the videos came out!
<peterbrett_work>Oh well, there's a new blog post, so I suppose that makes up for it!
<wingo>there are a lot of other great presentations :)
<wingo>and i need to turn that talk into a post anyway too
<peterbrett_work>…most of which are silent! (The Guix one, and Ludovic's, and ...)
<peterbrett_work>Ah well! It wouldn't be FOSDEM without the occasional AV glitch :)
<peterbrett_work>Amusingly, I think that every Guile-related talk is silent apart from "The Future of Small Languages (which is shared with Lua)
<davexunit>they're all silent!? noooo
<davexunit>that sucks
<davexunit>A/V at conferences is literally the most difficult thing man has ever attempted.
<civodul>peterbrett_work: where did you get this info?
<berndj>truly silent or just with volume way down? i was watching some videos, i think they may have been FOSDEM talks from previous years, where i had to tell mplayer -af volume=20 (but it was still hard to understand due to low dynamic range in the video)
<peterbrett_work>Good question both!
<peterbrett_work> https://video.fosdem.org/2016/k3201/
<berndj>*volume=50 in fact
<peterbrett_work>In this case — really, no sound
<davexunit>yeah they are completely silent
<davexunit>terrible :(
<peterbrett_work>FOSDEM video infrastructure needs better integration tests ;-)
<civodul>bah
<davexunit>I've done A/V at libreplanet, and that was challenging with only 3 rooms to manage
<davexunit>so I can imagine how hard FOSDEM is
<davexunit>but it really sucks that our room is completely silent :(
<davexunit>I was impressed with how well the talk recordings came out last year so I was optimistic that I'd be able to enjoy everything again this year.
<berndj>there does seem to be a fractional bit per sample of sound, but it sounds like the speaker is speaking martian
<davexunit>I wonder if the transcoding job just got botched or if there really was no audio captured.
<berndj>i hear occasional half-syllables breaking through the background of martian planetary council coverage
<taylan>:)
<dsmith-work>Happy Friday, Guilers!!
<amz3>berndj: :)
<sneek>amz3, you have 1 message.
<sneek>amz3, peterbrett_work says: Thank you, that's exactly the practical streams example that I had been unsuccessfully looking for!
<amz3>yw!
<amz3>bad news for the vidz
<amz3>davexunit: do you know if there is a html->sxml proc somewhere
<amz3>sorry I know you are not a software registry..
<amz3>sneek: help html->sxml
<amz3>sneek: eval (help html->sxml)
<amz3>If there is no such thing, what is the simplest solution to have one
<amz3>1) use the current SAX parser
<amz3>2) port html5lib
<amz3>3) bind lxml
<amz3>s/simplest/best
<amz3>s/lxml/libxml2
<davexunit>amz3: http://www.nongnu.org/guile-lib/doc/ref/htmlprag/
<davexunit>part of guile-lib
<davexunit>should do the trick
<amz3>thx
<amz3>I'm sure some of you tried the clojurescript koans over the web
<amz3>you learn scheme *ahem* clojure script via the web browser by solving small riddle/exercises
<amz3>now this another level of "readiness"
<amz3> https://probmods.org/generative-models.html
<amz3>userfriendlyness...
<amz3>spoiler: ^ it's about a probabilistic scheme written in javascript