Banana changed the topic of #ocaml to: OCaml 3.08.1 available! | Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
mlh_ has quit [Client Quit]
mlh has joined #ocaml
goooomba has joined #ocaml
goomba has quit [Read error: 104 (Connection reset by peer)]
pflanze has quit [Read error: 110 (Connection timed out)]
<TheDracle> Yay Ocaml.
gim has quit ["pouf dodo"]
mattam_ has joined #ocaml
mattam has quit [Read error: 104 (Connection reset by peer)]
insulanus has joined #ocaml
insulanus has left #ocaml []
noj has quit [tolkien.freenode.net irc.freenode.net]
Demitar has quit [tolkien.freenode.net irc.freenode.net]
taras has quit [tolkien.freenode.net irc.freenode.net]
noj has joined #ocaml
judge has joined #ocaml
goooomba is now known as goomba
Herrchen_ has joined #ocaml
Herrchen has quit [Read error: 110 (Connection timed out)]
pacroon has quit [tolkien.freenode.net irc.freenode.net]
mflux has quit [tolkien.freenode.net irc.freenode.net]
Godeke has quit [tolkien.freenode.net irc.freenode.net]
judge has quit [tolkien.freenode.net irc.freenode.net]
mlh has quit [tolkien.freenode.net irc.freenode.net]
oracle1 has quit [tolkien.freenode.net irc.freenode.net]
Excedrin has quit [tolkien.freenode.net irc.freenode.net]
noj has quit [tolkien.freenode.net irc.freenode.net]
mattam_ has quit [tolkien.freenode.net irc.freenode.net]
goomba has quit [tolkien.freenode.net irc.freenode.net]
pango has quit [tolkien.freenode.net irc.freenode.net]
Riastradh has quit [tolkien.freenode.net irc.freenode.net]
calvin_ has quit [tolkien.freenode.net irc.freenode.net]
Hipo has quit [tolkien.freenode.net irc.freenode.net]
shawn has quit [tolkien.freenode.net irc.freenode.net]
avlondono has quit [tolkien.freenode.net irc.freenode.net]
Smerdyakov has quit [tolkien.freenode.net irc.freenode.net]
Nutssh has quit [tolkien.freenode.net irc.freenode.net]
mrvn has quit [tolkien.freenode.net irc.freenode.net]
cmeme has quit [tolkien.freenode.net irc.freenode.net]
Shammah has quit [tolkien.freenode.net irc.freenode.net]
themus has quit [tolkien.freenode.net irc.freenode.net]
mellum has quit [tolkien.freenode.net irc.freenode.net]
srv has quit [tolkien.freenode.net irc.freenode.net]
_fab has quit [tolkien.freenode.net irc.freenode.net]
Lemmih has quit [tolkien.freenode.net irc.freenode.net]
rossberg_ has quit [tolkien.freenode.net irc.freenode.net]
Hanji has quit [tolkien.freenode.net irc.freenode.net]
drz has quit [tolkien.freenode.net irc.freenode.net]
slashvar[TP] has quit [tolkien.freenode.net irc.freenode.net]
tewk_ has quit [tolkien.freenode.net irc.freenode.net]
creichen has quit [tolkien.freenode.net irc.freenode.net]
hangman4 has quit [tolkien.freenode.net irc.freenode.net]
Hadaka has quit [tolkien.freenode.net irc.freenode.net]
det has quit [tolkien.freenode.net irc.freenode.net]
creichen has joined #ocaml
tewk_ has joined #ocaml
slashvar[TP] has joined #ocaml
drz has joined #ocaml
Hanji has joined #ocaml
rossberg_ has joined #ocaml
Lemmih has joined #ocaml
_fab has joined #ocaml
srv has joined #ocaml
det has joined #ocaml
hangman4 has joined #ocaml
judge has joined #ocaml
noj has joined #ocaml
mattam_ has joined #ocaml
goomba has joined #ocaml
mlh has joined #ocaml
pango has joined #ocaml
Smerdyakov has joined #ocaml
Nutssh has joined #ocaml
mrvn has joined #ocaml
cmeme has joined #ocaml
Godeke has joined #ocaml
Riastradh has joined #ocaml
Shammah has joined #ocaml
oracle1 has joined #ocaml
Excedrin has joined #ocaml
mellum has joined #ocaml
themus has joined #ocaml
shawn has joined #ocaml
avlondono has joined #ocaml
calvin_ has joined #ocaml
Hipo has joined #ocaml
pacroon has joined #ocaml
mflux has joined #ocaml
det has quit [Killed by sagan.freenode.net (Nick collision)]
det has joined #ocaml
Hadaka has joined #ocaml
monochrom has joined #ocaml
cmeme has quit [Read error: 104 (Connection reset by peer)]
cmeme has joined #ocaml
cmeme has quit [Remote closed the connection]
cmeme has joined #ocaml
Nutssh has left #ocaml []
Nutssh has joined #ocaml
mrvn_ has joined #ocaml
Demitar has joined #ocaml
mrvn has quit [Read error: 110 (Connection timed out)]
monochrom has quit ["hello"]
pango has quit ["don't forget to *enjoy the sauce*"]
mlh has quit ["ni!"]
srv_ has joined #ocaml
pango has joined #ocaml
Herrchen_ is now known as Herrchen
srv has quit [Read error: 110 (Connection timed out)]
<calvin_> pling
<vincenz> Hi
<vincenz> Anyone here who can answer me a question on sockets in Ocaml?
<vincenz> never mind, I got it :)
Submarine has joined #ocaml
<vincenz> Are Mutexes slow?
<Submarine> ocamlc or ocamlopt?
<vincenz> ocamlc
<vincenz> well both :)
<Nutssh> Implement and benchmark.
<vincenz> ...
<vincenz> I wouldn't ask if I had that time
<vincenz> 0.47 user for ocamlc for 10000000
<Nutssh> No.. Just use em, and if profililng says that there's a problem, you know. Problems of contention and overserialization aren't much of an issue. ocaml only runs one thread at a time.
<vincenz> 0.18 with ocamlopt
mlh has joined #ocaml
<vincenz> What is overserialization?
<Submarine> afaik with ocamlopt mutexes are OS/libc mutex calls
<vincenz> Basically I have this little lib for doing sockets and such. And I'm wondering whether I should allow the possibility of asynch threads, but if I do I have to put locks in certain places where they're not needed now
<Nutssh> When everything is contenting and serializing on one mutex (eg, memory allocation.)
<vincenz> Oh yes, that brings up a question on threads in ocaml. The gc runs in the same thread as the code.... Though if you have multiple threads, doesn't this pose a problem?
<Nutssh> No, only one thead ever runs at a time.
<Submarine> you basically always have one single caml thread at a time
<Submarine> the only times when multiple threads can run is when you have C routines etc.
<vincenz> So when does it switch between threads?
<Nutssh> Ocaml threadsd are a programming abstraction, not for performance.
<Submarine> during syscalls?
<vincenz> ^_^
<vincenz> Not at other times?!?
<Submarine> the OS switches threads
<vincenz> I thought you said there's only one thread
<Submarine> but afaik there's a BIG mutex on the heap
<vincenz> ah
<Submarine> so in essence only one thread may access the heap
<Nutssh> Only one thread can run at a time, but you can have many threads.
<vincenz> so there is more than one thread
<vincenz> Nutssh: well the way you say that sounds quirky
<Submarine> any of you have access to IEEE Transactions on signal processing?
<vincenz> Nutssh: There -is- timesharing, so mutliple threads running, but only on a single proc
<vincenz> Submarine: yeah, I've got ful IEEE access
<Submarine> *all* of IEEE?
<vincenz> yup
* Submarine curses his silly library that seems incapable of buying online subscriptions
<Nutssh> On a single CPU system, thats the most you can have. One running at any time. On a multiple CPU system, multiple threads could run concurrently.
<vincenz> Well at work that is, still not there (my brother is arriving today)
<vincenz> Nutssh: But there -is- switching
<vincenz> Submarine: I work for a big research institue, one of it's quirks :) Sadly, I don't have ACM access, but apparently my university provides that
* Submarine has personal ACM access
<vincenz> Nice
<Submarine> It seems that my workplace is incapable of buying online subscriptions.
<Submarine> I suspect the librarian of being hostile to them, or something.
<vincenz> Can you make a method final in ocaml?
<Submarine> (anyways, people should put their papers on their web pages, period)
* vincenz agrees
<vincenz> Submarine: Tried that other site? siteseer?
<vincenz> They usually have many papers
<Nutssh> citeseer.. Google for the title almost always finds it if it is CS and was written in the last ~10 years.
<vincenz> yeah
<vincenz> So can you make methods final in ocaml?
<Nutssh> Why would you want to?
<vincenz> To stop overriding
<Nutssh> Why would you want to?
<vincenz> nm
<Nutssh> You can make it invisible by ascribing a class type to a class.
<mellum> Nutssh: to make method calls faster, for example
<Nutssh> Is method calling performance a bottleneck? (Apart from whether ocaml would optimize final methods, given the lack of any optimization in the compiler)
<vincenz> No
<vincenz> I actually tested that once
<vincenz> With a system based on mixins
<vincenz> I moved to modules (quite a rewrite) to gain only a few measly percent
<vincenz> (Of course the application was quite data-intensive, but I was getting QUITE a lot of method calls )
<Nutssh> :) I am a streneous believer in 'write, then profile'. Then fix any hotspots.
<vincenz> Yeah I know, but sometimes profile-info is hard to read
<vincenz> Especially if your hotspot is your entire application
<Nutssh> Then I look for subtrees. Eg, a lot of my code is bottlenecked in parsing.
<vincenz> Hmm
<vincenz> Alright, design question
<vincenz> Right now I only have sync-connections
<vincenz> they have a method #input which reads and passes this to their callb ack
<mellum> Nutssh: well, method calls cannot really be optimized later. You'd have to change the design
<vincenz> Now for async connections Should I stick to this, or should I move to a #input : string
<Nutssh> See if I can optimize the subtree.
<mrvn_> How do you parse?
<mrvn_> And how big is your input?
<mrvn_> 32bit apps can only have 16MB strings
<Submarine> vincenz, citeseer won't make papers never put online on an open site magically appear :-)
<Nutssh> mellum: Two ways to fix, have a method that returns a closure that you can repeatedly invoke in a loop someplace somewhere else. Or, build a higher level API.
<vincenz> Submarine: I had to read yor statement a few times, too many negations
<Nutssh> mrvn_. Linewise.. the equivalent of split // in perl. Split a string on, eg, tabstops into substrings, then Int.of_string em.
<vincenz> Oh yes, another question on Unix.file_descr, are you allowed to have two different threads read and write on it (one read one write...)
<mrvn_> I trippeled my parser when I moved from reading charwise to buffering 64K and then scanning the string.
<mrvn_> vincenz: sure
<Herrchen> how about using a dfa for scanning?
<Nutssh> mrvn_: read_line, then String.find, to find the splitpoints, then a bunch of String.sub to pell em out.
<mrvn_> vincenz: you can even have two reads or writes with all the races that gives you.
<Nutssh> Interesting news mrvn_, thanks.
<mrvn_> Nutssh: If you have further split points I suggest using a parser generator.
<mrvn_> or a scanf.
<Herrchen> if you just have some split points, a parser generator would be much overkill
<Nutssh> Unix_file_descr is based on unix filedescriptors, I believe individual writes to it are probably atomic (No iostream-style buffering)
<Herrchen> using ocamllex should be sufficient
<mrvn_> Nutssh: but you don't know which write comes first.
<mrvn_> Herrchen: ocamllex is a real parser generator. :)
<mrvn_> Herrchen: the intern lexer streams probably suffice already.
<Herrchen> mrvn_: ocamllex constructs a finite automata, not a pushdown transducer
<Nutssh> mrvn_: Interesting.. Why is it I *never* think of scanf? I got around it by defining a new 'dense' format where I filter out only the stuff I really care about.
<mrvn_> Nutssh: Maybe because scanf isn't as powerfull in other languages.
<Herrchen> so it's no parser (as the word parser normally is used for anything that is able to do something like LR(k), LL(k), LALR(k), etc. and not only regular languages)
<mrvn_> Herrchen: it is a lexer.
<mrvn_> lexer generator
<Nutssh> My files were really simple, tab-delimited records, each record might have a little internal structure.
<Herrchen> s/a finite automata/a finite automaton/
<mrvn_> ocamlyacc would be the parser part
<Herrchen> mrvn_: yes as I said, it constructs a finite automaton
<mrvn_> Herrchen: sorry for being imprecise.
<Herrchen> we are just talking about the same stuff, was just suprised, by a parser in the first part :)
<Herrchen> because I would use something smaller :)
<mrvn_> yeah, mea culpa.
<Herrchen> thought of a DFA, because properly written, it should be easy, to do string->integer conversion, while scanning
<Herrchen> this could be faster by a constant factor, than searching for split points, splitting, converting, ...
<Nutssh> You'd still have to String.sub it out for the conversion.
<Herrchen> with a scanner? no
<Nutssh> In any case, I fixed this by defining a new dense format. Its now only 20% of my runtime.
<Nutssh> C avoids this by pasting in a '\0', then passing a pointer into the buffer to you with no copying needed. Ocaml can't do that.
<mrvn_> You can define a new string module that just references substrings.
<Herrchen> but I can do the conversion online, while scanning, this way, I have to touch each character excactly once
<Nutssh> At least I don't see how it could. If ocaml had a 'String.of_int string startidx stopidx' function, using the buffer directly?
<mrvn_> If you have multiple levels of spliting then using a referecne to the buffer, start and end as intermediates works well.
<mrvn_> Nutssh: easily written.
* Nutssh hmms, "Didn't think of that.. But you'd pay leaving the automata on every byte of input. A high fixed cost. Opencoding the entire loop manually 'for idx = 0 to String.length line do ... done'. But, 20% of the runtime is fast enough for me. :) I got a factor of 2 earlier by doing a non-generic version of Array.sort (int array, not 'a array)
<Herrchen> well the automaton itself can't easily do the conversion, but you could ...
<mrvn_> If you relay specialize it it could.
<Herrchen> well as far as I understand, the automaton is very simple, so you could handcode it easily
<Nutssh> I did it.. Just copy&paste the code and declare the appropriate args as 'int array'
<Nutssh> Yes. But for 10%, its not that worth it to me.
hangman4 has quit [Operation timed out]
kinners has joined #ocaml
Submarine has quit ["Leaving"]
hangman4 has joined #ocaml
hangman4 has quit ["Leaving"]
pflanze has joined #ocaml
vezenchio has joined #ocaml
<vincenz> Anyone have any experience with "R-Trees"?
<kinners> vincenz: have you had a look at the ocaml Baire library
<vincenz> 'fraid not
<kinners> it's got more trees than a national forest
<vincenz> I know, but specifically r-trees
<vincenz> -> Baire does not contain R-trees
<mrvn_> What are R-Trees?
<vincenz> not quite sure, hence me asking. It's apparently an optimized tree invented around 1984, made specifically for spatial data
Nutssh has quit [Remote closed the connection]
<vincenz> A. Guttman "r
<vincenz> A. Guttman "R-Trees: A Dynamic Index Structure for Spatial Searching." ACM SIGMOD-1984
<vincenz> haven't read it tho (is referred to in a paper I'm reading)
pango is now known as pangoafk
mlh has quit [Client Quit]
kinners has quit [Read error: 110 (Connection timed out)]
cmeme has quit [Read error: 54 (Connection reset by peer)]
cmeme has joined #ocaml
cmeme has quit [Remote closed the connection]
cmeme has joined #ocaml
pangoafk is now known as pangi
pangi is now known as pango
maggesi has joined #ocaml
maggesi has quit [Remote closed the connection]
srv_ is now known as srv
pflanze has quit [Connection timed out]
gim has joined #ocaml
beleg has joined #ocaml
beleg has quit ["[x]chat"]
Nutssh has joined #ocaml
smimou has joined #ocaml
pango has quit ["Leaving"]
pango has joined #ocaml
mattam_ is now known as mattam
goomba has quit [Read error: 104 (Connection reset by peer)]
Herrchen has quit ["bye"]
Submarine has joined #ocaml
monochrom has joined #ocaml
Submarine has quit ["Leaving"]
m3ga has joined #ocaml
vezenchio has quit ["smile, Rakka ..."]
m3ga has quit ["Client exiting"]
mlh has joined #ocaml
smimou has quit ["?"]