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! <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 <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. <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. <nalaginrut>btw, it's very easy to write plugins for your bot <aidalgol>Now we need to migrate sneek to guile-irc. <nalaginrut>ArneBab: do you see my message this morning ? ;-) <nalaginrut>IIRC sneek uses DB, but my bot use file for leaving msg <nalaginrut>well, there're reasons not to release things, not evil <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. <aidalgol>welp, I have to head off. thanks for letting me know about guile-irc. :) <lloda><mark_weaver> (I've never used arrays myself. I tend to use nested vectors <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><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><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><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><ArneBab> Efficient representation scheme for multidimensional array <lloda><ArneBab> works on lists of lists… <lloda><mark_weaver> basic matrix operations on lists of lists can be coded very <lloda><ArneBab> I saw that - quite impressive [22:57] <lloda><ArneBab> is there a canonical way to represent hash-maps? <lloda><ArneBab> (I really mean canonical - I read about a way in the info pages) <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><ArneBab> (there is the hash-table, but why use them over alists? - <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><ArneBab> so for vhashes you can have multiple datasets share the same memory? <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><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><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><mark_weaver> now you can extend it like so: (define alist2 (cons '(plum <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><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 :) <ArneBab>wisp as html template sounds like a cool idea! <ArneBab>nalaginrut: it extends the guile reader. You can get, bootstrap and run it like this: <ArneBab>tar xf wisp-0.8.0.tar.gz ; cd wisp-0.8.0/; <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 <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: you might have to switch languages directly before reading a wisp file and switch back to scheme afterwards. <nalaginrut>for the template, I just need the reader transform it to SXML, then the rest is easy <nalaginrut>but I have to think about how to embedded Scheme code within <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. <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 <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 <lloda>ArneBab: or (from A 1 (range 2 7)), I think <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>nalaginrut: yes… (after all, I’m writing wisp because the parens scared me in the beginning ☺) <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. <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 <ArneBab>tar xf wisp-0.8.1.tar.gz ; cd wisp-0.8.1/; <ArneBab>guile -L . --language=wisp tests/factorial.w; echo <unknown_lamer>pattern matching on hash tables would make guile-json way easier to use *unknown_lamer has been hacking too much SML, and sees everything as a pattern matching problem now ;) <unknown_lamer>unfortunately, I think /. is suffering from death by phb right now :( <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>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>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... <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>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>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>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>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) <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>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!