IRC channel logs

2016-05-04.log

back to list of logs

<paroneayea>huh, (@@ (module) foo) results in an unrewindable partial continuation
<paroneayea>I guess, not the most surprising, but a little bit surprising :)
<kristofer>paroneayea, what does the @@ mean?
<paroneayea>kristofer: lets you import a variable from a module
<paroneayea>in the middle of a function or whatever
<akkad>hmm... seems no one actually uses guile in Makefiles directly
<paroneayea>akkad: yeah, too bad
<akkad>googling away. perhaps I'm doing it wrong.
<akkad>$(guile) and Makefile and you name it.
<ecraven>what kind of data is #{837}# ?
<koz_>#{...}# is something that can't be read back in.
<koz_>(or shouldn't be)
<koz_>(I think)
<wingo>ecraven: guile's syntax for unprintable symbols
<wingo>(string->symbol "837")
<ecraven>why not '|837|?
<wingo>historical raisins
<wingo>'|837| is much better :)
<ecraven>hm.. one of the benchmarks expects |837| etc.
<wingo>i think b/c guile has always treated '|837| as the same as (string->symbol "|837|")
<wingo>so it's an incompatible change
<wingo>however!
<wingo>i believe there is a reader option to turn on the r6rs/r7rs syntax
<ecraven>well, '|837| gives back |837|
<wingo>(read-enable 'r7rs-symbols) i think
<wingo>to turn on r7rs symbols
<wingo>chuck that in your prologue and all should be well i would guess
<ecraven>if I run that on 2.0 on the repl, it doesn't work :) is it 2.1 only?
<ecraven>doesn't work on guile-2.2 either
<wingo>ACTION tries
<wingo>it's in the manual anyway :)
<ecraven>I'm typing at the repl, maybe I'd need to use read
<wingo>no, it works on the read side
<wingo>scheme@(guile-user)> (read-enable 'r7rs-symbols)
<wingo>$1 = (r7rs-symbols square-brackets keywords #f positions)
<wingo>scheme@(guile-user)> '|123|
<wingo>$2 = #{123}#
<wingo>there might be a separate setting for how symbols are written
<wingo>scheme@(guile-user)> (print-enable 'r7rs-symbols)
<wingo>$3 = (r7rs-symbols escape-newlines quote-keywordish-symbols reader highlight-suffix "}" highlight-prefix "{")
<wingo>scheme@(guile-user)> '|123|
<wingo>$4 = |123|
<wingo>ecraven: ^
<ecraven>wingo: thanks a lot!
<wingo>np :)
<ecraven>in case anyone is interested, the benchmarks sources: https://github.com/ecraven/r7rs-benchmarks
<ecraven>run ./bench guile all
<wingo>neat, will do
<wingo>ACTION clones
<ecraven>wingo: hehe, no hurries!
<ecraven>there's some dirty black magic going on with actually creating the file that is used to run the test... /tmp/larcenous/Guile/...scm is the result
<wingo>k
<ecraven>with actual r7rs versions of guile some of the preprocessing can probably be removed
<wingo>we should just add --r6rs and --r7rs command-line options
<wingo>scheme peek-char currently 4 times slower than c :P
<wingo>gots to improve
<civodul>but faster than 2.0?
<wingo>ACTION checks
<wingo>same, more or less
<wingo>a little slower
<wingo>guile 2.0: 1.4s for 1e7 peek-chars
<wingo>guile master with C: about 0.360s
<wingo>guile master with scheme: 1.6s currently
<wingo>working on golfing it down
<wingo>i hope to get down to 0.5s, we'll see
<ecraven>from the test runs I did now with 2.0, guile seems to be on the slower side
<ecraven>(of course I'm mostly running native-code compiling schemes, so that's a bit biased :)
<wingo>:)
<wingo>i miss having scheme48 on benchmarks, that helped us ;-)
<ecraven>oh, I'll put those other schemes back on
<ecraven>just need to test each one, to make sure at least a few benchmarks run :)
<ecraven>there's sagittarius and kawa that are slow :)
<jchmrt> │ fold4
<jchmrt>woops, sorry
<random_nick>ecraven: will you benchmark chez and petite chez?
<wingo>ecraven: you tease us with hints at guile 2.1 benchmarks :)
<ecraven>wingo: almost :)
<taylan>ACTION quits work at the end of this month -- will hopefully be able to work on the R7RS branch then
<ecraven>how do I get read-line in guile 2.1?
<civodul>(ice-9 rdelim)
<civodul>or did you mean Readline, for interactive use?
<ecraven>no, that's it, thanks :)
<civodul>:-)
<ecraven>sorry about the obvious question, but how do I require this? require? load? use?
<peterbrett_work>(use-modules (ice-9 rdelim))
<ecraven>as always, these numbers may be totally wrong and unreliable https://www.nexoid.at/tmp/scheme-benchmark-r7rs.html
<civodul>the first verifiable benchmarks for Chez \\o/
<ecraven>note that petite is insanely fast in comparison to the others
<davexunit>never realized performed so terribly vs. pretty much any other scheme
<davexunit>never realized Guile*
<davexunit>though I'm not sure how to read some of these graphs. is it better if the bar is bigger or smaller?
<civodul>well i'm not surprised that mit, chicken, larceny, and chez perform better than Guile, i think that's expected :-)
<civodul>i'm more surprised about Gauche, which seems to perform pretty well
<davexunit>civodul: I didn't expect MIT scheme to perform better. I thought it was slow.
<davexunit>ACTION never used it
<civodul>it has a good native code compiler
<ecraven>the guile-2.1 run isn't finished yet, a few tests are still missing
<civodul>the different between 2.0 and 2.1 is often smaller than i'd expect
<civodul>well, it's hard to tell if it's "small"
<ecraven>also, where is vector-map? :)
<civodul>rnrs something?
<ecraven>have to go, be back later :)
<ecraven>thanks for the help!
<ecraven>I'll try to make guile run all the tests later
<civodul>neat
<ecraven>just need to get the right imports and aliases going
<taylan>not sure if R6RS has vector-map? could be that we don't have it in stable or master (though the wip-r7rs branch implements all of R7RS so it must be there)
<taylan>nvm, it's in R6RS
<civodul>i thought it was in R6, dunno
<civodul>right
<taylan>ecraven: (rnrs base)
<civodul>ecraven: would be nice to categorize the benchmarks, like: "i/o", "computational", "floating point computations", "vectors", "homogeneous arrays"
<civodul>and a poney please ;-)
<davexunit>guile 2.1 has greatly improved performance for my games, but sometimes I wonder if I should have just used Chicken...
<taylan>ecraven: is chibi-unknown the current head(terminology?) of the hg repo?
<wingo>vector-map is stupid :)
<mark_weaver>ecraven: vector-map is in SRFI-43, R6RS, and R7RS, all slightly different :)
<mark_weaver>the SRFI-43 vector-map passes indices to the provided procedure
<mark_weaver>R6RS and R7RS behave more like the list-based 'map', and differ only in their handling of lists of different lengths. R7RS stops at the shortest list, and iirc R6RS is more strict about that
<mark_weaver>Guile's R6RS vector-map is poorly implemented, converting all the vectors into lists, running 'map' and then converting back to a vector. the other implementations in Guile are more efficient
<mark_weaver> http://git.savannah.gnu.org/cgit/guile.git/tree/module/scheme/base.scm?h=r7rs-wip#n267
<mark_weaver> http://git.savannah.gnu.org/cgit/guile.git/tree/module/rnrs/base.scm?h=r7rs-wip#n236
<mark_weaver> http://git.savannah.gnu.org/cgit/guile.git/tree/module/srfi/srfi-43.scm?h=r7rs-wip#n439
<mark_weaver>one of these days I should improve our R6RS support
<mark_weaver>bah, I just realized that the single-vector case of my R7RS vector-map implementation simply calls the R6RS vector-map. I guess at the time, I didn't realize how slow our R6RS vector-map was.
<wingo>chez is disgustingly fast
<wingo>wtf
<paroneayea>morning everyone
<wingo>good morning paroneayea
<paroneayea>mornin wingo :)
<paroneayea>ACTION hacks the MUD some more
<paroneayea>lisp game jam is coming along pretty well. I can finally walk around the world, and do a few things.
<wingo>nice :)
<paroneayea>I'm also getting a better sense of what things cause unwindable partial continuations :)
<wingo>:)
<wingo>on my side i have peek-char implemented in scheme in a branch
<wingo>so that a blocking read can eventually suspend and later resume
<wingo>still noodling on its performance tho
<paroneayea>lots of GOOPS method things (well, in guile 2.0), @@ / module-ref (so I reaallllly have to be careful about dependency ordering) are the things that bit me a few times
<paroneayea>but
<paroneayea>now I've mostly got it
<paroneayea>wingo: cool!
<davexunit>here's my lisp game jam progress as of last night: https://media.dthompson.us/mgoblin_media/media_entries/67/lisp-game-jam-2016-spring-3.gif
<wingo>wow!
<wingo>pretty cool :)
<davexunit>and that whole "simulation" is described with pure functions and immutable data
<davexunit>thanks wingo :)
<davexunit>(the low resolution is not caused by a limitation of guile, but by a limitation of my own artistic abilities)
<kristofer>davexunit, that's great!
<kristofer>ACTION needs a new machine
<kristofer>I can't run sly because of my old graphics card
<davexunit>I need to look into supporting opengl 2.1
<kristofer>davexunit, by immutable you mean it creates a new record for each change in state?
<davexunit>kristofer: yes
<davexunit>no mutation
<davexunit>(at this layer, anyway)
<kristofer>I'm trying to grok this monadic stuff, which I expected to find in this example
<davexunit>I use a loosely defined monad to describe the rendering pipeline
<davexunit>but interactions between game objects are really just referentially transparent procedures
<kristofer>I'm playing with gdbm and would like to implement some sort of immutable state like the guix store does with the filesystem
<optikalmouse>I'm having a problem running the hello world web server example on cloud9
<optikalmouse>I installed guile 2.0, I pretty much copied the example from the home page and it doesn't seem to be running, not sure if it's a code issue or if it's an issue with the virtual machine i'm working in
<davexunit>I have made many a web server with guile. it works.
<optikalmouse>ok so it's a cloud9 thing, cool I'll try and wget localhost and see what happens
<optikalmouse>thx, I just need a sanity check before my 2nd cup o' coffee
<davexunit>are you listening on loopback or something?
<optikalmouse>davexunit: potentially...not sure how to pass the binding ip address to #'run-server
<mark_weaver>optikalmouse: something like (run-server <handler> #:open-params (list #:host <name-or-addr-string> #:port 80)) I guess
<optikalmouse>is that in the guile reference manual? I was looking through Web Server and it doesn't seem to mention that
<mark_weaver>it's probably not adequately documented. patches welcome, and in the meantime use the source :)
<mark_weaver> http://git.savannah.gnu.org/cgit/guile.git/tree/module/web/server/http.scm?h=stable-2.0#n59
<mark_weaver>the list of arguments after #:open-params is passed to 'http-open' here ^
<mark_weaver>or pass in a socket that you've already created if you prefer
<mark_weaver>the socket is the only argument used in 'http-open'. the other keyword arguments are only used to create the default socket, if you don't pass one in.
<optikalmouse>so #:arg is the way to do keyword args?
<mark_weaver>yes
<optikalmouse>I'm used to emacs lisp and other schemes that don't have keyword args or pass them as a hash a la ruby style
<davexunit>optikalmouse: the guile manual documents this
<optikalmouse>ok awesome...I may have to start reading it on my commute.
<davexunit>7.3.9 Web Server
<mark_weaver>see section 6.6.8 of the guile manual for more on keywords
<mark_weaver>optikalmouse: btw, your notation #'run-server looks like common-lisp. in modern scheme, #' has a different meaning, used in our macro system.
<optikalmouse>yaaaaay it worked: https://iteron-omouse.c9users.io/
<mark_weaver>\\o/
<paroneayea>davexunit: wow niiice
<paroneayea>:D
<davexunit>thanks! :)
<civodul>davexunit: indeed https://media.dthompson.us/mgoblin_media/media_entries/67/lisp-game-jam-2016-spring-3.gif is pretty cool :-)
<ecraven>taylan: no, but chibi has no way of reporting its version from inside scheme, it seems :-/
<davexunit>civodul: thank you!
<dsmith-work>day Greetings, Guilers
<taylan>ecraven: but there's also a versioned chibi. what's the "unknown" one?
<ecraven>taylan: current git
<ecraven>as of two days ago
<ecraven>the point is, I need some function I can call in the active scheme. chibi has none, it seems :-/
<taylan>ecraven: oh, it moved to GitHub didn't it? I forgot.
<ecraven>taylan: I asked Will Clinger, and he kindly agreed that it is a good idea
<ecraven>I've added support for a few more Schemes (though I need to fill out the shims)
<taylan>ecraven: excuse me, which idea?
<ecraven> so you are very welcome to provide pull requests if you feel I'm treating your Scheme unfairly :)
<ecraven>taylan: that the benchmarks be developed further apart from larceny
<ecraven>they will stay with larceny, of course, but the code on github will support more than those
<taylan>oh I see. I meant Chibi with GitHub.
<ecraven>oh, chibi? sorry :) it probably did
<ecraven>I'm using the archlinux pkgbuild
<taylan>since I had asked whether it's the hg head and you said no, I was confused :)
<taylan>heh, looks like I already updated my local chibi repo to use the git repo. I forgot all about it.
<taylan>Chez is so wicked fast it's WTF. I wonder if it supports monkey-patching like in Guile, for interactive development...
<taylan>IIRC bindings from the standard library are immutable at least, so it probably inlines a ton of stuff
<ecraven>taylan: look at npcompiler.sch (I think), that has all the new compiler passes for chez
<nalaginrut>taylan: monkey patch for Guile, how to do it?
<taylan>nalaginrut: I mean the ability to change the binding of any top-level variable in any module at runtime
<taylan>(info "(guile) Module System Reflection")
<nalaginrut>alright, so it provides a way for it, but need higher level abstract for practice
<nalaginrut>maybe I can try monkey patch in Artanis...
<mark_weaver>nalaginrut: in Guix, we use monkey patches to workaround various bugs in earlier versions of Guile.
<nalaginrut>mark_weaver: oh nice~
<ecraven> http://www.nexoid.at/tmp/scheme-benchmark-r7rs.html
<nalaginrut>Guile has no AOT yet, so...
<davexunit>huh? guile uses an AOT compiler
<nalaginrut>I think it's just wrap bytecode into an elf, AOT is not ready
<random_nick>yep, chez is best
<nalaginrut>but at least in my machine, guile-2.1 has same performance with Chez on (fib 1000000)
<random_nick>nalaginrut: compiling to bytecode is still AIT
<random_nick>AOT*
<dsmith-work>nalaginrut: You are probably meaning Native Code compiler?
<davexunit>nalaginrut: that is ahead-of-time compilation
<nalaginrut>alright, most of the time I use AOT for native code generating
<dsmith-work>nalaginrut: Did you ever get Chez cross-compiling working?
<nalaginrut>I think it's a specific term for native code generating, think about Android, it uses delvik, but then it released a AOT compiler
<nalaginrut>in general, we may call JVM bytecode generating an AOT too
<nalaginrut>dsmith-work: no, it requires /usr/lib/libncures in arm32le
<nalaginrut>dsmith-work: the current cross compile of Chez is not so good to use, we have do some work manually to make it work
<nalaginrut>not compiler problem, it's Makefile issue
<nalaginrut>but anyway, it's not a big problem
<dsmith-work>nalaginrut: Seems like there is a step that *requires* running natively.
<nalaginrut>it's better to write a new cross compile framewwork (in Makefile), and download dependencies then cross compile them too
<nalaginrut>dsmith-work: but anyway, I ever expect Chez could be used for bare metal
<nalaginrut>it seems not that easy
<nalaginrut>maybe impossible
<dsmith-work>Hmm. I think you are right.
<nalaginrut>for Rpi, it's easy to compile on it
<nalaginrut>I want to use Scheme in bare metal, Chez brings lot of inspirations
<nalaginrut>it's very good project I ever dream, especially the AOT part ;-)