mfurr changed the topic of #ocaml to: OCaml 3.08.2 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/
<dan2> does anybody have any examples of using select in ocaml?
<dan2> are there any threading frameworks for ocaml predesigned like worker, or threadpool
<jason_> O.o
<jason_> What do you mean by "select"?
<jason_> Dan?
<dan2> jason_: the event handler
<dan2> jason_: (on fd)
CosmicRay has joined #ocaml
Nutssh has joined #ocaml
Nutssh has left #ocaml []
Nutssh has joined #ocaml
Nutssh has left #ocaml []
<dan2> whats the best route for asynchronous networking in ocaml
<jason_> Hm. I just use Threads.
<jason_> dan2: I could give you a little example program, if you want.
<dan2> jason_: yes, please thanks
<dan2> jason_: you have an example of use of poll and select too?
<jason_> Hm, no.
<jason_> But, I could figure them out some time.
<dan2> jason_: thats ok
<dan2> jason_: let me see asynchronous io
<jason_> Here's the first module.
<jason_> jtcpsocket.ml
<jason_> Here's an example of asychronous communication, a proxy.
<Riastradh> Ugh, does OCaml still not have a socket interface at a higher level than a thin film over BSD sockets?
<jason_> Well :p That's what this is.
<jason_> It's highly imperative though.
<dan2> Riastradh: haha
<dan2> jason_: I see
<dan2> Riastradh: bsd sockets are pretty easy to work with
<jason_> Yeah, to make a new tcpsocket just: let mySocket = new jtcpsocket "www.google.com" 80;;
<Riastradh> If you're a Unixoid weenie, sure. They're otherwise full of painful superfluity in expression.
<dan2> Riastradh: so used to using them in C, its a enlightenment with out structs in Ocaml
<dan2> jason_: eww object oriend ocaml :)
<jason_> And then you can say: let printLine nextLine = print_endline nextLine in mySocket#eachLine printLine;;
<jason_> Hehe.
<jason_> You mean object oriented object oriented Caml? Heh.
<dan2> using classes in ocaml sucks
<jason_> Not really :p
<jason_> They're pretty nifty in my humble opinion.
<dan2> jason_: they're ugly
<jason_> You saw that example I just gave?
<dan2> yes
<dan2> very ugly
<dan2> :)
<jason_> That iterates every line that comes out of the socket and prints it to the screen.
<jason_> Like, a single expression.
<jason_> Not ugly at all, actually.
<jason_> Just, different.
<Riastradh> Why did you choose to use classes instead of an ADT, jason_?
<jason_> A lot of people say Ocaml itself is ugly.
* Riastradh agrees!
<jason_> Riastradh: Because I wanted to make a Rubyesque socket library.
<dan2> whats an ADT?
<Riastradh> Abstract data type.
<jason_> Riastradh: It's an example for a friend of mine who uses Ruby a lot. Just to show him how Ocaml can do anything Ruby can, and more.
<jason_> It's actually pretty spiffy.
<dan2> jason_: ocaml is enternal bliss compared to C with buffer overflows and otehr nasty shit
<jason_> Yeah, so is Java though.
<jason_> The syntax of Ocaml is just wildly different.
<Riastradh> Was there any reason beyond that in terms of expressiveness or functionality for using the object system?
<jason_> I think, the more I've gotten used to it, the more readable it becomes.
<dan2> jason_: the syntax of ocaml is logical
<dan2> jason_: creating new operators in ocaml is great
<jason_> I think, at this point, the syntax is more readable than C++.
<dan2> jason_: certain C++
<jason_> Well.. New operators doesn't make your code more readable :p
<dan2> jason_: I refuse to use C++ unless I'm using Qt
<jason_> And, the objects in Ocaml are definitely far superior in readability than C++.
<dan2> jason_: (not that I use Qt's gui widgets)
<dan2> Qt is a kickass lib for C++ that has anything anybody would have ever wanted in C++ in it
<jason_> Riastradh: Well. Hm. I'm not sure yet.
<dan2> and Qt4 finally has some decent network socekts
<jason_> Riastradh: I think the way I layed things out works particularly well with an Object system.
<dan2> jason_: I don't see the thread code in there
<jason_> Look in the proxy example.
<Riastradh> Would it be very much different, though, if you used an ADT & functions on it?
<dan2> Riastradh: I doubt it
<jason_> Riastradh: Probably not, I'll try out doing the same thing with a module instead.
<jason_> See if I run into any problems.
gim has quit [Read error: 110 (Connection timed out)]
<dan2> jason_: you didn't by any chance mention to your friend that ocaml is drasticall yfaster than ruby? :)
<jason_> Well.. Not Drastically.
<jason_> But, definitely faster.
<jason_> I use Ruby too still :p
<jason_> So, do you see the thread now?
<dan2> yes
<jason_> You just create it on the socket.
<jason_> Well, on the eachLine routine.
<jason_> The underlying code is thread safe.
<dan2> does anybody have an example using thread.select
<jason_> Why do you want to use Thread.select so bad?
<jason_> Doesn't it just block until a file can be accessed or something?
<dan2> jason_: because I need to see it in use, because I need to use it
zzorn is now known as zzorn_sleep
zzorn_sleep has quit ["........"]
<jason_> dan2: Do you know what all of the arguments mean?
<dan2> jason_: not entirely
<dan2> I don't know what the third unix fd list does
<jason_> Just "exceptional" items or something.
<jason_> I just used an empty list.
<dan2> jason_: whats exceptional mean
<dan2> jason_: items where the first two apply?
<dan2> where you are using the same fd for read/write
<jason_> Maybe.
<jason_> I'm checking it out :p
<dan2> jason_: ahh, the unix manual says its where there is an exception on the fd
<jason_> I'm assuming though that you can use the same descr in both lists read and write.
<jason_> Alright, so something bad happened.
<dan2> jason_: what happens if you try to use the same one in both lists
<jason_> I dunno :p I'm playing around with it right now.
* dan2 wonders if he's waiting for a socket fd, what does it do when its finished
<dan2> I mean obviously its a different fd right?
<jason_> What do you mean?
<jason_> When it's done selecting?
<jason_> It just waits until a decr is ready from its list, and then returns a tuple with a list for each of the types of descr.
<jason_> Basically, all of the ones that were ready.
<dan2> jason_: but I mean, how do I specify which fds will be ready
<dan2> jason_: socket returns an fd
<dan2> so how does select know if it can get that fd
<dan2> or how does it add it to its list or something
<jason_> Because you send it to it.
<dan2> jason_: I'm lost now
<jason_> You say "Thread.select [oneSocket, twoSocket, threeSocket] [] []
<dan2> sure
<jason_> And it waits until one of those descrs can read, and returns a tuple with three lists.
<jason_> Or write or something can be done with one of them.
<dan2> you are missing something
<dan2> how does select know what fds are available to it
<jason_> Then, you pattern match on that list, split up all of the channels, and read from the ones that can be read, and write to the ones that can be written to.
<jason_> I don't think I understand your question.
<jason_> Like, how does it know when they're ready for input or have output?
<dan2> no
<dan2> how does it know which fds are available to it
<dan2> jason_: ok
<dan2> let me try and give an example
<dan2> I've got 5 threads
<dan2> god this isn't working
* dan2 doesn't know how to explain it
<dan2> jason_: ok, if the thread runs through once, and it listens on the same fd, its unlikely it will ever get run again right?
<jason_> Maybe the fd didn't have any input at the time that it ran?
<dan2> jason_: no, that has nothing to do with it
<jason_> It would loop through again, find out it had input the second time around, and process it.
<dan2> jason_: its really hard for me to explain this
<dan2> if it runs through once
<dan2> its likely that fd will never be seen again
<dan2> so do you have to make mutable fds or something
<dan2> so that the same names will always work
<jason_> So, you want to add new sockets dynamically or something to this list?
<jason_> Like, tell me what you're trying to do specifically.
<dan2> jason_: yes, add sockets dynamically to the list
<dan2> thats what I want
<jason_> I have an example if you want.
<dan2> could I see that, with threads in it
<jason_> Wait, lemme try it with two sockets.
<jason_> That'll be more interesting.
<jason_> And, illustrate its use better.
<jason_> I'm just ctrl-king stuff, so it's gonna be sloppy :p
<dan2> ok
<jason_> Hm, know a server that outputs text on entry?
<dan2> an echoserver
<dan2> jason_: echoservers are pretty easy to implement in any lang
<dan2> jason_: where is it?
<jason_> What?
<jason_> The source?
<jason_> I'm still trying to get it to work with two sockets.
<jason_> It reads one of them, it looks like.
<jason_> Ha, I forget to put it in the list.
<jason_> It works though :)
<jason_> Awesome.
<dan2> ok, let me see this
<dan2> jason_: and it will autoupdaet the list?
<jason_> No.
<dan2> jason_: I thought that was the idea
<jason_> I'm not sure what to do with dynamically adding new sockets.
<jason_> I bet you could just use a ref.
<jason_> A ref to the read list.
<jason_> And, in the rec procReady () function, just pass the reffed list with the new socket appended to it.
<jason_> I bet you can have the select time out sooner..
<jason_> And just have it act like non-blocking.
<jason_> Have the timeout go to a piece of code that non-block accepts a server socket and appends to the list.
<jason_> Just so you know, Threads are good too ;)
<jason_> Ocaml threads are pretty stable.
<dan2> yes
<dan2> hmm
<dan2> this is kinda stupid
<dan2> in C, file_descr are just integers
<dan2> in fact, shorts
<jason_> Yeah.
<dan2> this approach is stupid
<jason_> The select approach?
<dan2> because lets say its only going to be 5 threads
<jason_> The select approach only uses one thread.
<dan2> I'll want select grabbing only every 5 + thread num
<dan2> for instance
<dan2> thread one will only look to get fds on
<dan2> 1 6 11 16 21 26 ...
<jason_> Okay.
<jason_> So, have Thread.select in five different threads, and pass it lists containing only those threads?
<dan2> exactly
<dan2> because if you want to use the same fd to read and write
<dan2> you'll get screwy issues otherwise
<jason_> Do you?
<jason_> I'd have to check on that.
<dan2> yes
<jason_> I bet you don't.
<dan2> well, I need fds that I can read and write from
<jason_> Besides, all of your communication is local.
<jason_> Just have a Mutex associated with the file descriptor or something.
<jason_> And, lock on it.
<jason_> I dunno.
<jason_> Yeah, just use those fds and wait for read on them, and in a separate thread have it wait to write to the same ones.
<jason_> You may not even need to use a Mutex come to think of it..
<jason_> Hm.
<jason_> I'll play around with it a bit later, this is some pretty nifty stuff.
* dan2 needs a way to make sure he can get both on the same
* dan2 has a headache
<jason_> dan2: Note the file descriptors I used are two ways.
<dan2> hmm
<dan2> jason_: you know what
<jason_> I mean, I could, inside of that match statement in that selector write to the socket.
<dan2> jason_: it doesn't matter if I list them both in the select
<jason_> Probably not.
<dan2> jason_: I mean list twice
<dan2> so thats what I'll do
<jason_> Just parse out the second list, and, if it isn't ready to be written to, it isn't ready.
<dan2> but dynamically updating lists is important
<jason_> I mean.. You're not going to have anything weird happen, because you're just in a single thread.
<jason_> Yes, that is.
<jason_> You can do that though, just make the lists a ref.
<jason_> And, have it time out earlier.
<dan2> jason_: what do you mean timeout earlier?
<jason_> Then have it accept on your server port, and add the connection to taht list.
<jason_> Notice the 10.0 float.
<dan2> oh, 10 second time out?
<jason_> That means for Thread.select to wait for 10 seconds for any of those descriptors to become ready.
<jason_> Exactly.
<dan2> what happens after 10 seconds
<jason_> I dunno.. Might throw an exception.
<jason_> Lemme look.
<dan2> jason_: too keep it without mutexes, you should create an fd list for each thread
<dan2> jason_: and use the round robin system
<dan2> dunno if that makes sense
<jason_> Hm.
<dan2> that doesn't make sense
<jason_> I need to go get something to drink.
<jason_> I've been inside all day ;)
<jason_> Hehe.
<jason_> Hope I've been a shred of help.
<dan2> yeah alot
<dan2> how do you ref a list
<jason_> Good luck.
<jason_> ref []
<dan2> how do you update it?
<dan2> hmm
<dan2> I know how
<dan2> :)
<jason_> Use the := operator.
<jason_> Okay :p
<jason_> Yeah.
<jason_> like "let myList = ref [];;" "myList := 5::!myList;;"
<jason_> See you later :p
<dan2> ok cya
<dan2> the threads need to be able to delete the entry they grabbed from the list
cmeme has quit [Read error: 110 (Connection timed out)]
stef has quit [tolkien.freenode.net irc.freenode.net]
det has quit [tolkien.freenode.net irc.freenode.net]
Excedrin has quit [tolkien.freenode.net irc.freenode.net]
Smerdyakov has quit [tolkien.freenode.net irc.freenode.net]
Godeke has quit [tolkien.freenode.net irc.freenode.net]
pango has quit [tolkien.freenode.net irc.freenode.net]
Demitar has quit [tolkien.freenode.net irc.freenode.net]
dan2 has quit [tolkien.freenode.net irc.freenode.net]
noj has quit [tolkien.freenode.net irc.freenode.net]
calvin_ has quit [tolkien.freenode.net irc.freenode.net]
shawn has quit [tolkien.freenode.net irc.freenode.net]
CosmicRay has quit [tolkien.freenode.net irc.freenode.net]
rossberg has quit [tolkien.freenode.net irc.freenode.net]
creichen has quit [tolkien.freenode.net irc.freenode.net]
mellum has quit [tolkien.freenode.net irc.freenode.net]
zxy_ has quit [tolkien.freenode.net irc.freenode.net]
Riastradh has quit [tolkien.freenode.net irc.freenode.net]
mrsolo has quit [tolkien.freenode.net irc.freenode.net]
vezenchio has quit [tolkien.freenode.net irc.freenode.net]
srv_ has quit [tolkien.freenode.net irc.freenode.net]
shammah has quit [tolkien.freenode.net irc.freenode.net]
ayrnieu has quit [tolkien.freenode.net irc.freenode.net]
drz has quit [tolkien.freenode.net irc.freenode.net]
mflux has quit [tolkien.freenode.net irc.freenode.net]
jason_ has quit [tolkien.freenode.net irc.freenode.net]
judge has quit [tolkien.freenode.net irc.freenode.net]
oracle1 has quit [tolkien.freenode.net irc.freenode.net]
tewk has quit [tolkien.freenode.net irc.freenode.net]
slashvar[TP] has quit [tolkien.freenode.net irc.freenode.net]
CosmicRay has joined #ocaml
stef has joined #ocaml
jason_ has joined #ocaml
pango has joined #ocaml
dan2 has joined #ocaml
mrsolo has joined #ocaml
vezenchio has joined #ocaml
zxy_ has joined #ocaml
Demitar has joined #ocaml
mflux has joined #ocaml
det has joined #ocaml
rossberg has joined #ocaml
srv_ has joined #ocaml
judge has joined #ocaml
Godeke has joined #ocaml
Excedrin has joined #ocaml
Smerdyakov has joined #ocaml
oracle1 has joined #ocaml
creichen has joined #ocaml
shammah has joined #ocaml
ayrnieu has joined #ocaml
calvin_ has joined #ocaml
shawn has joined #ocaml
mellum has joined #ocaml
noj has joined #ocaml
Riastradh has joined #ocaml
drz has joined #ocaml
tewk has joined #ocaml
slashvar[TP] has joined #ocaml
_shawn has joined #ocaml
skylan has quit [Read error: 104 (Connection reset by peer)]
skylan has joined #ocaml
shawn has quit [Connection timed out]
jeff2 has joined #ocaml
Smerdyakov has quit ["Client exiting"]
Smerdyakov has joined #ocaml
CosmicRay has quit [Read error: 113 (No route to host)]
purevoid has joined #ocaml
<purevoid> Hi, I'm goind OS dev and want to use OCaml in kernel dev
<purevoid> and wondering how I could compile the ocamlopt compiler to generate object code to target my arch
<purevoid> I have a gcc cross-compiler (3.4.1), with newlib
davidmccabe has joined #ocaml
<Riastradh> It might help to specify what architecture this is.
<davidmccabe> hi folks.
<Riastradh> Hi.
<davidmccabe> I'm gonna give ocaml a try.
<davidmccabe> I need a good project though...
vezenchio has quit ["\o/ python _o--|_"]
purevoid has quit [Read error: 113 (No route to host)]
azzaz has joined #ocaml
azzaz has quit [Nick collision from services.]
azzaz_ has joined #ocaml
azzaz_ has left #ocaml []
froody- has joined #ocaml
drz has quit [Read error: 110 (Connection timed out)]
<mrsolo> sure
<mrsolo> port xchat
<mrsolo> :-)
purevoid has joined #ocaml
<purevoid> sorry, I missed all your replies about OCaml in a kernel; had church...
<purevoid> and my arch was plain i586-elf
<jason_> O.o
<jason_> The Church of Ocaml?
<purevoid> the lutheran church
<jason_> They have thos "NOOS" or something like that.
<jason_> For Ocaml.
<purevoid> what's that?
<jason_> What programming language do they recommend?
<purevoid> who?
<jason_> The lutheran church.
<purevoid> they just run ocaml as a vm
<purevoid> I want to compile ocaml into native code that can be linked into my kernel
<purevoid> basically writing the bulk of the kernel in OCaml rather than something like C
<jason_> Hm.
<jason_> I'm sure you can link the binaries.
<purevoid> hmm, well I'll give it a go. I've only just added newlib to my cross-compiler
<jason_> Mynos only runs it as a VM?
<jason_> Which kernel are you adding code to?
<purevoid> yeah
<purevoid> I'm writing my own
<jason_> Ah.
<jason_> Hm.
<jason_> Well, then, you probably should make some underlying bindings in C.
<jason_> Just for peeking and poking certain addys.
<jason_> That's about all you'll really need.
<purevoid> yeah, I've done that already
<jason_> Maybe for mapping memory regions and such.
<jason_> And doing DMA crap.
<jason_> And, for interrupts.
<purevoid> yeah, that'll come once I can compile OCaml and print a string or two
<jason_> Hehe.
<jason_> Okay :p
<jason_> Are you looking at another kernel as an example?
<jason_> Like, it might make sense to look at something simple, like eCos.
<purevoid> yeah, been looking at bits and pieces
<purevoid> eCos?
<jason_> Yeah.
<jason_> Really simple kernel.
<jason_> Made by redhat.
<jason_> Fully open source, a nice hardware abstraction layer and such.
<jason_> Sounds like a fun project :0
<jason_> It's probably a bit difficult though in Ocaml.
<jason_> Like, how are you going to map memory regions and such?
<jason_> Like, you'd need some kind of byte buffer translation.
<jason_> Like, does Ocaml have native bytes?
<purevoid> they'll be problems to solve when they come up
<purevoid> I saw a library for nativeint that might work
<jason_> Yeah.
<jason_> And then byte order swapping and such.
<purevoid> yeah, I saw how their int representation is a little different with the tag bit
<jason_> Hm.
<jason_> So what are you compiling with?
<jason_> Compile and then objcopy to bin?
<purevoid> my gcc toolchain
<purevoid> I use ld to create the elf image
<jason_> Ah.
<purevoid> grub can boot elf images
<jason_> Well.. You don't want an elf image for the kern.
<jason_> Oh okay :p
<jason_> I didn't know that.
<purevoid> I've booted a C++ hello world-style kernel
<jason_> Yeah, I'm putting together this stand alone PC/VME system right now.
<jason_> Like, hard-disk and floppy diskless.
<jason_> All of the nonvolatile variables are stored in CMOS.
<jason_> And I'm trying to copy this http bootloader into the BIOS.
<jason_> Neato.
<purevoid> oh ok
<purevoid> :)
<jason_> It would be fun to try to do it in Ocaml :p
<jason_> But, it's for work so.
<jason_> C is what will take less time.
<jason_> And, nobody else in the group knows Ocaml.
<jason_> So, it can boot any elf binary?
<jason_> Is there anything special you have to do to it?
<purevoid> heh .. I barely know OCaml
<purevoid> yeah, as far as I know
<jason_> Man.
<jason_> Nifty.
<purevoid> don't think so .. it was quite straightforward to do
<jason_> I thought the binary produced had kernel calls and crap in it?
<jason_> Hm.
<purevoid> there are a couple rules about where entry point has to be, etc.
<jason_> Ah.
<jason_> How did you set the entry point?
<jason_> It's not just main?
<purevoid> yeah, just main called from my loader.asm file
<jason_> Ah.
<jason_> Hm.
<purevoid> but it has to be within so many kb from the start of the image
<jason_> So, you compile main in the .c file.
<purevoid> so linking order matters
<jason_> And then have an assembly object you link to it?
<jason_> Right.
<purevoid> yeah
<jason_> So it doesn't have to long jump or something.
<purevoid> yup
<purevoid> nope
<purevoid> just call main
<jason_> Hm.. Are you sure you need the loader file?
<purevoid> yes, else there's nothing to call
<purevoid> lemme see if I still have the sources in my svn repo
<jason_> Hm.
<purevoid> kernel.cpp has code to output some info from the multiboot header
<purevoid> loader.asm has the code to bootstrap the minimal C++ runtime (calling static ctors/dtors, and jumping into main)
<purevoid> very basic
<purevoid> linker.ld puts it all together, and the kernel_video handles writing text
<purevoid> I use a cross-gcc targeted for i586-elf, so it doesn't bring in any linux stuff and cause problems
<jason_> So, the real entry symbol is _loader:?
<purevoid> yeah .. which is defined in the linker script
<jason_> Hm.
<jason_> So, is that what the boot loader looks for?
<purevoid> it recognizes the image as elf, and I presume the elf header knows where to begin executing
<purevoid> which is from _loader onwards
<jason_> What does .comm mean?
<purevoid> that's for the stack .. I don't remember exactly
<purevoid> http://www.mega-tokyo.com/osfaq2/ has a good wiki on these things
<jason_> Hm.
<jason_> Yeah, I'm trying to think why esp wouldn't have the right value to begin with.
<jason_> Is it just fileld with garbage or something?
<purevoid> grub doesn't setup the stack I don't think
<jason_> Hm.
<purevoid> it has docs on what's set, what's not set, and things along those lines
<jason_> So, why only 32k?
<jason_> Like, the upper 16k would be your heap right?
<purevoid> I got it from example linker script
<jason_> Hm.
<purevoid> if it turns out to be not enough, I can always change it later
<jason_> Yeah.. What I'm thinking is, the stack grows upwards.
<purevoid> most of my code came from the osfaq2 wiki
<jason_> Like, from the lowest address to the highest.
<jason_> And.. Hmm. Like your kernel is what works with the MMU.
<jason_> Sets up all of the memory tables and that garbage.
<jason_> I mean, are you already in a virtual memory address space at this point?
<purevoid> yeah, it has to do just about everything
<purevoid> no
<jason_> Right.
<purevoid> only in protected mode
<jason_> Hm.
<purevoid> even gdt, interrupts, all that jazz needs to be set up
<jason_> Yeah, I know that much.
<jason_> I've never made my own kernel, but I've done a lot of driver development and such.
<purevoid> grub does a bit, like probing memory, querying vesa modes, and stuff
<purevoid> ohh ok. we want to write drivers in OCaml :)
<purevoid> along with everything else
jason_ has quit [Remote closed the connection]
mlh has joined #ocaml
davidmccabe has quit [Read error: 110 (Connection timed out)]
Submarine has joined #ocaml
purevoid has quit [Read error: 113 (No route to host)]
CLxyz has joined #ocaml
mrsolo_ has joined #ocaml
mrsolo has quit [Read error: 113 (No route to host)]
smimou has joined #ocaml
kinners has joined #ocaml
bloggsie has joined #ocaml
zzorn has joined #ocaml
bloggsie has left #ocaml []
siDeb_FR31 has joined #ocaml
_fab has joined #ocaml
kinners has quit ["leaving"]
mattam has joined #ocaml
Ospite461202691 has joined #ocaml
Ospite461202691 is now known as _JusSx_
mlh has quit [Client Quit]
srv_ has quit [Read error: 104 (Connection reset by peer)]
srv has joined #ocaml
siDeb_FR31 has quit ["Leaving"]
_fab has quit [Remote closed the connection]
gim has joined #ocaml
drewr has joined #ocaml
oberke has joined #ocaml
jeff2 has quit [Connection timed out]
skylan_ has joined #ocaml
skylan has quit [Read error: 104 (Connection reset by peer)]
vezenchio has joined #ocaml
stef has quit [Nick collision from services.]
stef_ has joined #ocaml
gim has quit [Read error: 110 (Connection timed out)]
gim has joined #ocaml
cmeme has joined #ocaml
cmeme has quit [Remote closed the connection]
cmeme has joined #ocaml
vincenz has quit ["leaving"]
srv has quit ["Lost terminal"]
malc_ has joined #ocaml
srv has joined #ocaml
vincenz has joined #ocaml
pango has quit [Nick collision from services.]
pango has joined #ocaml
dobrek has joined #ocaml
CosmicRay has joined #ocaml
mrsolo has joined #ocaml
CosmicRay has quit ["Client exiting"]
mrsolo has quit [Read error: 104 (Connection reset by peer)]
CosmicRay has joined #ocaml
_fab has joined #ocaml
<dan2> how do you express function pointers in camlidl
_JusSx_ has left #ocaml []
<dan2> anybody here
<oberke> well yes
<dan2> oberke: you know how to do the above?
<oberke> nope, sorry !
<dan2> anyawy
mrvn_ has joined #ocaml
oberke has quit ["Leaving"]
<dan2> mrvn: how do you make C bindings for ocaml when the c function has a function pointer
<dan2> oops
<dan2> address that to everyone
<Demitar> dan2, I'm not sure camlidl can do that right now.
<dan2> Demitar: yeah, camlidl wasn't working
mrvn has quit [Read error: 110 (Connection timed out)]
<dan2> Demitar: I need it to get libevent
<dan2> and I really want libevent
<dan2> Demitar: libevent uses the fastest for the job, select, poll, epoll, kqueue etc, and it calls a cb function upon change, which is the way it should be
<Demitar> It's fairly tricky. It involves closures and you have to be sure it's actually a good time to call back into caml.
<dan2> heh
<Demitar> dan2, have you read the relevant section of the manual?
<dan2> Demitar: which would that be
<Demitar> Did you look in the manual before asking?
jason_ has joined #ocaml
<jason_> Hm.
<jason_> Do you guys know of any software packages that would act like a simulated person?
<jason_> Like, via text.
<mellum> M-x doctor
<jason_> Sweet :0
<jason_> A site maybe?
<Demitar> jason_, that's emacs.
<jason_> O.o
<mellum> > Do you guys know of any software packages that would act like a simulated person?
<mellum> Is it because would act like a simulated person that you came to me?
<mellum> Hm.
<jason_> Lol.
<dan2> Demitar: the manual doesn't cover function pointers
<Demitar> jason_, google for eliza, alice and others.
<jason_> Ha, yeah, that's it!
<jason_> Eliza.
<jason_> I remember now.
<dan2> Demitar: I tried typedefing, but camlidl wouldn't let me do it
<Demitar> dan2, "18.7 Advanced topic: callbacks from C to Caml"
<jason_> Hm. Is there a way to bind Alice to Ocaml?
<jason_> Is this like, a C library?
<mellum> It would probably be easier to just use a seperate program and communicate by I/O.
<jason_> Hm.
<jason_> I'd kind of like to customize the bot.
<jason_> Hm.. I found a C++ implementation.
<jason_> I bet I can just swig it.
<jason_> Man.. This is going to rock :)!
<jason_> I'll need to add a delay so it seems a bit more realistic :p
<mellum> An IRC bot? Yeah, really exciting. Never seen that before ;)
<jason_> No.
<jason_> For something else.
<Demitar> In general alice is a fairly companion. It's just a big database.
<Demitar> s//boring/
<jason_> Yeah.
<jason_> I'm predicting it's good enough.
davidmccabe has joined #ocaml
<judge> jason_: did you find j-alice.org?
Submarine has quit ["Leaving"]
smimou has quit ["?"]
davidmccabe has quit [Read error: 110 (Connection timed out)]
dobrek has quit ["leaving"]
jason_ has quit [Read error: 110 (Connection timed out)]