IRC channel logs

2013-09-04.log

back to list of logs

***didi is now known as bremmer
<davexunit>I see that there's no hash table literal syntax. should I just use alist->hash-table instead?
<dje42>Something like that.
<davexunit>but that's in srfi-69
<davexunit>will that be the same type of hash table that make-hash-table returns?
<davexunit>nope.
<davexunit>damn.
<dje42>seems like a custom alist->hash-table is easy enough to write
<davexunit>yeah
<nalaginrut>morning guilers~
<nalaginrut>dsmith: take advantage of irregex ;-)
<nalaginrut>dsmith: but the key point is string-concatenate, I dropped 'format' and 'string-join'
<nalaginrut>string-concatenate is the fastest way to append strings
<dsmith>nalaginrut, Ah.
<dsmith>nalaginrut, I always wondered if this was actually a performant idea: http://srfi.schemers.org/srfi-13/mail-archive/msg00073.html
<nalaginrut>dsmith: but I didn't use SXML template, it's embedded template just like Django does
<nalaginrut>so it's all about string
<dsmith>nalaginrut, It's in guile in the (sxml transform) module
<nalaginrut>what? embedded template?
<dsmith>nalaginrut, read the comment about SRV:send-reply
<nalaginrut>well, the embedded template is nothing to do with list
<dsmith>ok
<nalaginrut>it's all about string parsing and split and concatenate
<nalaginrut>anyway, Artanis provide SXML template as well
<nalaginrut>;-)
<dsmith>The point of that link is that instead of concatenating and appending strings together, you just cons them onto a list.
<dsmith>And then later, you walk the list display'ing them in order.
<nalaginrut>well, there's difference
<nalaginrut>since all the tags are strings
<nalaginrut>not alist
<nalaginrut>and yes I could generate alist then call sxml->xml
<nalaginrut>but this way is not efficiency
<dsmith>instead of appending or concatanting strings, you cons the strings onto a list. A list of strings.
<dsmith>I wonder if it saves anything.
<nalaginrut>no, I think you misunderstand
<dsmith>You have less string grabage.
<nalaginrut>I didn't generate SXML
<dsmith>IT's got nothing to do with sxml
<dsmith>other than that's the module it's in.
<nalaginrut>so you mean a list of strings then calling string-concatenate?
<nalaginrut>but the test result speak truth
<nalaginrut>6.55s vs 0.5s
<dsmith>yeah, but instead of string-conatenate, you loop over the list calling display for each.
<nalaginrut>no, I can't just display it
<dsmith>Ok.
<dsmith>Nevermind
<nalaginrut>I have to concatenate all strings, then call eval-string
<dsmith>Ok.
<nalaginrut>or you mean call-with-output-string?
<dsmith>Well, that would work
<nalaginrut>yes, I confess call-with-output-string does the work
<nalaginrut>but there's difference
<dsmith>But then you are just moving the string catenate to the string port.
<nalaginrut>mark_weaver wrote a 'optimize' procedure for some kind of optimization, it removed redundant things ,then concatenate rest strings
<dsmith>Nice
<nalaginrut>it's a very efficient optimization according to the test, so I can't just use call-with-output-string
<nalaginrut>that's the story ;-)
<nalaginrut>if there's no 'optimize', I think your method is a good choice
<nalaginrut>anyway, let me review the code again, maybe there's room for optimization, thanks for mention it ;-)
<nalaginrut>hmm...seems not so easy to get rid of string-concatenate from 'optimize', I'll give it up, the efficiency is accepted anyway
<wingo>moin
<ijp>yo
<nalaginrut>yo
<ijp>aidalgol: how do I make the bot return multiple lines of output?
<ijp>I had assumed a \\n would do, but since send-privmsg is just a format, that's wrong, and means I'm actually sending malformed irc requests
*ijp tries to comes up with a very strange conspiracy that leads to this injection problem actually being exploited
<aidalgol>shit, that means you could make the bot disconnect!
<aidalgol>Time to fix that function!
<ijp>well, it hasn't broken yet
<aidalgol>Or, possibly not. Might just be rejected by the server.
<ijp>I should have turned on logging for the responses
<nalaginrut>noah's guile-lightening seems a bit strange, we don't have foreign-ref and dynamic-pointer accepts only 2 params
<nalaginrut>parameters
<ijp>I expect it has succumbed to bit-rot
<nalaginrut>oops, he claimed "it doesn't work"...
<nalaginrut>alright, so we don't have lightening binding
<dsmith-work>Hej
<wingo>ohai
<wingo>mark_weaver: http://compilers.cs.ucla.edu/fernando/publications/papers/PhdDiss.pdf
<wingo>yummmmy
<wingo>you could think of our calling convention as pre-coloring certain slots...
<wingo>will be nice to get to native compilation at some point :)
<Arne`>PyPy shows an example of Multi-Languages, too: http://morepypy.blogspot.de/2013/08/slides-of-pypy-london-demo-evening.html — thought that might be interesting to you, since the goal seems similar to guile.
<dje42>I see scm_puts in the api, but I can't find scm_printf.
<ijp>there is no such thing
<dje42>Bummer. There should be.
<dsmith-work>dje42: You are probably wanting scm_simple_format
<ijp>you should be able to access the format procedure though
<dje42>scm_simple_format takes all SCMs, it would be REALLY NICE to have void scm_printf (SCM port, const char *format, ...);
<dje42>[might want to call that scm_c_printf, but since scm_puts is not named scm_c_puts, I went with scm_printf :-)
<ijp>guile's format does not use the same format specifiers as C
<didi>♪ write in scheme, write in scheme ♫
<dje42>righto. Still, if you want to make it easy for people to add libguile to programs, scm_c_printf would be really nice.
<dsmith-work>and simple-format only knows ~a and ~s
<stis>evening folks!
<dsmith-work>The fat format is written in scheme.
<dsmith-work>Heya stis
<ijp>if you can call it scheme
<ijp>I'd rather we call it formatese
<dsmith-work>s/written/implemented/ ??
<shanecelis>hello, with procedures I can add properties. Is there any way to add meta data to variables? I'm thinking about this for documentation purposes in Emacsy.
<wingo>not really
<wingo>there is object-documentation, but that is associated with values
<wingo>rather than with variables
<shanecelis>Any recommendations for replicating Emacs's (defvar name [value [doc-string]])?
<wingo>you can set object properties on the variable object
<wingo>search the manual for module-variable
<wingo>you'll have to write your own utils to get that documentation out, but it would be there
<shanecelis>wingo: Great. Thanks!
<wingo>the docs could be (or (object-documentation the-var) (object-documentation the-val))
<davexunit>what are object properties typically used for?
<wingo>associating info with things you don't control
<wingo>or associating sparse information
<wingo>anywhere you would use a weak hash table
<wingo>they are essentially the same
<stis>shancelis, you can add documentation to syntax objects if you like as well
<stis>it will not associate to the values though.
<stis>for this there is two options as I know of
<stis>1. In syntax parse there is a map framewotk from syntax objects to data
<stis>2. in guile-cl, there is a put and get macro that works similarly like common lisps put and get
<stis>but should bind to syntax objects in stead of symbols
<stis>shanecelis: ^^
<shanecelis>stis: Cool. Thanks for the tip!
*stis did a really cool hack with scheme-sed, read guile-user!!
<stis>mailing list!
<stis>anyway cheers and good night!