IRC channel logs

2014-07-02.log

back to list of logs

*janneke is trying to access all local bindings and tried....
<janneke>scheme@(guile-user)> (use-modules (system repl debug))
<janneke>scheme@(guile-user)> (define foo 'bar)
<janneke>scheme@(guile-user)> (for-each (lambda (x) (format #t "\\nframe:~a\\n" x) (print-locals (stack-ref (make-stack #t) x))) (iota 30))
<janneke>but i don't see either foo or bar in any of the frames
*janneke finds local-ref, which handles the toplevel define...
<janneke>(module-map cons (local-ref '()))
<janneke>$63 = ((foo . #<variable 14d5c10 value: bar>) (%module-public-interface . #<variable d1dd40 value: #<interface (guile-user) d68bd0>>))
<janneke>...but it does not see the let binding
<janneke>(let ((bar 'baz)) (module-map cons (local-ref '())))
<janneke>$64 = ((foo . #<variable 14d5c10 value: bar>) (%module-public-interface . #<variable d1dd40 value: #<interface (guile-user) d68bd0>>))
<janneke>:-(
<civodul>Hello Guilers!
<janneke>hi civodul
<phallic_elbegast>janneke, you remind me of this children's book I was read from as a child.
<phallic_elbegast>It's about two kids called Jip and Janneke.
<phallic_elbegast>Who save the world from the evil overlord of the Vorticons.
<janneke>phallic_elbegast: yes!
<phallic_elbegast>janneke, you read it too?
<nalaginrut>what's the name of the book? ;-)
<phallic_elbegast>nalaginrut, "Jip en Janneke"
<nalaginrut>phallic_elbegast: thanks, but seems no in English ;-P
<phallic_elbegast>nalaginrut, well, it's Dutch yeah.
<nalaginrut>hah
<phallic_elbegast>You know, those people with their blackface every 5 december.
<nalaginrut>sounds interesting, I'll find a English edition
<phallic_elbegast>It's actually a fairly silly children's book.
<nalaginrut>oh, you don't know I just have a baby few days ago ;-P
<nalaginrut>that's why I'm interested in it
<phallic_elbegast>Ahh, yes.
<janneke>phallic_elbegast: i read several jip and janneke, not sure about this one
<phallic_elbegast>janneke, ah, thence you derive your name?
<janneke>phallic_elbegast: it prolly helped..
*janneke repeats guile question...
<janneke>how do i get all locally bound variables?
<janneke>something like ,locals (print-locals in system repl debug)
<civodul>janneke: you mean programatically, for introspection?
<janneke>yes
<civodul>short answer is that's not something you should do, normally :-)
<civodul>but...
<janneke>civodul: i want to do something like:
<civodul>there's syntax-locally-bound-identifiers
<janneke>(let ((foo 'bar)) (expand #{ "bla" #foo "baz" }) - -> "blabarbaz
<nalaginrut>hmm...could be added to chaos Scheme competition...
<janneke>civodul: thanks... how do i get to that procedure/variable?
<janneke>i see it in ice-9 psyntax...
<janneke>nalaginrut: i have that template expansion in place, but it takes a module with bindings
<janneke>now i need to add lexical scope to it
<civodul>janneke: (system syntax), it's in the manual
<janneke>civodul: sorry, just 1sec ago found out
<civodul>but read the warning in there
*janneke reads manual
<janneke>ok
<civodul>janneke: in your example above, the best thing to do would be for (expand ...) to expand to (string-append "bla" foo "baz")
<civodul>there's no reason to use syntax-locally-bound-identifiers here
<civodul>what does (read (open-input-string "#{ ... }")) return?
*janneke is thinking ... why do i think i need something other than string-append
<janneke>civodul: very happy with (lexicals) ... even though i may not need/use it atm. thanks!
<civodul>too bad you didn't answer my question though
<janneke>civodul: ...yet
<dsmith_>sneek, botsnack
<sneek>:)
<dsmith_>wingo, It got past eval.scm, but the thing was powered off this morning! The display is funky too. (weird)
<dsmith_>wingo, make started back up at GUILEC language/cps/types.go
<dsmith_>And someone is using my nick!
<jcca>ft: hi
***dsmith_ is now known as dsmith
<dsmith>Allright
<wingo>strange stuff
<jcca>ft: I have tried http://pastebin.com/1rcFhfTb
<jcca>ft: it does not work.
<dsmith>Ya. The display is running at 1024x768 instead of 1280x800
<ft>jcca: ‘cf-make-raw!’ should be the first thing you do after ‘tc-get-attr!’ and definitely not *after* ‘tc-set-attr’.
<dsmith>!uptime
<sneek> 13:06:51 up 8 days, 13:15, 1 user, load average: 0.00, 0.01, 0.05
<ft>jcca: What kind of device are you dealing with?
<jcca>ft: the same issue..., I am with a arduino
***petercom1and is now known as petercommand
<ft>jcca: you can use "stty -a < /devttyACM0" to query the current settings of the serial port.
<ft>jcca: Which settings aren't set correctly?
<janneke>civodul: did you mean: (read (open-input-string #{ boo #} ))
<civodul>janneke: (read (open-input-string "#{ foo \\"bar\\" #}"))
<ArneBab>dsmith: nice that sneek is back! Do you know what happened?
<dsmith>ArneBab, no
<jcca>ft: http://pastebin.com/LeAHLfyN
<dsmith>process was not running. Forgot to look at the logs before I restarted.
<dsmith>ArneBab, The machine has been up for several days
<ArneBab>could you send it to #freenet again?
<ft>jcca: That doesn't look entirely wrong. Baudrate is correct, eight data bits, parity bit generation is off..
<ft>jcca: What kind of interface does the arduino use for its serial port? some sort of USB⇔UART converter, like an FT232R?
<jcca>ft: When I close port (close-port tty) it works, but I can't send more messages.
<ArneBab>dsmith: thanks!
<dsmith>jcca, Maybe you need to flush
<ft>right, display might be line buffering.
<ft>jcca: You do need to the ‘tc-set-attr’, btw. It's commented out in your last paste.
<dsmith>s/display/the port/
<ft>jcca: That procedure transfers the settings in your ‘ts’ variable to the device opened in your ‘tty’ variable.
<dsmith>ft, Try a force-output after the display
<ft>(force-output tty), that is
<dsmith>yes
<ft>jcca: ^- :)
<jcca>ft: ok, thank
<dsmith>Doh!
<jcca>ft: nothing ):, I will check it and I will ask later if you are available. Thanks for all.
<ft>jcca: You need to make sure that the arduino uses the same settings for its endpoint of the asynchronous serial link.
<jcca>ft: the arduino works with a golang + termios (http://goo.gl/8oZpIi)... and is similar to the code that you did, so I think I'm forgetting something.
<dsmith>Not to down guile termios in any way, but I've been really enjoying ser2net. Exposes a serial port as a socket.
<ft>Interesting. Didn't know about that. :)
<dsmith>Side benefit is you can telnet to the port from anywhere. (anywhere that that can see the machine ser2net is running on)
<ft>Maybe I should make the functions throw an exception, in case the POSIX functions signal an error via their return-value.
<ft>dsmith: ser2net allows configuring the underlying serial-link as well? Or do you need to fall back to stty for that?
<dsmith>It configures the link. Each config is a different tcp port. So say port 3000 is 19.2k and 3001 is 115k. Or whatever you want
<ft>I see.
<ft>Good to know that such a thing exists. :)
<dsmith>ft, Ya I use it constantly.
<civodul>wingo: great, great blog article, from theory to implementation, with insight on the thought process
<civodul>i liked it!
<wingo>thanks!
<civodul>intset/intmap looks very nice
<wingo>yeah i'm excited about them
<wingo>i want to implement a hash map along those same lines
<wingo>clojure's PersistentHashMap.java is nice
<wingo> https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/PersistentHashMap.java
<wingo>anyway, will wait until i need it tho :)
<jcca>ft: now it works! thanks!
<ft>jcca: What was the problem? :)
<jcca>ft: I have used (define tty (open-file "/dev/ttyACM0" "r+l")) and (force-output tty)
<civodul>wingo: i can understand why you'd wait ;-)
<wingo>:)
<wingo>they have this "transient" vs "persistent" thing
<wingo>you can take a persistent array "transient", which will make a copy of it
<wingo>semantically anyway
<wingo>i think it might be a lazy copy
<civodul>ok
<wingo>anyway once the sub-tree you want to edit has been made transient you can mutate it
<wingo>then clear the transient flag and it's persistent again
<phallic_elbegast>Clojure also has list? in constant time.
<civodul>wingo: fun
<phallic_elbegast>Scheme is heavily starting to show the warts of being an old language that at some point needs to start over.
<wingo>can be useful for performing a number of additions, etc on a tree where it's just one thread that has the tree
<civodul>an imperative/functional mix of some sort
<wingo>yeah
<wingo>i don't know if the transient bit is actually exposed to clojure
<wingo>or if it's just under the hood
<wingo>i think it might just be under the hood tbh
<wingo>so it doesn't actually expose mutation to the clojure language
<phallic_elbegast>It does actually.
<phallic_elbegast>You can use transients to write functions which mutate data internally but don't leak it so outwardly are pure.
<phallic_elbegast>Basically like Haskell's state monad.
<DerGuteMoritz>wingo: you have to use different functions to operate on transients
<wingo>neat
*wingo stands corrected :)
<DerGuteMoritz>wingo: it also enforces that you only mutate it in a single thread
<wingo>yes, i did see that
<civodul>interesting
<DerGuteMoritz>wingo: btw, this might be easier to port than the Java implementation: https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L4668
<wingo>interesting also that they pay the penalty for that thread marker in all data structures
<phallic_elbegast>Honestly, I feel you can always allow a more restricted form of mutation which does not come with the caveats of normal mutation. Being unable to update any variable from an outer scope gives you much of the capacity of mutation already but little of the caveats.
<DerGuteMoritz>at least it was for me
<wingo>DerGuteMoritz: heh, i actually find it easier to read the java ;-)
<DerGuteMoritz>wingo: heh, well with a few macros the cljs implementation can be ported almost mechanically!
<wingo>better to share ideas than implementation, methinks ;)
<DerGuteMoritz>my chicken port of the cljs implementation: https://bitbucket.org/DerGuteMoritz/persistent-hash-map/src
<wingo>nice!
<DerGuteMoritz>wingo: agreed, I also diverged from the API a lot to make it more Schemely
<DerGuteMoritz>ebut the innards are rather similar
<wingo>yeah, they can't help but be similar...
<DerGuteMoritz>anyhow, will take a look at your blog post, sounds cool!
<DerGuteMoritz>oh it's not on your blog, is it?
<wingo>well, i linked to the intset thing from there
<wingo>it's more like clojure's vectors except it's more like a sparse bitset than an array
<wingo>similarly for intmap -- like a hashmap but with integers as keys instead
<DerGuteMoritz>ah, I mistook the flow analysis post for a post I thought I already knew
<wingo>haha, such verbiage, it all looks the same ;)
<civodul>:-)
<DerGuteMoritz>you are in a twisty maze of words, all alike
<ArneBab>wingo: a very nice article! Thank you for sharing your insights!
<ArneBab>I have two small nitpickings: there’s a typo (during while) and the graphs only use color to distinguish the signs which did not really work on my black-and-white printout. You could switch that to using different shapes - for 3 datasets you could for example use filled triangles, outline circles and a crosses/plusses.
<ArneBab>wingo: on the first plot it looks like the intset actually follow the bitvectors. Here it would be interesting to have more datapoints for n > 1024.
<ArneBab>wingo: a very nice article! Thank you for sharing your insights!
<ArneBab>I have two small nitpickings: there’s a typo (during while) and the graphs only use color to distinguish the signs which did not really work on my black-and-white printout. You could switch that to using different shapes - for 3 datasets you could for example use filled triangles, outline circles and a crosses/plusses.
<ArneBab>wingo: on the first plot it looks like the intset actually follow the bitvectors. Here it would be interesting to have more datapoints for n > 1024.
<wingo>i suppose it does look like that
<wingo>see http://wingolog.org/pub/flow-analysis-size-comparison-unlimited.png
<wingo>ArneBab: ^
<ArneBab>there are only 3 datapoints above 1024, that’s what worries me a bit
<ArneBab>actually 2
<wingo>hmm concern trolling ;)
<ArneBab>wingo: not intentional, just trained pattern recognition ☺
<ArneBab>(I’d be wary of using this as base for argumentation)
<ArneBab>(actually only the part above 1024)
<ArneBab>(and the part below 1024 looks like intsets have a linear part)
<ArneBab>wingo: would it take you long to run this through 1 or 2 other big files?
<wingo>yep, i'd have to recreate things -- if all you're worried about is flow analysis performance in size or time, it's easy enough to measure it without comparing to other things
<wingo>the linear parts are due to the tree levels
<ArneBab>then don’t worry about my concerns - they are mostly academic because as you said, you’ll see the result anyway.
<dsmith-work>Happy (virtual) Friday, Guilers!!
<ArneBab>
<wingo>hehe
*dsmith-work has off the enxt two days...
<ArneBab>nice!
<davexunit>wow, Eli has been doing a lot of work on getting Guile to work on Windows.
<DeeEff>what's the status for guile on windows currently?
<davexunit>I don't know, I have never used it on windows. it seems to be not great, but getting better.
<DeeEff>last I remember I couldn't get it to compile outside cygwin, which still required installing several libraries.
<DeeEff>it'd be nice if it worked with just mingw or something
<wingo>moo
<daviid>hello guilers!
<wingo>heya daviid :)
<daviid>DeeEff: http://lists.gnu.org/archive/html/guile-devel/2014-06/, you can follow and grab a very good isea on how are things, but they are pretty good, thanks Eli!
<daviid>heya wingo!
<daviid>today i'll write the patches for guile-gnome and guile-clutter devel, i'm alçmost done with clutter 1.12.2 now, i was very happy to wrap clutter_image_set_data by myself :)
<daviid>almost done with the wrap side, but still to lot to for the documentation side
<wingo>excellent :)
<daviid>tx!
<daviid>wingo: for info, i sent 2 [pending] requests on savannah for membership [guile-cairo and g-wrap [reference manual pages]]
<wingo>cool, will look at that!
<daviid>tx
<DeeEff>daviid: indeed, things are progressing well. Thanks Eli!
<ArneBab>daviid: wow