gl changed the topic of #ocaml to: OCaml 3.07 ! -- Archive of Caml Weekly News: http://pauillac.inria.fr/~aschmitt/cwn , A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ , A free book: http://cristal.inria.fr/~remy/cours/appsem, Mailing List (best ml ever for any computer language): http://caml.inria.fr/bin/wilma/caml-list | http://icfpcontest.org/ !!
GreyLensman has joined #ocaml
Axioplase has joined #ocaml
<Axioplase> Chat Lu!
Iter has quit [Read error: 110 (Connection timed out)]
CosmicRay has joined #ocaml
Tarka has quit ["leaving"]
badonaway is now known as badon
mattam_ is now known as mattam
CosmicRay has quit ["Leaving"]
mfurr has quit ["leaving"]
det has quit [Remote closed the connection]
yauz_ has joined #ocaml
yauz has quit [Read error: 113 (No route to host)]
_fab has quit [Read error: 110 (Connection timed out)]
_fab has joined #ocaml
bk_ has joined #ocaml
lambdawar has quit [Remote closed the connection]
kinners has joined #ocaml
xolution has joined #ocaml
xolution has quit [Read error: 104 (Connection reset by peer)]
Lemmih has quit [Remote closed the connection]
Lemmih has joined #ocaml
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
Axioplase has quit ["error 8.6 (Connection reset by beer)"]
kinners has quit [Read error: 110 (Connection timed out)]
mrsolo has joined #ocaml
GreyLensman has quit ["Leaving"]
monotonom has joined #ocaml
CosmicRay has joined #ocaml
cjohnson has quit [Read error: 54 (Connection reset by peer)]
Herrchen_ has joined #ocaml
Herrchen has quit [Read error: 110 (Connection timed out)]
wedman has joined #ocaml
CosmicRay has quit ["Leaving"]
bk_ has joined #ocaml
quix has joined #ocaml
<wedman> So... Is there ever any discussion around here. :p
wedman has left #ocaml []
<Riastradh> Only annually.
<Riastradh> This year's conversation was a couple days ago.
<bk_> now you violated our vow of silence
monotonom has quit ["Don't talk to those who talk to themselves."]
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
Herrchen_ is now known as Herrchen
<Herrchen> moin
<Riastradh> niom
bk_ has joined #ocaml
<mrsolo> hmm how important is unit testing suit in ocaml?
Snark has joined #ocaml
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
det has joined #ocaml
smimou has joined #ocaml
mrsolo has quit [Read error: 104 (Connection reset by peer)]
mrsolo has joined #ocaml
dan|el has quit [Read error: 110 (Connection timed out)]
Stigmaata has joined #ocaml
Stigmaata has left #ocaml []
bk_ has joined #ocaml
smimou has quit ["?"]
smimou has joined #ocaml
<Banana> hi.
<bk_> hi
quix has quit ["Lost terminal"]
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
bk_ has joined #ocaml
ita has joined #ocaml
<ita> hi all
cjohnson has joined #ocaml
buggs^z is now known as buggs
vezenchio has quit ["According to [a processor for game design], you statistically have a better chance of becoming a rock star than you do of suc]
<vincenz> mrsolo: how important is changing your tired on a ford?
<vincenz> tires even
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
Vulpyne has joined #ocaml
<Vulpyne> Hi. This may seem like a dumb question, but I haven't been able to find the answer in the docs: How can I make a method in a class recursive?
<Vulpyne> "method rec blah blah" doesn't work.
<Vulpyne> Nevermind, I'm smart!
<Vulpyne> self#blah
dobrek has joined #ocaml
<ita> i don't know why, but coding in ocaml with vim is less pleasant than eg:c++
* ita uses kate now
<cDlm> c++ in vim ? i wouldnt call that pleasant :)
<ita> cDlm: try "gg=G" and you'll see the power of it
<cDlm> what is it meant to do ?
<ita> try and see :)
<cDlm> i dont have C++ code at hand :p
<cDlm> and I won't.
<ita> it reindents the whole file
<cDlm> oh
<ita> (does not work really well in caml - indenting does not work well btw)
<cDlm> camlp4 works
<ita> yep, but it's ugly
<cDlm> but caml tends to have lots of nesting
<cDlm> so indenting it nicely is not easy
<Banana> tuareg mode for emacs is realy neat.
<ita> yeah, if you can stand emacs :)
<Banana> of course.
<ita> my little finger aches everytime i use it
<cDlm> mine too
<cDlm> mais faute de grives...
<ita> ctrl+meta X meta shift Y reindent true then escape three times
<cDlm> :)
<ita> it's so frustrating they've put a psychologist in it
<ita> nah, i have kate now, works well enough
* cDlm hates both vim and emacs
<ita> cDlm: you can't - you have to choose one :)
<Banana> nedit ?
<Banana> funny how this kind of conversation pops up now and then...
<ita> Banana: hehe, it's like linux vs win32 or apple vs linux or j2ee vs .net ..
<cDlm> yes I chose emacs, but that does not mean I like it
<ita> cDlm: :)
CosmicRay has joined #ocaml
karryall has joined #ocaml
ita has quit ["Lost terminal"]
Iter has joined #ocaml
ita has joined #ocaml
<vincenz> Small question
<Banana> yep ?
<vincenz> Unix.listen expects a number )number of sockets)
<vincenz> is the number of listening sockets? What should this number be set to typically?
<mattam> man listen
* vincenz still isn't quite sure.
<vincenz> So if I use for instance: 5.... 5 people can connect at the same time. But once cnonected more can connect? Or is it the number of people that -can- be connected?
<Riastradh> The number of people that can be waiting to be accepted.
<vincenz> AH alright, thank you :)
<vincenz> That clarifies
<ita> what's the type of a mutex ? i want to make the following : type emp = { rot : int; mutx : t ..
<vincenz> Mutex.t
<ita> thanks !
<vincenz> ocamlmktop -thread -custom -o unixtop unix.cma threadunix.cma -cclib -lunix -lthreads
<vincenz> nm
<vincenz> But I can't access Threadunix
<mattam> ThreadUnix ?
<vincenz> nonblocking IO?
<vincenz> Unix-io blocks all threads on io-reads, not just the thread reading
<vincenz> # ThreadUnix.accept();;
<vincenz> Unbound value ThreadUnix.accept
<mattam> nowadays the Unix module has the ancient ThreadUnix behavior
<mattam> see the ThreadUnix reference manual page, at the top
<vincenz> Oh
* vincenz is raeding from the oreilly book
<vincenz> ocamlmktop -thread -custom -o unixtop unix.cma threads.cma -cclib -lunix -cclib -lthreads
<vincenz> Ah, thnx :)
monotonom has joined #ocaml
<vincenz> So I can do just do input_line ?
<mattam> input_line in another thread ?
<mattam> i think so
<vincenz> well...on the oc of the socket
<mattam> yes
<vincenz> See I'm following the chapter 20 in o'reilly obok
<vincenz> but they go all out cause they have to use ThreadUnix (And hence make their own inputline func)
<vincenz> but if I can just use the Unix module now.. I can use the first part (where they use fork) way of reading but still use lightthreads
<mattam> maybe there are some buffering issues they overcome in their own inputline ?
<vincenz> nope
<vincenz> purely cause you can't use the Unix module...and hence in_channel_of_descr is not used
<vincenz> hmm
<monotonom> I'll play a bit of a historian.
<monotonom> When the book was written, the Unix module was not thread-safe.
* vincenz nods
<monotonom> Then they added ThreadUnix containing thread-safe replacements.
<vincenz> (small side question...can I call the in_channel_of_descr in the thread creating the sockets, and still use it after in the thread created by the connection class?)
* vincenz nods
<monotonom> But the newest development is that the module Unix is now thread-safe and you no longer need ThreadUnix.
<vincenz> What was the original reason of keeping Unix when ThreadUnix existed?
Axioplase has joined #ocaml
<mattam> i think not all Unix functions were implemented by ThreadUnix
<vincenz> Ah ok
<Axioplase> Chat Lu!
Snark has quit ["Parti"]
* vincenz wonders why he can't get Mutex.create() to work
<vincenz> It doesn't seem to know it
<vincenz> Nonetheless: ocamlmktop -thread -custom -o unixtop unix.cma threads.cma -cclib -lunix -cclib -lthreads
<monotonom> I think all functions can be called from one thread, and its result used in another thread with the first thread dead. It does not violate mutual exclusion. The only exception is Thread.self followed by Thread.id of course.
<ita> does the garbage collector work well when threading is used in programs ?
* vincenz curses as it won't recognize the Mutex module
<vincenz> Euhm...I looked at that
<vincenz> Mutex.create;; -> unknown
* ita does ocamlopt -thread unix.cmxa threads.cmxa binpack.ml -o prodcons
<ita> Mutex.create();;
<vincenz> ocamlmktop -thread -custom -o unixtop unix.cma threads.cma -cclib -lunix -cclib -lthreads
<ita> won't work without parenthesis
<vincenz> I know
<vincenz> I just wanted he signature
<ita> oh
<vincenz> # Mutex.create();;
<vincenz> Unbound value Mutex.create
<monotonom> binpack?! You have a polynomial-time bin-packing algorithm?!! I want it!!!
<ita> monotonom: haha, you won't :)
<ita> and it's 2d, not 1d bin packing
<vincenz> Know why it doesn't recognize Mutex?
<ita> monotonom: i'm working on a threaded genetic algorithm for 2d bin packing (http://freehackers.org/~tnagy/linpacker/index.html will have it)
<vincenz> Nice, how'd you make the gui?
* vincenz curses as the Mutex is nonexistent
<vincenz> Nor Thread.create...
<Vulpyne> vincenz: I'm an ocaml newbie, but maybe you need to use ocamlmktop like with the Unix module?
<ita> vincenz: the gui is in qt/kde libs - i'm rewriting and improving one of the algorithms from c to ocaml
<vincenz> I did
<vincenz> ocamlmktop -thread -custom -o unixtop unix.cma threads.cma -cclib -lunix -cclib -lthreads
<vincenz> It doesnt like me
<Vulpyne> What if you put the blah.cma stuff near the beginning?
<Vulpyne> Before the -o.
<vincenz> no need
<vincenz> unix is recognized
<ita> vincenz: what linux distro are you on ? debian ? maybe ocaml-native-compilers missing ?
<Vulpyne> Sorry, then I don't know.
<vincenz> mandrake
<vincenz> and I have the native compilers
<vincenz> I've made progs before
<vincenz> plus the unix module is recognized
<mattam> ocamlfind ocamlmktop :)
* vincenz doesn't have ocamlfind
<mattam> that's very handy
<vincenz> What's it do?
<ita> oh, mandrake, i'm on it at home - mdk 10 - and threading in ocaml does work
<mattam> you tell it which packages you want (including threads, camlp4) and it executes the right command
<vincenz> ita: mdk 10 too
<vincenz> all I can think of is that I'm doing the ocamlmktop wrongly
Iter has quit [Read error: 110 (Connection timed out)]
<vincenz> ocamlmktop -thread -cclib -lunix -cclib -lthreads -custom -o unixtop unix.cma threads.cma
* vincenz sighs
<vincenz> I know this has worked before..
<vincenz> :(
<vincenz> please?
<mattam> no idea here
<vincenz> It doesn't know the modules
<vincenz> Mutex, create..
* vincenz mutters
<mattam> i have the same problem :)
<vincenz> So threads can't be used?
<mattam> it seems
<vincenz> Not only that
<vincenz> ocamlmktop -custom -thread -o threadedocaml threads.cma -cclib -lthreads
<vincenz> is wrong
<vincenz> cause thread now expects unix module
* vincenz shoots himself
GSF has joined #ocaml
<ita> monotonom: what are you doing with bin packing btw ?
<mattam> i used the one you propose, i can open Unix but not Thread or Mutex
Oniroi has left #ocaml []
<GSF> hi, I'm having some trouble compiling lablgtk 2.20 in windows, can anybody help me?
<vincenz> mattam: what do you use then traditionally?
<mattam> i don't build toplevels usually
<GSF> I'm using MSVC++ as the compiler (along with MASM) and I've been able to compile a simple hello world with gtk+
<GSF> but I'm having some problems compiling lablgtk.. I cannot ./configure in cygwin terminal..
<GSF> It can't find ocamlmklib
<GSF> also, the distribution I'm using is the native Win32 port based on the Microsoft toolchain
<GSF> help ?
<Banana> vincenz: ocamlmktop -o topdelamort -thread -I +threads unix.cma threads.cma
<Banana> then ./topdelamort -I +threads
<Banana> and you can open Thread, ThreadUnix or whatever you want.
<mattam> ha
<mrsolo> vincenz: once a while.. the reason i asked because of strong type checking system in ocaml, it makes having extensive unit tests less important
<mrsolo> therefore i am just wondering if people do regularly construct unit test cases when program in ocaml, or just do some ad hoc testing
<ita> have a nice weekend everybody
ita has quit ["i'll be back"]
<GSF> :\
<Banana> GSF: i don't understand...
<Banana> do you use native Win32 ocaml port or cygwin ?
<GSF> I use native win32 port for msvc
<GSF> but in order to compile lablgtk, I need the cygwin tools
<Banana> hum...
<GSF> or at least that's what the readme says
<Banana> it will compile a cygwin version methink.
<Banana> there are dll for the windows port.
<GSF> yes, but if I use the dll's, I'm not able to do native compilations with ocamlopt
<GSF> You will need either the MSVC or mingw version of ocaml 3.07,
<GSF> and cygwin development tools.
<Banana> if you use cygwin tools you need proper ocaml installation in cygwin too...
<vincenz> Banana: thnx!
<Banana> GSF: i'm not expert in windows port of ocaml though :/
<GSF> well, thanks anyway
<vincenz> hmm
<vincenz> Thread 2 killed on uncaught exception Sys_error("Bad file descriptor")
<vincenz> Seems I don't have to close a desc
<vincenz> descr
<vincenz> client quits...I close the in and out chans, and I don't have to close the descr?
<Banana> GSF: but afair Win32 isn't officially supported with lablGtk2.
<Banana> lablgtk1.2 is.
<vincenz> Never mind, I don't have to close the in and outchans derived from the descr
<GSF> hmmm
<vincenz> only the descr itself
<Banana> well, i'm going back home.
<Banana> see you people.
<GSF> later Banana
<vincenz> fucking crap connection
<vincenz> There's a badlink between brussels and newyork that sometimes acts up
<vincenz> for some stupid reason it acts up at 6pm central-european time (GMT+1)
<vincenz> 83% packetloss
<vincenz> ah it's the link between brussels and london
<vincenz> 5 ae-0-17.mp1.Brussels1.Level3.net (212.3.239.97) 9.382 ms 4.461 ms 7.111 ms
<vincenz> 6 * * as-0-0.mp2.London1.Level3.net (4.68.128.105) 192.797 ms
<vincenz> Anyways...
* vincenz is trying to build a mud framework with this code he's writing in ocaml. So everyone has their connection....Now...how to make the code work.... Parsing happens within the thread of the connection, but what about the actions? Send them into some queue to be handled by a worldthread or make all accesses to the world happen through a set of functions that are mutexed..?
karryall has quit ["tcho"]
maihem has joined #ocaml
mrsolo has quit [Read error: 104 (Connection reset by peer)]
basti_ has joined #ocaml
GSF has quit []
CosmicRay_ has joined #ocaml
CosmicRay_ has quit [Read error: 104 (Connection reset by peer)]
FredCods has joined #ocaml
basti_ has quit []
<jlouis> vincenz: most mod code I have seen does not use threads at all
<jlouis> mud even
<jlouis> They simply walk a list of connections, seeing if there is any commands to be done
<jlouis> and a timer controls what happens at major ticks
<vincenz> isn't it better to use threads?
<buggs> vincenz, select should be faster
mattam_ has joined #ocaml
<vincenz> oh
<vincenz> hmm
<vincenz> I was thinking a light thread each, a parser..
<vincenz> So it can be used as a general server, not a mud perse
<vincenz> (in the spirit of cold)
<jlouis> cold?
<vincenz> www.cold.org
<vincenz> pretty neat
<vincenz> all the code is in this language called coldc
<vincenz> and the server itself just accepts requests and passes it to coldc
<vincenz> so you can make anything with it
<vincenz> there is a standard db with lot of functionality in it, but willingly you could start from scratch
mattam has quit [Read error: 110 (Connection timed out)]
* vincenz hmms
reltuk has joined #ocaml
<jlouis> You could choose do it the way you want, but I would not even begin to think in threads when working on a MUD
<reltuk> jlouis: why not? I/O at the least should probably be done on a separate thread
<vincenz> plus
<vincenz> I could have aech thread parse
<reltuk> and a lot of the time you've got quite a few things happening that don't affect other areas of the world...so if you can serialize it in accordance with world boundaries, it's conceivable that you can avoid a lot of serialization headaches
<vincenz> and only basic actions could then go to the world itself
<jlouis> every succesful parse will yield a world action of some kind
<vincenz> no
<jlouis> aha
<vincenz> an ast of actions
<reltuk> vincenz: at the least, if you're spawning a thread per connection you can parse input and serialize messages regarding events on each separate thread...
<vincenz> reltuk: that's what I was thinking
<vincenz> plus I cuold have another thread 'timer' to schedule stuff
<vincenz> the world itself being passice
<vincenz> passive even
<vincenz> just not sure yet how to make a clean design
* vincenz wonders how he can do read-many, block read when write-once
<reltuk> it seems like each thread could handle almost all game logic...
<vincenz> except communication
<reltuk> except propagating events and world AI
<reltuk> so each thread has a message queue that the world is pumping as output to the user
<vincenz> I'd like some language resting on top of the framework, and everything is implemented in that language, with some basic elements implemented in the ocaml code hooking to what lies beneath
<reltuk> and each thread feeds a server's message queu
<vincenz> how do you do queues?
<vincenz> plus how do I ensure the world queue has higher priority so it has time to run through it's queue?
CosmicRay has quit ["Client exiting"]
<reltuk> hmm...I'm sure ocaml has some sort of datatype for it...you might have to serialize insertion on the main world's queue
* reltuk notes that most MUD servers aren't pushing 100% processor usage
<vincenz> aha
<vincenz> each mesasge would have a connection number and it's actions
<vincenz> and then the world would have rules: say: send to the connection number as ewll as all the other ones in the same room
<vincenz> (well connection would have to be something more abstract than just anumber_
<vincenz> coldc is really nice
<reltuk> what's coldc?
<vincenz> Maybe I should stick to that
<vincenz> www.cold.org
<vincenz> the driver itself only knows an internal db format and connections
<vincenz> everything else is written in the coldc language
<vincenz> so you can make any type of server with it you want
<vincenz> there are few tie-ins towards the driver, but the rest is coldc code
<reltuk> wow, looks cool
<vincenz> I wrote my own db with many things (though it's much like the colddb they have)
<vincenz> except I don't like the system of doing ansi they use in their db
<vincenz> But I'm stuck with my db
<vincenz> there's some problems with the way I implemented the parsing-system
<reltuk> MUD servers can be interesting to write
<vincenz> Not when doing it alone though :/
<reltuk> *shrug*, guess it depends on how ambitious you get
<vincenz> it's nice to bounce ideas around
<vincenz> The idea of my server is that admins can do anything, programmers have access to the coding facilities, builders have verbs just to build, and then well players
<vincenz> the admin already has the possibility of editing code live
<reltuk> cool...most systems don't provide the flexibility of live code editing
<vincenz> that's why I thought ocaml would be perfect for this
<reltuk> ocaml is statically bound....
<vincenz> I know but it makes for great compilers
<vincenz> So a middle-level language could be used
<vincenz> with the ast in ocaml
<reltuk> ahhh...a middle level dynamically bound language...
<vincenz> and when you run through an ast, it sends actions to the world
<vincenz> sounds like a nice excercise :)
<reltuk> dynamic binding can get hairy
<vincenz> how do you mean?
<reltuk> you can accidently change things without realizing it
<reltuk> that functions that you're calling use or whatever
<vincenz> well
<vincenz> well the world is a set of objects
<vincenz> with attributes (including code attributes)
<vincenz> hence
<vincenz> I need some way of doing read-many, block raed on write
<vincenz> (not a mutex on every read/write..)
<vincenz> preferably temporarily blockable on sync with db/hd
hoisie_ has joined #ocaml
hoisie has quit [Read error: 60 (Operation timed out)]
bk_ has joined #ocaml
Research has joined #ocaml
mattam_ is now known as mattam
yauz_ is now known as yau
yau is now known as yauz
Research has quit [Remote closed the connection]
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
bk_ has joined #ocaml
Godeke has quit [Read error: 104 (Connection reset by peer)]
dobrek has quit [Read error: 110 (Connection timed out)]
CosmicRay has joined #ocaml
sundeep has quit [Client Quit]
cmeme has quit [Read error: 54 (Connection reset by peer)]
<Axioplase> ++
Axioplase has quit [Read error: 104 (Connection reset by peer)]
cmeme has joined #ocaml
cmeme2 has joined #ocaml
Alain_ has joined #ocaml
cmeme has quit [Remote closed the connection]
cmeme2 has quit [Read error: 104 (Connection reset by peer)]
cmeme has joined #ocaml
cjohnson has quit [Read error: 54 (Connection reset by peer)]
CosmicRay has quit ["Client exiting"]
bitwiseshiftleft has joined #ocaml
<bitwiseshiftleft> question: i'm on freebsd -CURRENT, and if I type ledit ocaml, then the first character i type crashes ledit
<bitwiseshiftleft> how do I fix this?
<bitwiseshiftleft> other programs don't seem to crash ledit
<bitwiseshiftleft> the error is
<bitwiseshiftleft> (ledit) Unix error: Resource temporarily unavailable
<bitwiseshiftleft> On function read
Alain_ has quit ["Leaving"]
cmeme has quit [Read error: 54 (Connection reset by peer)]
Nutssh has left #ocaml []
cmeme has joined #ocaml
cmeme has quit [Read error: 54 (Connection reset by peer)]
cmeme has joined #ocaml
buggs has quit [Read error: 110 (Connection timed out)]
<bitwiseshiftleft> re my question: upgrading ocaml and rebuilding fixes it
bitwiseshiftleft has quit ["[BX] Pretzel Boy uses BitchX. Shouldn't you?"]
reltuk has left #ocaml []
namin has joined #ocaml
smimou has quit ["?"]
Iter has joined #ocaml
namin has left #ocaml []
buggs has joined #ocaml
gim has quit ["'ne nuit tt le monde"]
_fab has quit [Read error: 60 (Operation timed out)]