IRC channel logs

2014-11-19.log

back to list of logs

<mark_weaver>but I find that when I use hash tables, my code necessarily takes on an imperative style, which I dislike.
<davexunit>I like to keep hash tables hidden in the background as a caching layer to a functional program.
<mark_weaver>yes, when they can be hidden in a lower layer, it doesn't bother me so much.
<ArneBab>I need to get going - thank you for sharing!
<mark_weaver>okay, happy hacking!
<nalaginrut>morning guilers~
<cky>\\o
<nalaginrut>ArneBab: I wonder if anyone will use the underscore
<nalaginrut>ArneBab: but an idea struck me a lot that I may use wisp for building SXML which could be a nicer HTML template
<nalaginrut>just like slim-lang of RoR http://slim-lang.com/
<aidalgol>My iptables rules seem to be interfering with my Guile networking code, and the backtrace is not shedding much light on the problem: http://paste.grml.org/2337/
<aidalgol>I'm trying to connect to freenode, and I can do it through netcat, on the same port, so I'm not sure what spells is doing differently.
<aidalgol>If I flush my iptables rules and run the program, it can connect, so it's definitely that.
<aidalgol>This is where the connection is initiated in the program: https://gitlab.com/aidalgol/cunning-bot/blob/master/bot.scm#L120
<nalaginrut>I don't know the problem, but seems the second arg of connect shouldn't be #<undefined>
<aidalgol>Yeah, that looks weird, but I don't know what's causing that to be undefines.
<aidalgol>*undefined
<aidalgol>I may have to dive into spells
<nalaginrut>oh, you use spells
<nalaginrut>why not just try guile-irc?
<nalaginrut>or you have to wrap many irc stuffs
<aidalgol>wait, there's a guile irc library now?
<nalaginrut>yes https://github.com/fbs/guile-irc
<nalaginrut>and I've written a bot for my community
<nalaginrut>it works well, everyday ;-)
<aidalgol>Well this is new...
<aidalgol>so someone beat me to it.
<aidalgol>I'm not bitter! :P
<nalaginrut>;-P
<aidalgol>fbs frequents this channel, right?
<nalaginrut>btw, it's very easy to write plugins for your bot
<aidalgol>using guile-irc?
<nalaginrut>dunno, seems fbs is not here at present
<nalaginrut>aidalgol: of course!
<aidalgol>cool!
<nalaginrut>there're various kind of hooks for the message
<nalaginrut>aidalgol: https://github.com/szdiy/eliug
<nalaginrut>it's my bot
<aidalgol>sneek: later tell ijp fbs beat us to writing a pure Guile bot, and it appears to do what we wanted cbot to do: https://github.com/fbs/guile-irc
<sneek>Got it.
<aidalgol>Now we need to migrate sneek to guile-irc.
<nalaginrut>aidalgol: yes, it's easy I think
<nalaginrut>ArneBab: do you see my message this morning ? ;-)
<aidalgol>sneek source
<sneek>I've heard source is at http://git.savannah.gnu.org/gitweb/?p=guile.git
<aidalgol>sneek: source
<sneek>Last time I checked source is at http://git.savannah.gnu.org/gitweb/?p=guile.git
<aidalgol>oops...
<aidalgol>I'm after the source for sneek.
<nalaginrut>IIRC sneek uses DB, but my bot use file for leaving msg
<nalaginrut>aidalgol: I think it's never released
<aidalgol>ah
<aidalgol>EVIL!
<aidalgol>Who runs sneek?
<nalaginrut>well, there're reasons not to release things, not evil
<aidalgol>I know, I was kidding.
<nalaginrut>I keep many project unreleased, actually
<nalaginrut>most of reasons are 'not ready'
<nalaginrut>;-)
<aidalgol>So who should I talk to about moving sneek to guile-irc?
<aidalgol>ISTR it's using bobot++, which is written in C++ and Guile.
<aidalgol>So it may be feasible to adapt the Guile parts of sneek to use guile-irc.
<nalaginrut>we don't need c++ for it anymore
<nalaginrut>pure Scheme is powerful enough
<aidalgol>is sneek already pure scheme?
<nalaginrut>I guess it contains some c++, if it uss bobot++
<aidalgol>welp, I have to head off. thanks for letting me know about guile-irc. :)
<lloda> [22:45]
<lloda><mark_weaver> oops, sorry
<lloda><mark_weaver> (I've never used arrays myself. I tend to use nested vectors
<lloda> instead) [22:47]
<lloda><mark_weaver> or even just nested lists, if I don't need O(1) lookups
<lloda><ArneBab> I did not know about the syntax for multi-dimensional arrays. It
<lloda> looks like I could use them for matrix stuff. [22:48]
<lloda><mark_weaver> yes, they are well suited for matrices and tensors, obviously
<lloda> [22:49]
<lloda><ArneBab> The syntax looks a bit unusual, though.
<lloda><sg2002> mark_weaver: I started with nested vectors but people here suggested
<lloda> that they'd work better in my case. :-)
<lloda><ArneBab> (giving the dimensions as prefix)
<lloda><ArneBab> mark_weaver: is the performance of multi-dimensional arrays
<lloda> acceptable for bigger matrix calculations? [22:50]
<lloda><mark_weaver> these are all questions for lloda
<lloda><mark_weaver> my knowledge of guile arrays is very weak.
<lloda><davexunit> for my case, 2d/3d realtime graphics, guile's arrays were too
<lloda> slow, unfortunately.
<lloda><davexunit> but for your case they might be just fine! I was trying to do
<lloda> thousands of 4x4 matrix mults at 60FPS [22:51]
<lloda><mark_weaver> individual vectors operations are definitely much faster in the
<lloda> current implementation. they have dedicated VM instructions,
<lloda> and of course they don't have to worry about things like
<lloda> arbitrary numbers of indices, etc. [22:52]
<lloda><mark_weaver> however, I see no reason why array operations couldn't be made
<lloda> very fast in the future.
<lloda><ArneBab> davexunit: I might have to do matrix inversion, so speed could
<lloda> become an issue. Though thousands of operations per second will
<lloda> hopefully be some time away :) [22:53]
<lloda><ArneBab> My search for efficient multi-dimensional arrays just turned up
<lloda> something which might be useful for this:
<lloda> http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.101.7531
<lloda> [22:54]
<lloda><ArneBab> Efficient representation scheme for multidimensional array
<lloda> operations (2002)
<lloda><ArneBab> hm… http://rosettacode.org/wiki/Matrix_multiplication#Scheme [22:56]
<lloda><ArneBab> works on lists of lists…
<lloda><mark_weaver> basic matrix operations on lists of lists can be coded very
<lloda> concisely in scheme.
<lloda><ArneBab> I saw that - quite impressive [22:57]
<lloda><ArneBab> is there a canonical way to represent hash-maps?
<lloda><ArneBab> (key-value data)
<lloda><ArneBab> (I really mean canonical - I read about a way in the info pages)
<lloda> [22:58]
<lloda><mark_weaver> guile has association lists, hash tables, and vhashes. [23:01]
<lloda><ArneBab> I think my main problem is when to choose which.
<lloda><mark_weaver> well, it depends on what kinds of operations you need to do
<lloda> quickly.
<lloda><ArneBab> (there is the hash-table, but why use them over alists? -
<lloda> https://www.gnu.org/software/guile/manual/html_node/Hash-Table-Reference.html)
<lloda><mark_weaver> association lists and vhashes allow you to extend a mapping
<lloda> without destroying the original. [23:02]
<lloda><mark_weaver> hash tables are fundamentally mutable, there's no good way to
<lloda> extend one without mutating an existing one. but they are very
<lloda> fast.
<lloda><ArneBab> so for vhashes you can have multiple datasets share the same memory?
<lloda> [23:03]
<lloda>*** bu^ (~bla@neu67-3-82-239-83-209.fbx.proxad.net) has quit: Quit: Leaving
<lloda><mark_weaver> multiple "datasets"? I find that a confusing question. [23:04]
<lloda><mark_weaver> vhashes act a lot like association lists, except that they will
<lloda> perform much better for huge dictionaries.
<lloda><mark_weaver> alists perform well for small dictionaries. [23:05]
<lloda><ArneBab> mark_weaver: with datasets I meant sharing parts of the memory on
<lloda> datastructures in different parts of the program, though these
<lloda> different parts of the program see different content for the
<lloda> datastructures. [23:07]
<lloda><ArneBab> (reusing memory for the parts which are the same) [23:08]
<lloda><mark_weaver> alists, vhashes, and normal scheme lists all support sharing of
<lloda> the "tails".
<lloda><mark_weaver> (define a '(x y z))
<lloda><mark_weaver> (define b (cons 'b a)) [23:09]
<lloda><ArneBab> how do you define sharing of the tail in a vhash? The value part?
<lloda><mark_weaver> (define c (cons 'c a))
<lloda><mark_weaver> now, the lists a b and c all share a common tail.
<lloda><ArneBab> ah, no: vhash-cons key value vhash [hash-proc]
<lloda><mark_weaver> alists are nothing more than lists of pair.s
<lloda><mark_weaver> so (define alist1 '((rose . red) (violet . blue) (banana
<lloda> . yellow))) [23:10]
<lloda><mark_weaver> now you can extend it like so: (define alist2 (cons '(plum
<lloda> . purple) alist1)) [23:11]
<lloda><mark_weaver> now alist1 and alist2 share a common tail.
<lloda><mark_weaver> the API for vhashes is essentially the same as for alists, and
<lloda> they behave essentially the same, except that lookups are faster
<lloda> for very large dictionaries. [23:12]
<lloda><mark_weaver> but for smaller dictionaries they will be slower.
<lloda><mark_weaver> unfortunately, it is usually the case that algorithms and data
<lloda> structures that work well for large cases tend to be slower for
<lloda> smaller ones. [23:13]
<lloda><dsmith-work> mark_weaver: Any idea of the "very large" and "smaller"
<ArneBab>nalaginrut: I see your message, but I’m only at a keyboard (and awake) now :)
<nalaginrut>ArneBab: anyway, it's possible
<ArneBab>wisp as html template sounds like a cool idea!
<nalaginrut>is it supported by Guile now?
<ArneBab>nalaginrut: it extends the guile reader. You can get, bootstrap and run it like this:
<ArneBab>wget https://bitbucket.org/ArneBab/wisp/downloads/wisp-0.8.0.tar.gz;
<ArneBab>tar xf wisp-0.8.0.tar.gz ; cd wisp-0.8.0/;
<ArneBab>./configure; make check;
<ArneBab>guile -L . --language=wisp tests/factorial.w; echo
<ArneBab>lloda: can you give a hint about the performance of multidimensional arrays?
<ArneBab>nalaginrut: though I did some bugfixes which aren’t released yet - I plan to do a 0.8.1 before the SRFI.
<ArneBab>nalaginrut: the plan is to do the SRFI and then to ask for inclusion of wisp in guile :)
<nalaginrut>well, I think I have to find a way to integrate it to Artanis
<nalaginrut>then provide the template
<nalaginrut>template engine
<nalaginrut>no hurry
<nalaginrut>;-)
<lloda>ArneBab: it's generally bad, but as mark_weaver says, it's nothing fundamental.
<lloda>all the array ops are in C and the array descriptor is in C, so it's all opaque to the Scheme compiler.
<lloda>plus the array ops are type-generic, so there's type dispatch on nearly every array operation.
<lloda>more than is needed even going through C, in fact.
<ArneBab>nalaginrut: :)
<ArneBab>nalaginrut: you might have to switch languages directly before reading a wisp file and switch back to scheme afterwards.
<ArneBab>lloda: ok, thanks!
<nalaginrut>for the template, I just need the reader transform it to SXML, then the rest is easy
<nalaginrut>the designer don't want to write SXML I believe
<nalaginrut>but I have to think about how to embedded Scheme code within
<nalaginrut>maybe a special tag
<ArneBab>then you’d just need to call wisp-scheme-read-file
<nalaginrut>well, the interesting thing is that, wisp may provide multi-lang
<lloda>Arnebab: the trick is using whole-array ops as much as possible. You can't do a transpose or a column slice in constant time using nested vectors, just as one example.
<ArneBab>nalaginrut: the wisp reader just does this: https://bitbucket.org/ArneBab/wisp/src/763aab6344366fabd9937088c80341f55f26f6bd/wisp-reader.w?at=default#cl-54
<ArneBab>lloda: ah, yes
<nalaginrut>I mean a 'scheme' tag, and 'lua' tag, when it's rendered, the code could be eval with multi-lang feature ;-P
<ArneBab>lloda: are there operations for the slices?
<nalaginrut>hmm...but how can I eval the code in 'scheme' tag...
<ArneBab>nalaginrut: since scheme is taken literally by wisp (all parenthesized code is simply read with (read port), that could be quite convenient.
<lloda>Arnebab: you mean on the slices, or to take slices?
<nalaginrut>oh, yes, maybe we don't need to provde Scheme code within
<ArneBab>nalaginrut: maybe you could define a macro which wraps the code accordingly?
<nalaginrut>just a new syntax for designer (actually, wisp itself)
<ArneBab>lloda: I mean take slices: row 1, column 2-6
<nalaginrut>I've no idea now, I need to think about it
<lloda>ArneBab: right. In Guile itself, there's only one, make-shared-array.
<ArneBab>nalaginrut: no probs - I’m glad it got you ideas!
<ArneBab>lloda: ah, and then you call out into C libraries?
<lloda>ArneBab: In guile-ploy, you can do (from A 1 (J 4 2)) to take row 1 & cols 2-6
<nalaginrut>ArneBab: someone once asked me if I can provide slim-lang like thing, I told him no, how about SXML, then it scare him
<nalaginrut>frighten
<lloda>ArneBab: or (from A 1 (range 2 7)), I think
<nalaginrut>we can't force designer accept SXML, so sad
<lloda>ArneBab: you can also do (from A 1 #(2 3 4 5 6)), but that returns a new array, since the indices can be arbitrary
<lloda>ArneBab: I'll try to get (from ...) into Guile, at some point
<ArneBab>lloda: oh, cool!
<ArneBab>nalaginrut: yes… (after all, I’m writing wisp because the parens scared me in the beginning ☺)
<nalaginrut>yes, template lang is the co-product
<lloda>ArneBab: yes, I mostly call into C. For your own code, it's pretty easy. For libraries, it varies. Best I've dealt with is FFTW.
<ArneBab>lloda: ok, thanksk!
<ArneBab>thanks
<xyh>hi friends :) may I ask how the GC of guile get implemented ? is it a copy-compress-GC ? or mark-swap-GC ? and is it incremental ? well, I just wish to learn something about GC from guile :P
<lloda>xyh: https://www.gnu.org/software/guile/manual/html_node/Conservative-GC.html
<xyh>lloda: thx
<civodul>Hello Guilers!
<artyom-poptsov>Hi civodul
<dsmith-work>Morning Greetings, Guilers
<ArneBab>moin dsmith-work ☺
<ArneBab>wisp v0.8.1 released with reader bugfixes. Everything prepared for the SRFI, now: http://draketo.de/light/english/wisp-lisp-indentation-preprocessor#v0.8.1
<ArneBab>wget https://bitbucket.org/ArneBab/wisp/downloads/wisp-0.8.1.tar.gz;
<ArneBab>tar xf wisp-0.8.1.tar.gz ; cd wisp-0.8.1/;
<ArneBab>./configure; make check;
<ArneBab>guile -L . --language=wisp tests/factorial.w; echo
<unknown_lamer>hrm...
<unknown_lamer>pattern matching on hash tables would make guile-json way easier to use
<unknown_lamer>maybe I should just convert json into sxml instead
*unknown_lamer has been hacking too much SML, and sees everything as a pattern matching problem now ;)
<dsmith-work>unknown_lamer: Are you still doing the /. stuff?
<unknown_lamer>nah, ended up getting a job as a sysadmin recently
<unknown_lamer>quite a bit more work... no glory... way more money ;)
<unknown_lamer>unfortunately, I think /. is suffering from death by phb right now :(
<unknown_lamer>final stages of an incurable sickness
<unknown_lamer>it turns out there was so much management churn, they had me confused with roblimo and never wanted to hire me because they assumed I was like 70 years old :-X
<unknown_lamer>all the while going "we need to reconnect with a younger crowd, who do we know in their 20s..."
<unknown_lamer>it hurt
<unknown_lamer>the best part is when I announced I was leaving they asked me how much I wanted to stay, and then countered with half of what I asked... which was already like 60% of what I got here :(
<unknown_lamer>such a sad end to what could have been an awesome job
<unknown_lamer>that offer stung particularly much, because the counter offer was for 4x the work I was doing and like 1.2x the pay
<unknown_lamer>like jeez, you could have just told me you didn't like me...
<dsmith-work>unknown_lamer: Hah!
<unknown_lamer>ex-microsoftie is the "ceo" of the media division now
<unknown_lamer>incompetence and hand waving crap the entire way up the chain :(
<unknown_lamer>one nice effect of this is that I know the warning signs to watch out for in the future...
<dsmith-work>Ah well. /. has been going down hill ever since then removed "on the" in their byline.
<unknown_lamer>on the? or from the?
<unknown_lamer>or the news for nerds. stuff that matters. part
<unknown_lamer>it's also ... ugh
<unknown_lamer>there's a reason I had to find a new job :(
<unknown_lamer>I think I developed a moderate case of actual factual depression from how frustrating and despair inducing working with a few folks there was
<unknown_lamer>like ... get out of my way, I know what I'm doing and you do not and are stifling all attempts at making this not suck
<unknown_lamer>two years of just being told "no." gets to you
<unknown_lamer>also seeing suggestions I made implemented at other sites, successfully, more than once
<dsmith-work>Used to be "News for Nerds on the Stuff that Matters."
<unknown_lamer>ah, ... that had to be a looooong time ago
<dsmith-work>Late 90's
<unknown_lamer>I've basically switched to using tt-rss to read all of my sources for slashdot instead of reading slashdot :(
<unknown_lamer>maybe I should add slashdot to my feed reader now that I am not the one posting the news heh
<dsmith-work>unknown_lamer: So you working with SML now? You'll be a Haskeller in no time.
<unknown_lamer>mostly for http://wiki.hcoop.net/DomTool
<unknown_lamer>it has taken years of casual hacking, but I think I ... get it?
<unknown_lamer>I was able to discover a horrible bug in the interpreter that made permissions meaningless :(
<unknown_lamer>actually kind of funny... wasn't capturing the lexical environment for val declarations
<unknown_lamer>I need to implement subtyping in domtool, but subtyping is Very Complicated (tm)
<unknown_lamer>I've also been distracted by writing an led controller daemon in guile (it's gotten fancy enough I'm going to bother with putting it online)
<ArneBab>unknown_lamer: thinking that you worked on the site which defined the term slashdotted as “killed by too much interest” - wow
<ArneBab>(and it’s pretty sad that it went down)
<ArneBab>(-hill)
<unknown_lamer>I should probably submit some stories
<unknown_lamer>there's a great team, it's just that all resources are forced into whatever stupid idea this quarter's product manager has
<unknown_lamer>instead of the multiple year long actual-things-that-could-be-improved list
<ArneBab>:(
<ArneBab>sneep: later tell nalaginrut: I now created the last release before the SRFI, so I’d be very interested in your comments on the parts you already read!
<ArneBab>sneek: later tell nalaginrut: I now created the last release before the SRFI, so I’d be very interested in your comments on the parts you already read!
<sneek>Got it.
<ArneBab>sneek: botsnack
<sneek>:)
<ArneBab>sneek: later tell nalaginrut: did you think of something like this? http://draketo.de/proj/wisp/src/474cedeb0f8ec4bcab5c7a7f84f3b427e80d9109/tests/sxml.w.html
<sneek>Got it.
<ArneBab>sneek: later tell nalaginrut: or like this (more complex version): http://draketo.de/proj/wisp/src/648454658765b918dc03cccfbb6513dc9803d647/tests/sxml.w.html
<sneek>Will do.
<ArneBab>sneek: botsnack
<sneek>:)