2013-06-03T03:16:23 *** Areks has joined #aichallenge 2013-06-03T03:19:15 *** Areks|2 has quit IRC (Ping timeout: 260 seconds) 2013-06-03T03:53:40 *** mviel has joined #aichallenge 2013-06-03T04:15:06 *** amstan has quit IRC (Ping timeout: 264 seconds) 2013-06-03T04:48:52 *** epicmonkey has joined #aichallenge 2013-06-03T04:53:50 *** dici has joined #aichallenge 2013-06-03T05:26:50 *** amstan has joined #aichallenge 2013-06-03T05:26:50 *** ChanServ sets mode: +o amstan 2013-06-03T05:54:29 *** AlliedEnvy has quit IRC (Read error: Connection reset by peer) 2013-06-03T06:02:54 *** binw__ has quit IRC (Read error: Connection reset by peer) 2013-06-03T06:08:06 *** binw has joined #aichallenge 2013-06-03T06:09:54 *** Accoun has quit IRC (Ping timeout: 256 seconds) 2013-06-03T06:13:23 *** epicmonkey has quit IRC (Ping timeout: 276 seconds) 2013-06-03T06:14:44 *** epicmonkey has joined #aichallenge 2013-06-03T06:28:33 *** AlliedEnvy has joined #aichallenge 2013-06-03T06:34:06 *** Accoun has joined #aichallenge 2013-06-03T08:08:28 *** meduza_ has joined #aichallenge 2013-06-03T08:41:05 *** mleise has quit IRC (Quit: Leaving.) 2013-06-03T09:32:56 *** amstan has quit IRC (Quit: Konversation terminated!) 2013-06-03T09:48:57 *** thestinger has joined #aichallenge 2013-06-03T09:54:32 *** thestinger1 has joined #aichallenge 2013-06-03T09:57:25 *** thestinger has quit IRC (Ping timeout: 248 seconds) 2013-06-03T10:03:34 *** thestinger1 is now known as thestingetr 2013-06-03T10:03:36 *** thestingetr is now known as thestinger 2013-06-03T11:06:42 *** amstan has joined #aichallenge 2013-06-03T11:06:42 *** ChanServ sets mode: +o amstan 2013-06-03T11:11:51 *** btiberi has joined #aichallenge 2013-06-03T11:55:13 *** kilae has joined #aichallenge 2013-06-03T12:07:18 *** epicmonkey has quit IRC (Ping timeout: 264 seconds) 2013-06-03T12:18:42 *** epicmonkey has joined #aichallenge 2013-06-03T12:27:52 *** epicmonkey has quit IRC (Ping timeout: 252 seconds) 2013-06-03T13:37:02 *** epicmonkey has joined #aichallenge 2013-06-03T13:57:34 *** btiberi has quit IRC (Quit: This computer has gone to sleep) 2013-06-03T14:02:58 *** btiberi has joined #aichallenge 2013-06-03T14:15:41 *** Scooper has joined #aichallenge 2013-06-03T14:17:56 *** thestinger1 has joined #aichallenge 2013-06-03T14:18:16 *** thestinger has quit IRC (Read error: Connection reset by peer) 2013-06-03T14:18:21 *** thestinger1 has joined #aichallenge 2013-06-03T14:19:04 *** thestinger1 is now known as thestinger 2013-06-03T14:39:33 *** mcstar has joined #aichallenge 2013-06-03T14:58:43 mcstar: \o 2013-06-03T14:59:06 mcstar: so apparently I got mleise interested in rust after all because he came to #rust for a while ;p 2013-06-03T15:34:29 *** amstan has quit IRC (Ping timeout: 248 seconds) 2013-06-03T15:34:36 *** amstan has joined #aichallenge 2013-06-03T15:34:36 *** ChanServ sets mode: +o amstan 2013-06-03T16:05:25 thestinger: o/ weird, i3 didnt show the urgency hint 2013-06-03T16:05:45 mcstar: gtk3 terminal? ;p 2013-06-03T16:05:51 gtk3 is broken :( 2013-06-03T16:05:51 no, konsole 2013-06-03T16:05:53 oh 2013-06-03T16:05:56 maybe qt is broken too 2013-06-03T16:06:00 it's actually xinput's fault 2013-06-03T16:06:00 and it worked before 2013-06-03T16:06:09 mcstar: xinput lies about focus events or something 2013-06-03T16:06:15 i saw a workspace change to red previously 2013-06-03T16:06:28 nick me 2013-06-03T16:06:31 mcstar: 2013-06-03T16:06:42 nothing 2013-06-03T16:06:50 ill try the bell in plain terminal 2013-06-03T16:15:33 mcstar: I bet it's this xinput bug 2013-06-03T16:15:38 that gtk3 runs into 2013-06-03T16:15:48 they didn't run into it before because they used some legacy crap in gtk2 2013-06-03T16:18:33 i doubt that 2013-06-03T16:18:53 thestinger: im planning on writing an applet for lxpanel that will cooperate with i3 workspaces 2013-06-03T16:19:25 and im trying out recoll for desktop indexing... 2013-06-03T16:20:23 i think it might be dunst thats causing this issue 2013-06-03T16:22:39 *** kilae has quit IRC (Quit: ChatZilla 0.9.90 [Firefox 21.0/20130511120803]) 2013-06-03T16:27:59 thestinger: the problem might be that i3 doesnt mark the konsole window 'non visible' and so it doesnt send the signal 2013-06-03T16:28:14 ah 2013-06-03T16:37:29 thestinger: well, i set up urxvt and it does give the urgency hint on the bell 2013-06-03T16:42:32 mcstar: well urxvt relies on focus 2013-06-03T16:42:41 not visibility 2013-06-03T16:44:23 thestinger: i just tried under awesome, it does not work 2013-06-03T16:44:52 with urxvt it does, with konsole it doesnt 2013-06-03T16:45:16 but there might be some issue with running 2 X servers 2013-06-03T16:46:46 the weird thing is that i never had a problem with konsole 2013-06-03T16:48:15 does urxvt even support xft? 2013-06-03T16:52:37 mcstar: it supports xft, but not pango/fontconfig 2013-06-03T16:52:49 and it doesn't support unicode6 2013-06-03T16:53:16 thestinger: what terminal do you use? 2013-06-03T16:53:20 termite, ofc ;p 2013-06-03T16:53:20 or is that a stupid question 2013-06-03T16:53:23 :) 2013-06-03T16:53:38 now with no white flickering 2013-06-03T16:53:40 thestinger: urxvt leaves kind of big kerning 2013-06-03T16:53:48 mcstar: that's a known bug that they refuse to fix 2013-06-03T16:53:59 mcstar: rxvt-unicode-patched 2013-06-03T16:54:08 I uploaded that originally when I used it still 2013-06-03T16:54:24 but anyway it won't display a lot of glyphs 2013-06-03T16:54:42 and it needs you to hardcode a font fallback list + manually measure the fallbacks to find the right size that fits in the main font's bounding box 2013-06-03T16:54:58 = fun 2013-06-03T16:55:01 so yeah. I don't know why Archers like urxvt so much 2013-06-03T16:59:47 ill stick to 9term 2013-06-03T17:00:32 ;p 2013-06-03T17:04:38 im undecided between lilyterm and terminology 2013-06-03T17:05:00 pfft, why lilyterm 2013-06-03T17:05:10 terminology at least has the tabular image escapes ;p 2013-06-03T17:05:11 it has a b&w color scheme built in 2013-06-03T17:05:24 it looks good with my b&w starmap with transparency 2013-06-03T17:05:43 I'm sure you can easily copy it to $TERMINAL ;p 2013-06-03T17:06:06 heh 2013-06-03T17:06:10 *** amstan has quit IRC (Ping timeout: 252 seconds) 2013-06-03T17:06:14 *** mleise has joined #aichallenge 2013-06-03T17:07:37 *** amstan has joined #aichallenge 2013-06-03T17:07:37 *** ChanServ sets mode: +o amstan 2013-06-03T17:14:23 *** mcstar has quit IRC (Quit: mcstar) 2013-06-03T17:14:54 *** mcstar has joined #aichallenge 2013-06-03T17:15:02 i decided on terminology 2013-06-03T17:19:51 it has a bit of a startup delay 2013-06-03T17:19:56 but i like its font rendeing 2013-06-03T17:19:58 r 2013-06-03T17:20:43 probably this empty box that represents the cursor and glows on every keystroke will slowly and surely drive me crazy 2013-06-03T17:21:11 Hey I have an awesome, crazy programming idea. 2013-06-03T17:22:06 Someone over at #D wanted to parse DNA sequence files (FASTA files) faster in D. 2013-06-03T17:22:14 lets write artificial intelligence programs in rust 2013-06-03T17:22:25 shootout me 2013-06-03T17:22:29 right now 2013-06-03T17:22:32 So I thought, why not go with the gzipped version of the file and chain algorithms. 2013-06-03T17:22:45 D is not even in the contest 2013-06-03T17:22:50 why does it matter? 2013-06-03T17:23:07 read->decompress->splitlines->filter 2013-06-03T17:23:17 brilliant 2013-06-03T17:23:24 why didnt i think of that earlier 2013-06-03T17:23:26 and all that in multiple threads with minimal copying 2013-06-03T17:23:32 this solves the whole D problem 2013-06-03T17:23:39 which comes after C 2013-06-03T17:23:43 mcstar: are you making fun of me? :D 2013-06-03T17:23:50 yes, as much as possible 2013-06-03T17:24:00 I'm dead serious. 2013-06-03T17:24:08 im unded serious 2013-06-03T17:24:11 . 2013-06-03T17:24:35 ok, Rust and Haskell are great programming languages. 2013-06-03T17:24:39 mleise: well we're going to add a static regexp compiler to the rust stdlib to win the regexp one ;p 2013-06-03T17:24:46 the shootout is all about "cheating" 2013-06-03T17:24:50 hehe 2013-06-03T17:24:54 shootout sucks 2013-06-03T17:24:57 using arenas for the gc benchmark one is standard 2013-06-03T17:24:59 as a benchmark 2013-06-03T17:25:05 but it can give you ideas.... 2013-06-03T17:25:06 thestinger: no, why does Rust steal from everywhere? 2013-06-03T17:25:17 mleise: hm? 2013-06-03T17:25:38 by the way, static compiler needs compile-time function-evaluation and code generation or not? 2013-06-03T17:25:53 mleise: well, syntax extensions 2013-06-03T17:26:04 like the fmt! one 2013-06-03T17:26:12 *** dici has quit IRC (Read error: Connection reset by peer) 2013-06-03T17:26:19 thestinger: Well, Rust takes the best ideas from everywhere and combines them in one language. But that's ok, I'm just kiddind. 2013-06-03T17:26:35 mleise: well yeah :), it steals liberally from erlang/haskell/C++ 2013-06-03T17:26:42 i recently reimplemented a shootout problem in haskell 2013-06-03T17:26:46 from scratch 2013-06-03T17:26:49 but haskell is essentially lazy ML with a more refined type system 2013-06-03T17:26:57 my version was a little slower than the one on the site 2013-06-03T17:27:12 D currently has the fastest regex, because the code is generated at compile-time from the regexp. 2013-06-03T17:27:38 *** amstan has quit IRC (Ping timeout: 256 seconds) 2013-06-03T17:28:49 mleise: the only thing in rust that's really "new" is the lifetime system for borrowed pointers 2013-06-03T17:28:58 but... that's still based on existing language research (region pointers) 2013-06-03T17:29:49 thats not a but 2013-06-03T17:30:05 stealing from research languages or from research is not stealing at all 2013-06-03T17:30:17 thats the whole point of those things 2013-06-03T17:30:20 mcstar: well no other language actually implemented it as rust does 2013-06-03T17:30:29 so no but 2013-06-03T17:30:30 rust's system had to go through many iterations to actually be practical 2013-06-03T17:30:33 mcstar: true. 2013-06-03T17:30:37 so what, its not like there are patents on ideas 2013-06-03T17:31:35 or maybe there are... dunno 2013-06-03T17:31:41 mleise: they carefully look at other languages and research before making decisions so there is a lot more heritage from existing stuff than with most languages 2013-06-03T17:31:56 gotta focus on this awesome multi-thread-chain-algorithm stuff 2013-06-03T17:32:01 the marching cubes algorithm was patented 2013-06-03T17:32:12 like with Go, they just based it on C, some languages like limbo done by rob pike and their own knowledge 2013-06-03T17:32:39 sy tell me wheres my code 2013-06-03T17:32:41 or java, which was essentially just yet-another-algol-or-c with gc 2013-06-03T17:32:56 erm.. 2013-06-03T17:33:06 i dont want to defend java, but i will 2013-06-03T17:33:11 thestinger: "heritage" is relative. it could mean to take a few ideas, or it could mean to try to be so close to some other language that you copy their mistakes 2013-06-03T17:33:12 ^ thats not true 2013-06-03T17:33:25 mcstar: why ;p 2013-06-03T17:33:34 that said, Lua's indexing starts at 1 and I don't particularly like that :p 2013-06-03T17:33:37 because it adapted OOP from smalltalk too? 2013-06-03T17:33:43 cause java provided single inheritance and encapsulation 2013-06-03T17:34:01 mcstar: C still has encapsulation, it's just a PITA 2013-06-03T17:34:03 look at FILE 2013-06-03T17:34:05 smalltalk had message driven oop afaik 2013-06-03T17:34:10 thats different 2013-06-03T17:34:24 thestinger: __FILE__ ? 2013-06-03T17:34:25 :) 2013-06-03T17:34:30 mcstar: no, FILE as in stdio 2013-06-03T17:34:35 it's an opaque struct 2013-06-03T17:34:48 j/k __FILE__ or somehting is a macro 2013-06-03T17:34:49 all the fields are entirely private, you can't construct one yourself 2013-06-03T17:34:56 or access the fields 2013-06-03T17:35:07 any more than you can access C++ or Java private fields 2013-06-03T17:35:12 Java has to be looked at from a different angle. 2013-06-03T17:35:14 you can write hacks to do it but it's not defined 2013-06-03T17:35:22 Safety, portablility, simplicity, ... 2013-06-03T17:35:31 thestinger: how is it opaque? 2013-06-03T17:35:32 It's not about language features and change 2013-06-03T17:35:34 FILE that is 2013-06-03T17:35:45 mcstar: because there's no public definition of the struct 2013-06-03T17:35:49 mcstar: try allocating one on the stack 2013-06-03T17:35:50 so? 2013-06-03T17:35:59 so you can't access the fields or allocate one. 2013-06-03T17:36:03 does the compiler let me to access it or not? 2013-06-03T17:36:08 mcstar: it doesn't 2013-06-03T17:36:22 you can access private fields in java with unsafe hacks too, but it's not defined in either C or java 2013-06-03T17:36:54 thestinger: is it private in the sense that there is no header file provided with the definition of FILE? 2013-06-03T17:37:15 mcstar: no header file or public symbols 2013-06-03T17:37:32 it is a mystery FILE 2013-06-03T17:37:39 but symbols only really applies to C++ (C doesn't really associate any symbols with structs without gcc extensions) 2013-06-03T17:37:43 well, java has methods 2013-06-03T17:37:54 in C it would be cumbersome to mess with function pointers 2013-06-03T17:38:03 which ppl nevertheless do 2013-06-03T17:39:05 anyway, by your logic you could even say that java is just syntactic sugar and a different stdlib over assembly 2013-06-03T17:39:06 C is still the basic interop language. many other languages can interface with C and wrap the "C-OOP" 2013-06-03T17:39:22 (a different assembly ofc) 2013-06-03T17:39:35 mcstar: well, I just think it has encapsulation ;p 2013-06-03T17:39:42 the encapsulation in C has runtime overhead. it sucks. but it exists 2013-06-03T17:40:15 you should at least mention Java's runtime introspection capablities 2013-06-03T17:40:41 it has that? 2013-06-03T17:40:45 since everything is an object this system is also rather simple 2013-06-03T17:40:47 recent addition? 2013-06-03T17:40:53 not everything 2013-06-03T17:40:55 afaik 2013-06-03T17:41:10 not arrays or the primitives, right? 2013-06-03T17:41:30 i think 2013-06-03T17:41:33 well in java you can look up members and inheritance trees, compile and load new classes dynamically and so on 2013-06-03T17:42:03 isnt that jvm-as-a-library? 2013-06-03T17:42:06 I don't know how the more recent user attributes work though, but they add some introspection as well 2013-06-03T17:42:13 or is it part of the language? 2013-06-03T17:42:32 you need the JDK installed, then it is a normal library package 2013-06-03T17:42:49 it doesn't come with the "normal" user installation 2013-06-03T17:43:00 or at least that was the case a few years ago 2013-06-03T17:44:02 When you say Java primitives are not objects, you have to consider that it has to be like that for performance reasons on the one hand, but that they convert implicitly to their wrapper class types. So the friction really isn't there in practice. 2013-06-03T17:44:15 mcstar: there's a rust thread trending on r/programming now, and it's funny 2013-06-03T17:44:22 mleise: did you paste that text? 2013-06-03T17:44:23 the level of cognitive dissonance that C++ fans have 2013-06-03T17:44:34 they dare to claim "modern C++" is somehow "memory safe" 2013-06-03T17:44:38 mcstar: no, I regularly speak like that :p 2013-06-03T17:44:45 :) 2013-06-03T17:44:47 as if references and iterators don't exist and can't be dangling/invalidated 2013-06-03T17:45:01 to them, no memory leaks (excluding cycles) == memory safety 2013-06-03T17:45:04 thestinger: lol more than easily 2013-06-03T17:45:43 mcstar: http://www.reddit.com/r/programming/comments/1fkhwa/removing_garbage_collection_from_the_rust_language/cabcgoq?context=3 this thread 2013-06-03T17:45:50 but there are 20 more threads like that. 2013-06-03T17:45:58 I enjoyed programming in Java, so I defend it. As I would with Delphi and D. I think Rust is very interesting as well, but this Haskell syntax... meh. 2013-06-03T17:46:00 somehow they think unique_ptr + shared_ptr == memory safety/ 2013-06-03T17:46:08 that's only the allocation part of the problem. 2013-06-03T17:46:21 mleise: syntax is a good part of haskell, it makes things concise 2013-06-03T17:46:44 you would get used to it fast, just try to learn it 2013-06-03T17:46:46 I know a lot of people like it, but it's not my cup of cake. 2013-06-03T17:47:04 it is like lisp has parens, you get used to it pretty quickly.. look past it 2013-06-03T17:47:13 not your cup cake 2013-06-03T17:47:14 Even if it is silly to dismiss a good language for part of the syntax. 2013-06-03T17:47:31 where is my code???? 2013-06-03T17:47:45 *cup of tea even :p 2013-06-03T17:48:20 oh shit Opera crashed away 2013-06-03T17:48:27 <3 opera 2013-06-03T17:48:32 super fast scrolling 2013-06-03T17:49:34 found the codez! 2013-06-03T17:50:23 I like haskell's syntax. but I don't really like the whole purely functional thing ;p 2013-06-03T17:50:36 then you will like this 2013-06-03T17:51:01 thestinger: A typical bug in D is, someone iterates over an associative array and removes items by key inside the loop. How does Rust ensure consistency here? 2013-06-03T17:51:22 mleise: with owned data, rust statically handles mutability 2013-06-03T17:51:30 if you're iterating over it, it's statically frozen 2013-06-03T17:51:36 that's how & is memory safe 2013-06-03T17:51:53 & means "data is immutable" 2013-06-03T17:51:59 not just "can't mutate through the pointer" 2013-06-03T17:51:59 so it's just const for the time of iteration. that's ... simple 2013-06-03T17:52:02 http://sprunge.us/UcDh?haskell 2013-06-03T17:52:12 mleise: well, when you take an & ptr it statically freezes the source 2013-06-03T17:52:13 thats my entry for fannkuch-redux 2013-06-03T17:52:45 Fortunately I cannot add an entry in D. 2013-06-03T17:52:50 mleise: like 'let mut x = 5; { let y = &x; /* can't modify x */ } /* can modify x */' 2013-06-03T17:53:15 mleise: @mut and RcMut handle it dynamically, so you get similar errors to java/python for invalidating the container as you iterate 2013-06-03T17:53:17 thestinger: yeah, it's just that I have to get used to that. Its so unlike any other PL I've seen 2013-06-03T17:53:31 which were all C/Pascal/Basic like 2013-06-03T17:53:51 mleise: i didnt add either, let me rephrase, thats my variation of... 2013-06-03T17:54:00 mleise: the invariants are basically that & points to immutable data and &mut is a unique handle 2013-06-03T17:54:16 which lets them just be raw unchecked pointers runtime 2013-06-03T17:54:23 at runtime* 2013-06-03T17:55:16 I keep thinking "ok, this is ingenious, but where is the catch" 2013-06-03T17:55:19 and ~ is a malloc call, with a paired call to free when it goes out of scope (if it wasn't moved from) 2013-06-03T17:55:29 mleise: well they are less flexible, &mut being unique is quite inflexible 2013-06-03T17:55:32 i dont understand the problem, to begin with 2013-06-03T17:55:42 "removes items by key inside the loop" 2013-06-03T17:55:47 mcstar: because you are used to functional programming :p 2013-06-03T17:55:48 whats the problem with that? 2013-06-03T17:56:00 mcstar: changing the structure of the container as you were looping over it 2013-06-03T17:56:03 in C++ -> undefined behaviour 2013-06-03T17:56:06 so? 2013-06-03T17:56:10 no it isnt 2013-06-03T17:56:11 in python -> it has a check to see if size changed, it will bail out 2013-06-03T17:56:12 D -> undefined behaviour 2013-06-03T17:56:15 mcstar: yeah it is. 2013-06-03T17:56:22 mcstar: iterator invalidation rules. 2013-06-03T17:56:27 thestinger: mleise didnt say he was 'looping' over it 2013-06-03T17:56:36 the iterator is separate from the container 2013-06-03T17:56:37 and the implementation of looping over is undefined 2013-06-03T17:56:40 so... 2013-06-03T17:57:02 looping over the container using a freshly created iterator 2013-06-03T17:57:18 it is easy 2013-06-03T17:57:29 the iterator should take care of things if you remove items 2013-06-03T17:57:33 well, there are containers that offer iterators with a remove function 2013-06-03T17:57:35 it is a design flaw 2013-06-03T17:57:37 mcstar: how? 2013-06-03T17:57:45 mcstar: then the container needs to know about every iterator 2013-06-03T17:57:48 even python doesn't d othat 2013-06-03T17:57:51 the iterator isn't invoked for the remove 2013-06-03T17:58:07 mcstar: you have 20 iterators to a container in various places 2013-06-03T17:58:10 you remove directly from the container, and the iterator is left out in the cold 2013-06-03T17:58:11 you remove stuff from the container 2013-06-03T17:58:12 what now? ;p 2013-06-03T17:58:18 i dont see a problem if the program is single-threaded 2013-06-03T17:58:25 mcstar: ok so 2013-06-03T17:58:29 mcstar: std::vector 2013-06-03T17:58:32 you have an iterator 2013-06-03T17:58:35 now you append to the vector 2013-06-03T17:58:37 it reallocates 2013-06-03T17:58:38 thats just a pointer 2013-06-03T17:58:40 the old vector is gone 2013-06-03T17:58:44 mcstar: ok in python then 2013-06-03T17:58:49 you have a python iterator object 2013-06-03T17:58:51 you append to a list 2013-06-03T17:58:53 the list reallocates 2013-06-03T17:59:02 or whatever 2013-06-03T17:59:09 your iterator has index 15 2013-06-03T17:59:15 yeah, and the iterator changes its internal state 2013-06-03T17:59:16 you delete index 3 2013-06-03T17:59:27 mcstar: how does the iterator know a removal happened? 2013-06-03T17:59:38 since there can be only one iterator object for a container, with many 'fronts' 2013-06-03T18:00:57 when you want an iterator that iterates over a container, which is an instantiated object, the iterator contains a reference to the object 2013-06-03T18:01:01 mcstar: you can have multiple iterators 2013-06-03T18:01:03 so it can always stay up to date 2013-06-03T18:01:04 think about zip() 2013-06-03T18:01:19 yeah, thats what im saying, multiple iterators are not a problem 2013-06-03T18:01:57 >>> xs = {1, 2, 3, 4} 2013-06-03T18:01:59 >>> for x in xs: 2013-06-03T18:02:01 ... xs.add(10) 2013-06-03T18:02:03 ... 2013-06-03T18:02:05 Traceback (most recent call last): 2013-06-03T18:02:07 File "", line 1, in 2013-06-03T18:02:09 RuntimeError: Set changed size during iteration 2013-06-03T18:02:10 the only thing that can be a problem, is that this new iterator concept might not be the fastest possible 2013-06-03T18:02:11 what should they do instead? 2013-06-03T18:02:18 but probably more user friendly 2013-06-03T18:02:43 mcstar: or just have the compiler statically freeze anything with references borrowed to it 2013-06-03T18:02:45 ;p 2013-06-03T18:02:49 +1 2013-06-03T18:03:23 but then your language needs ownership 2013-06-03T18:03:38 thestinger: that code would result in an infinite set if it were given infinite resources, in my little world :) 2013-06-03T18:03:55 thestinger: does Rust have bit-fields like C does? 2013-06-03T18:04:11 mleise: not as a first-class type 2013-06-03T18:05:05 you can make a struct with | overloaded ;p 2013-06-03T18:05:12 I think there are plans to make a flag type like that in the stdlib 2013-06-03T18:05:19 well in C it isn't a type either, but you can assign a few bits of a struct to int fields for example 2013-06-03T18:05:19 thestinger: there are many semantics that could make that code work 2013-06-03T18:05:40 flag types are a different story 2013-06-03T18:05:41 mcstar: slow ones :) 2013-06-03T18:05:43 you have to decide first what is correct 2013-06-03T18:06:23 I'm talking about a struct of 2 bytes, where you have 3 fields of 5, 6 and 5 bits or so 2013-06-03T18:06:50 mleise: yeah there isn't an easy way to do that without manual pain 2013-06-03T18:06:56 right now 2013-06-03T18:07:15 *** btiberi has joined #aichallenge 2013-06-03T18:07:17 we do have #[packed] though ;p 2013-06-03T18:07:18 you will eventually get into the creeping featuritis phase with Rust 2013-06-03T18:07:28 mleise: well that would be a stdlib thing 2013-06-03T18:07:59 I don't think there are many more planned language features 2013-06-03T18:08:05 associated types + constants 2013-06-03T18:08:06 I tought so, too. but while that works most of the time in D, sometimes it is limiting without language support 2013-06-03T18:08:12 thestinger: for example, the iterator could create an array of references to the elements of xs, and iterate over the references, not the set/array directly 2013-06-03T18:08:17 and the code would work 2013-06-03T18:08:24 mcstar: with gc :) 2013-06-03T18:08:41 a gc that updates references 2013-06-03T18:08:53 when a reallocation happens due to container groth 2013-06-03T18:08:54 hm? 2013-06-03T18:09:00 *growth 2013-06-03T18:09:06 whats the problem? 2013-06-03T18:09:06 mleise: well if the objects in the container were all boxed 2013-06-03T18:09:08 it would work 2013-06-03T18:09:12 a reference is always a good reference 2013-06-03T18:09:19 you cannot assume that in an array of ints 2013-06-03T18:09:20 mcstar: wouldn't work in a language without boxed types + gc 2013-06-03T18:10:04 I wonder if zero-indexed arrays mostly originate from C 2013-06-03T18:10:32 I don't know, but it is the way it works on computers 2013-06-03T18:10:40 why wouldnt it? why would a set need reallocation? it is a tree 2013-06-03T18:10:44 the first element is at offset 0 2013-06-03T18:10:57 mcstar: python's set isn't 2013-06-03T18:10:59 it's a hash table 2013-06-03T18:10:59 terminology just hanged... 2013-06-03T18:11:05 mcstar: heh 2013-06-03T18:11:12 thestinger: i know, but in proper languages it is a tree 2013-06-03T18:11:16 reptyr to the rescue! 2013-06-03T18:11:19 mcstar: "proper" 2013-06-03T18:11:22 XD 2013-06-03T18:11:25 usually you want a hash-based set, honestly 2013-06-03T18:11:32 data-sharing with a set/map is overrated 2013-06-03T18:11:41 you lose a huge amount of the shared part with each insert 2013-06-03T18:11:43 from rebalancing 2013-06-03T18:12:20 the good thing about tree-based ones is that they're ordered ;p 2013-06-03T18:12:50 *** Scooper has quit IRC (Quit: Leaving) 2013-06-03T18:12:55 another surprise for language switchers 2013-06-03T18:13:14 oh why doesn't this hash return the values in the order i inserted them? 2013-06-03T18:13:32 mleise: rust hash tables are probably going to surprise people more often 2013-06-03T18:13:38 what? are you a language switcher? 2013-06-03T18:13:40 because *each* hash table has a different order for the same keys 2013-06-03T18:13:42 :D 2013-06-03T18:13:46 are you really trying out rust? 2013-06-03T18:13:54 because it uses SipHash + a random 128-bit key (two 64-bit ints) for each table 2013-06-03T18:14:00 mcstar: no, I read posts about such issued on the internet 2013-06-03T18:14:11 *issues 2013-06-03T18:14:21 secure O(1) guarantee, based on a cryptographic PRF :) 2013-06-03T18:14:27 for a moment i thought you gave in to this snake oil salesman called thestinger 2013-06-03T18:14:32 about as fast as murmurhash too. 2013-06-03T18:14:33 <3 siphash 2013-06-03T18:14:57 mcstar: no, the language just recently introduced 'fold' 2013-06-03T18:14:59 perl switched to siphash on 64-bit too 2013-06-03T18:15:01 PRF=pseudo random function, for the uninitiated in cryptography 2013-06-03T18:15:15 and a simple boost:iota is still missing 2013-06-03T18:15:27 oh and ruby uses siphash now :) 2013-06-03T18:15:34 Also, D rox! 2013-06-03T18:15:50 python is the odd one out with a DoS vulnerability still there. (their randomization doesn't actually provide much...) 2013-06-03T18:15:51 Not as much as Rust, but still... 2013-06-03T18:16:23 D doesn't use cryptography for hashes 2013-06-03T18:16:41 you mean, the standard lib 2013-06-03T18:16:45 mcstar: siphash is pretty cool. the key is tiny so you still get collisions, but an attacker can't generate data to make it degrade to O(n) 2013-06-03T18:17:04 because of the independent randomization 2013-06-03T18:17:06 mcstar: you know what libstdc++ uses for int hashes? 2013-06-03T18:17:09 the identity function. 2013-06-03T18:17:17 thats great 2013-06-03T18:17:21 i sort of expected that 2013-06-03T18:17:25 python does too 2013-06-03T18:17:29 makes the implementation fast 2013-06-03T18:17:33 hey that is what I would have done, too. 2013-06-03T18:17:51 mcstar: fast on average :) 2013-06-03T18:18:44 it's good at actual random data 2013-06-03T18:18:48 it's terrible when the data has any patterns 2013-06-03T18:19:19 but does it blend? 2013-06-03T18:19:43 poppycock 2013-06-03T18:23:14 iterators are flawed 2013-06-03T18:24:59 also, in a sense, the iterator can be invalidated even if the size of the set does not change 2013-06-03T18:25:55 if i manage to replace an element of the set with something else, while iterating over it 2013-06-03T18:26:01 i would consider that invalidation 2013-06-03T18:26:14 sets should be immutable anyway 2013-06-03T18:26:29 and you should use set operations on whole sets 2013-06-03T18:27:05 *** amstan has joined #aichallenge 2013-06-03T18:27:05 *** ChanServ sets mode: +o amstan 2013-06-03T18:29:23 recoll has so far built a 5.5 GB index 2013-06-03T18:31:25 nepomuk has a 3.3GB index, but that thing run for months 2013-06-03T18:31:33 recoll has only been running today 2013-06-03T18:32:01 either recoll is very fast and will finish in a couple of days, or it is inefficient in sotring the index 2013-06-03T18:33:56 *** amstan has quit IRC (Ping timeout: 256 seconds) 2013-06-03T18:35:43 *** btiberi_ has joined #aichallenge 2013-06-03T18:36:06 you no desktop search? 2013-06-03T18:37:11 mcstar: make your own with sqlite's full-text-search ;p 2013-06-03T18:37:28 if you really want full-text search... 2013-06-03T18:37:36 I assume that's what they put in their index? 2013-06-03T18:37:38 i dont follow 2013-06-03T18:37:47 mcstar: do they index the entire contents of text files? 2013-06-03T18:37:51 yes 2013-06-03T18:37:57 not just text files 2013-06-03T18:38:01 all kinds of documents 2013-06-03T18:38:21 pdf/djvu/doc/odf/txt/media files 2013-06-03T18:38:37 mcstar: seems like something you could make in a day ;p 2013-06-03T18:38:40 *** btiberi has quit IRC (Ping timeout: 246 seconds) 2013-06-03T18:38:43 not really 2013-06-03T18:38:56 yeah. just use libs that can extract metadata or convert documents to text 2013-06-03T18:38:57 you can search for variations of words too 2013-06-03T18:39:06 mcstar: sqlite's full-text-search can do stemming 2013-06-03T18:39:10 recoll is based on such a lib 2013-06-03T18:39:14 you just give it a tokenizer that can stem 2013-06-03T18:39:23 breaking -> break 2013-06-03T18:39:29 or whatever 2013-06-03T18:39:30 'you just...' 2013-06-03T18:39:38 mcstar: they exist! it's like 5 lines of code 2013-06-03T18:39:40 ;p 2013-06-03T18:40:10 so, i have this problem, i need to classify automatically horses and ponies 2013-06-03T18:40:24 'you just write 5 lines of python and..' 2013-06-03T18:40:25 wat 2013-06-03T18:40:38 thats you probable answer 2013-06-03T18:40:58 i need to formalize the 4 color theorem 2013-06-03T18:41:14 'well, there are lots of proof assitants, i bet its just 5 lines of code...' 2013-06-03T18:41:41 so, i have to build this bridge 2013-06-03T18:41:56 'well, there are CAD programs already, i bet you can have it in an hour...' 2013-06-03T18:42:16 mcstar: https://www.sqlite.org/fts3.html 2013-06-03T18:42:24 or use postgres and it has 20x the feature set... 2013-06-03T18:42:48 sqlite has prefix search or exact search + AND/OR 2013-06-03T18:43:03 why would i use an SQL database, when there are ready made solutions? 2013-06-03T18:43:09 like this 'recoll' thing? 2013-06-03T18:43:17 I don't know what recoll is 2013-06-03T18:43:18 which is tested, which is for this exact purpose 2013-06-03T18:43:34 it is a desktop search utility on top of an indexing lib 2013-06-03T18:44:05 the link you gave is borked 2013-06-03T18:44:07 because you can teach it to index what you care about the way you care about 2013-06-03T18:44:18 mcstar: works fine here 2013-06-03T18:44:47 works wo (http)s 2013-06-03T18:45:11 maybe https everywhere has a fix for it 2013-06-03T18:45:13 dunno 2013-06-03T18:45:43 thestinger: have you used osx spotlight before? 2013-06-03T18:45:46 nope 2013-06-03T18:45:59 I've used google desktop search ages ago when it was a thing ;p 2013-06-03T18:46:05 on like windows xp 2013-06-03T18:46:07 well, even when other havent even tried to mimick spotlight 2013-06-03T18:46:09 it worked 2013-06-03T18:46:11 wait 2013-06-03T18:46:14 no 2013-06-03T18:46:16 it WORKED 2013-06-03T18:46:24 it found the things you wanted to find 2013-06-03T18:46:29 and it was fast 2013-06-03T18:46:43 and you didnt even have to configure it 2013-06-03T18:47:08 well imo one of us could make a better indexing thing than nepomuk in a day. honestly. 2013-06-03T18:47:14 it shouldn't have to constantly run *at all* 2013-06-03T18:47:16 anyway, i hope this recoll thing will be usefull 2013-06-03T18:47:27 it should do what rlocate did 2013-06-03T18:47:38 it's too bad fanotify sucks 2013-06-03T18:47:51 whats that? 2013-06-03T18:48:02 isnt inotify the standard? 2013-06-03T18:48:11 mcstar: linux has this in-kernel API called fsnotify that lets you listen for any fs events, recursively if you want 2013-06-03T18:48:18 inotify and fanotify are the two userspace interfaces to it 2013-06-03T18:48:26 ah ok 2013-06-03T18:48:29 inotify lets you put a watch on a dir. to watch recursively you need a watch on eat dir 2013-06-03T18:48:36 i knew about the kernel thingy i thought it was called inotify 2013-06-03T18:48:37 and it *eats* resources since you have to epoll each watch handle 2013-06-03T18:48:46 fanotify lets you watch recursively but it's a piece of shit 2013-06-03T18:48:54 it can't see moves, deletes 2013-06-03T18:49:03 it passes you a file descriptor, not some kind of persistent handle 2013-06-03T18:49:09 so you have to race to see what the file is 2013-06-03T18:49:14 with the application, before it closes it 2013-06-03T18:49:20 anyway, a proper desktop search tool is not something you write in a day 2013-06-03T18:49:43 if this were true, we would have seen proper solutions already 2013-06-03T18:49:44 anyway you need a kernel module to get at the actual fsnotify with a sane API 2013-06-03T18:49:47 but there arent for linux 2013-06-03T18:49:54 mcstar: well they need to make a kernel module 2013-06-03T18:49:56 for one thing 2013-06-03T18:50:06 because the existing APIs are shit 2013-06-03T18:50:32 and they need to use an embedded database like sqlite, not be ridiculous and use mysql/postgres on a desktop 2013-06-03T18:50:39 like kde 2013-06-03T18:51:13 idk about the alternatives 2013-06-03T18:51:18 and then glue all the silly libs for media tags together + extract text from documents 2013-06-03T18:51:24 sounds like a day of work to me ;p 2013-06-03T18:51:29 are there faster/better suited database backends? 2013-06-03T18:51:46 thestinger: have fun with it tomorrow 2013-06-03T18:52:05 i expect a working solution that could replace recoll in 24 hours 2013-06-03T18:52:08 mcstar: sqlite is pretty hard to beat with a single writer 2013-06-03T18:52:17 it just doesn't scale well, at all 2013-06-03T18:52:29 with default settings it falls apart with >1 writer because writers block each other 2013-06-03T18:52:45 but it's perfect for a file search daemon. only the daemon writes 2013-06-03T18:53:03 if your daemon is single threaded 2013-06-03T18:53:30 well, i guess writing could be serialized anyway 2013-06-03T18:53:32 mcstar: you can just queue the writes, it will still be faster than postgres/mysql 2013-06-03T18:53:48 there isn't really an urgent latency 2013-06-03T19:06:27 *** contestbot has joined #aichallenge 2013-06-03T19:06:27 *** ChanServ sets mode: +o contestbot 2013-06-03T19:06:48 *** epicmonkey has quit IRC (Ping timeout: 256 seconds) 2013-06-03T19:12:22 *** contestbot has joined #aichallenge 2013-06-03T19:12:22 *** ChanServ sets mode: +o contestbot 2013-06-03T19:13:08 *** amstan has joined #aichallenge 2013-06-03T19:13:08 *** ChanServ sets mode: +o amstan 2013-06-03T19:20:30 *** epicmonkey has quit IRC (Ping timeout: 264 seconds) 2013-06-03T19:50:06 *** btiberi_ has quit IRC (Quit: This computer has gone to sleep)