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/
hangman4 has quit [Read error: 110 (Connection timed out)]
hangman4 has joined #ocaml
zzorn is now known as zzorn_afk
m3ga has joined #ocaml
m3ga has quit ["Client exiting"]
creichen_ is now known as creichen
kuribas has joined #ocaml
kuribas has quit ["ERC Version 4.0 $Revision: 1.657 $ (IRC client for Emacs)"]
_fab has quit [Read error: 60 (Operation timed out)]
guidox has joined #ocaml
guidox has quit [Client Quit]
CosmicRay has joined #ocaml
CosmicRay_ has joined #ocaml
CosmicRay_ has quit [Read error: 104 (Connection reset by peer)]
CosmicRay has quit [Client Quit]
CosmicRay has joined #ocaml
mflux has quit [Remote closed the connection]
mflux has joined #ocaml
hangman4 has quit [Connection timed out]
hangman4 has joined #ocaml
gim has quit ["bn"]
CosmicRay has quit ["Leaving"]
Hanji has joined #ocaml
vezenchio has quit ["\o/ python _o--|_"]
CosmicRay has joined #ocaml
m3ga has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
m3ga has quit ["Client exiting"]
Demitar has quit [Remote closed the connection]
Demitar has joined #ocaml
zzorn_afk has quit ["........"]
Niels|Parents has quit ["life is fun, and then you die"]
monochrom has joined #ocaml
hangman4 has quit [Connection timed out]
hangman4 has joined #ocaml
kinners has joined #ocaml
CosmicRay has quit [Read error: 113 (No route to host)]
Hanji has quit [Read error: 110 (Connection timed out)]
monochrom has quit ["hello"]
kinners has quit ["leaving"]
hangman4 has quit [Connection timed out]
Submarine has joined #ocaml
budjet has joined #ocaml
Submarine has quit ["Leaving"]
budjet has quit [Remote closed the connection]
budjet has joined #ocaml
budjet has quit [Remote closed the connection]
mrsolo_ has quit ["Leaving"]
mattam has joined #ocaml
mrsolo has joined #ocaml
smimou has joined #ocaml
budjet has joined #ocaml
budjet has quit [Read error: 104 (Connection reset by peer)]
mattam has quit [Read error: 104 (Connection reset by peer)]
kinners has joined #ocaml
gim has joined #ocaml
kinners has quit ["leaving"]
zzorn has joined #ocaml
mrsolo has quit [Read error: 113 (No route to host)]
ejt has joined #ocaml
ejt has quit [Read error: 110 (Connection timed out)]
mrvn_ is now known as mrvn
zxy_ has joined #ocaml
gim has quit [Read error: 60 (Operation timed out)]
Hanji has joined #ocaml
gim has joined #ocaml
vezenchio has joined #ocaml
CosmicRay has joined #ocaml
gim has quit [Read error: 110 (Connection timed out)]
gim has joined #ocaml
monochrom has joined #ocaml
gpciceri has joined #ocaml
tautologico has joined #ocaml
Submarine has joined #ocaml
smimou has quit ["?"]
gpciceri has quit [Read error: 60 (Operation timed out)]
pango has quit [Read error: 110 (Connection timed out)]
mrsolo has joined #ocaml
Submarine has quit ["Leaving"]
dan2 has joined #ocaml
<dan2> whenever I use ocamldbi and ocamlmktop together, it never seems to work
<dan2> ocamlfind ocamlmktop -thread -linkpkg -custom -o mytop -package pcre pcre.cma -package mysql mysql.cma -package pcre pcre.cma -package dbi dbi.cma dbi_mysql.cmo
<dan2> then when I try to open Dbi_mysql module in the interpreter\
<dan2> its says it doesn't exist
<dan2> anybody use ocamldbi?
<dan2> anybody here?
<tautologico> not me
<Demitar> dan2, is it actually all that useful to have a ocamldbi toplevel?
<Demitar> Considering you can simply #load the things you want.
<dan2> Demitar: so I can use the interpreter to help me code
<dan2> Demitar: I tried but that isn't actually working that well for me
<Demitar> demitar@bubbles:~$ ledit ocaml -I +dbi -I +pcre -I +mysql
<Demitar> Objective Caml version 3.08.2
<Demitar> # #load "pcre.cma";;
<Demitar> # #load "dbi.cma";;
<Demitar> # #load "mysql.cma";;
<Demitar> # #load "dbi_mysql.cmo";;
<Demitar> # Dbi_mysql.connect;;
<Demitar> - : ?host:string ->
<Demitar> ...
<Demitar> Works fine here.
<dan2> ok
<dan2> Demitar: do I really need ledit?
<Demitar> dan2, no, but unless you're using an editor as a wrapper you probably want it or something similar. :)
<dan2> Demitar: btw, why couldn't I make a top
<Demitar> dan2, dunno, someone else had some troubles making a dbi toplevel some time ago, since #load works so nicely I didn't bother investigating.
<dan2> where can I get ledit
<Demitar> What OS?
<Demitar> Ignore that. The answer is: the humps or google. ;-)
<dan2> whats the humps?
<Demitar> caml.inria.fr/humps/
<Demitar> Index of useful ocaml libraries and software.
<dan2> ok cool
<dan2> Demitar: what version of ledit do you have installed
<Demitar> Error: standard input is not a terminal
* Demitar mutters.
<Demitar> Ledit version 1.11
<dan2> it won't build here
<dan2> camlp4r pa_extend.cmo q_MLast.cmo pa_local.ml -o pa_local.ppo
<dan2> File "pa_local.ml", line 38, characters 13-65:
<dan2> use of antiquotation syntax deprecated since version 3.06+18
<dan2> ocamlc -I `camlp4 -where` -c -impl pa_local.ppo
<dan2> File "pa_local.ml", line 19, characters 0-1:
<dan2> Unbound value _loc
<dan2> make: *** [pa_local.cmo] Error 2
gpciceri has joined #ocaml
<Demitar> dan2, dunno, I merely install the debian package.
<dan2> Demitar: unforeteanetly I'm on suse
Submarine has joined #ocaml
<Demitar> dan2, so install the rpm?
<dan2> Demitar: hmm
<dan2> Demitar: whats the best way to thread a network socket
<dan2> Demitar: basically I want to do it per connect
<Demitar> What are you asking really?
<dan2> Demitar: are there any examples of threaded network sockets in ocaml
<Demitar> They're completely unrelated subjects though. :)
<Demitar> The usual socket rules apply and the usual threading rules apply. :)
<Demitar> Basically you'd have to keep a few things in mind: 1) make sure your external function calls are reentrant 2) don't access the same data from different threads 3) use the Event module to communicate stuff with the main thread 4) don't forget passing -thread when compiling and linking
<Demitar> Personally I would avoid threads altogether (if possible).
gpciceri has quit [Remote closed the connection]
<mflux> avoiding threads good.
<Riastradh> What's wrong with threads?
<mflux> using threads usually requires synchronization, which is difficult :)
<Riastradh> Note Demitar's suggestion to use the Event module.
<Demitar> Riastradh, apart from shooting oneself in the foot, I'm mostly concerned with the difficulty of killing threads.
<mflux> if thread's only interface to the system is the Event-module, such a problem could be avoided
<Demitar> If you have make sure you never deadlock in a thread (to be able to shut it down) you kind of defeat the control-inversion purpose of using threads.
<Demitar> (Thus I use them sparingly, mostly to do blocking function calls non-blockingly, connect() and gethostbyname() being the most obvious cases.)
pango has joined #ocaml
<Riastradh> What do you mean 'you defeat the control-inversion purpose of using threads?'
<Demitar> Riastradh, if I have to make sure I never block indefinitely (deadlock) I can't write code as linearly as would otherwise be possible.
<mflux> all this reminds me of (well, not really, I've been thinking about it all the time) about the io-framework I've been hacking: http://modeemi.cs.tut.fi/~flux/software/ioframework.ml
<Demitar> The linearity being the control inversion, the same thing any multitasking system does.
<Riastradh> Demitar, are you referring to the potential problems of a rudimentary mutual exclusion mechanism?
<Demitar> Riastradh, I think you lost /me/ this time. :)
<Riastradh> Uh, you know what 'mutual exclusion' is, right?
<Demitar> Riastradh, yes, but my tired brain can't connect so many big words at once right now. (Haven't slept for too long. :)
<Riastradh> OK: are you referring to the deadlock that can occur if you're using simplistic locks to synchronize shared memory access?
<Riastradh> (I hope my attempt at simplifying & clarifying the wording there was successful.)
<Demitar> Riastradh, no, I'm more concerned with leaking threads.
<Demitar> Riastradh, very. :)
<Riastradh> OK, now _you've_ lost _me_!
<mflux> you're both lost ;(
* Riastradh asks around for a map.
<mflux> maybe demitar is worried about that if a thread is blocked on read(), it cannot be killed?
<Demitar> Riastradh, well it's quite possible I do something that will block endlessly (I don't have a good example handy) and thus it will never return. Also it makes joining threads a _lot_ trickier.
<Demitar> mflux, something in that direction.
<Riastradh> If the resource from which to read is terminated, the blocked read could just raise an exception.
<mflux> but what if closing the descriptor isn't an option for some reason?
<Demitar> mflux, [ioframework] I've been pondering something which is probably quite similar. A socket_server, probably using classes to get nice vtables, which would be derived into tcp_server, http_server, irc_server, foo_server, ...
<mflux> demitar, did you check out the 'application examples' at the end?
<Riastradh> mflux, have you considered building this into CML/the Event module?
<mflux> riastradh, well at some point it did occur to me that infact the event module is very similar to this
<mflux> basically the only difference is the syntax
<Demitar> Riastradh, in general those seemingly clean and simple uses get icky fast, note that I'm mostly using threads when dealing with some kind of io and the lowlevel interfaces probably make my view fairly biased.
<mflux> I return lists, and as lists are ocaml builtin data types, there is no extra syntax involved
<mflux> but atleast some kind of an interface to the Event module could be ninice
<Riastradh> Not exactly, mflux. Event is generalized; your framework is specific to I/O.
<mflux> well, it depends how you view it
<mflux> Event is specific to ipc :)
<Riastradh> Not at all.
<mflux> it has 'fill in blanks' for generalizing
<Demitar> I assume the framework abstracts IO into events, that's the point, no?
<Riastradh> It's not presented very well in the manual.
<mflux> that I must say
<Riastradh> Events are the important thing. Channels are only a particular way to use the event system.
<mflux> the only way I figured out the 'real' way to use event was by some example for concurrent ml
CosmicRay has quit ["Leaving"]
<Smerdyakov> mflux, that's the intention. It wouldbe wasted effort to re-document CML.
<mflux> well maybe it could atleast have a pointer to such documentation, because I had to hunt for it :)
<mflux> I think it does mention cml though
<mflux> let's say I wanted to write a timer for ocaml's Event, as it doesn't have such.. can I?
<mflux> well, I could of course have a thread that did that, but..
<Smerdyakov> Hm, too bad. CML has that built in. :)
mrvn_ has joined #ocaml
<mflux> maybe I should do a better comparison, but now that I think of it I think there are some differences between the api and ioframework.ml
<mflux> but something like that could be written on top of Event
<dan2> ok
<dan2> http://rafb.net/paste/results/0eRIqL54.html <-- Hacked threads into establish_server
<dan2> any comments
<Demitar> dan2, whatever is the server going to do?
<Demitar> Since you all of the sudden have to think about how you use data inside server_fun not to mention closures.
<dan2> Demitar: when it receives a connect, spawn a thread with the given function
<dan2> Demitar: yes, I know
<dan2> Demitar: thats not really an issue tho
tautologico has quit []
<dan2> Demitar: i'm having issues loading threads into the interpreter, should I make a top
<Demitar> I think #load "threads.cma";; is enough ( -I +threads ) of course (possibly -s).
<mrvn_> forking a thread for IO is insane.
<Demitar> mrvn_, depends on how much it simplifies the code.
<Riastradh> mrvn_, what's insane about it?
<mrvn_> forking takes ages. In the same time you can handle the IO async and still have some time left.
mrvn has quit [Read error: 110 (Connection timed out)]
mrvn_ is now known as mrvn
jason_ has joined #ocaml
<jason_> Hm.. Is there any way to specify what the "input_line" function sees as a 'newline'?
<jason_> I figured it should be '\n', but, it doesn't appear to be so.
<jason_> let chSocket = in_channel_of_descr ssock and mutLck = Mutex.lock lockCsock in let myStr = input_line chSocket in
<jason_> Something like this.. I convert the socket to an in_channel, and then do "input_line" on it.
<mrvn> end of input on the socket might als end the line.
<mrvn> Is it non-blocking?
<jason_> No, blocking.
<jason_> It basically just blocks, and hangs out there indefinitely.
<jason_> If I just use the normal socket reading routines, and then split the returned buffer into lines using String.split, it works.
<mrvn> \r\n?
<jason_> It's possible that may be the line delimeter.
<mrvn> windows?
<jason_> I don't check in the other thing, I just split it by '\n' and replace it when I write it back over the socket.
<jason_> Well.. Kind of :)
<jason_> wine actually.
<jason_> It's a proxy.
<jason_> But, I'm using a Windows program on one end, a Client.
<jason_> Ah.. I think I know what's up.
<jason_> Blah.. I should have read the documentation more closely.
<jason_> Sorry for wasting your time :) Thanks for your help.
<jason_> Bah.. That wasn't it, grr.
stef has joined #ocaml
<stef> hi, someone demonstrated me some kind of ide for ocaml. Where I can find such a beast. source ok. mdk rpm best
<jason_> Um.. Cameleon I think.
<jason_> I just use emacs.
<jason_> Or vi.
<stef> I use emacs too but it is not very pedagoogic when you are using a new tool
<stef> ya that must be camelon. thx jason_
<mrvn> Anyone have an example of using select and sockets in ocaml for dan2?
<Riastradh> stef, what do you have in mind as pedagogical for using a new tool?
<jason_> Select?
<monochrom> notepad is very pedagoogic because everyone uses it
<monochrom> actually even that is false.
<stef> I am a beginner in ocaml
<stef> so a kind environment is best for me.
<monochrom> use outlook express. "send email", type the program into the box, send it to yourself.
<Riastradh> stef, can you elaborate on what you're looking for in a 'kind environment?'
<monochrom> outlook express is very kind.
<monochrom> microsoft word is even kinder, but it costs extra money
<stef> something that don't get in the way of the beginner like emacs does.
<jason_> Awesome.. It works now.
<jason_> Muwha.
<Riastradh> stef, yes, but can you elaborate on that?
<stef> I don't want to learn upfront ocaml and weird keybinding of whatever environment emacs may provide for ocaml.
<jason_> Apparently it was having some problems with my initializing in_channel functionally.
<jason_> I had to turn it into a ref.
<Riastradh> You can just use the command names with M-x, stef, if you don't want to memorize lots of keybindings.
<stef> so, is there a way to run a ocaml shell in emacs?
<monochrom> now you have to memorize the command names :)
<stef> monochrom: :)
<stef> I am a geek but I am not ashamed to be a beginner of a tool/language to me.
<jason_> stef: Where there's a will ;)
<stef> I use emacs all the day for things I know well.
<mrvn> M-x shell --> ocaml :)
<jason_> Yeah.. I never customize emacs.
<Riastradh> Yes, stef. If you are using the Tuareg mode (which I recommend over the vanilla OCaml mode), do: M-x tuareg-run-caml
<jason_> Just, have another shell open and run command line crap.
<jason_> Create a make file.
<stef> ok
<mrvn> But there must be some "evaluate buffer|selection|whatever" functions.
<stef> some url of a doc or faq?
<stef> or just the standard emacs stuff?
<mrvn> I always write a Makefile and then use "ctrl-c ctrl-c" to run make and fix the errors.
<Riastradh> M-x tuareg-eval-buffer, tuareg-eval-region, etc.
<Riastradh> Caml Light? Why are you looking into that?
<stef> nope :( I get a 404 for the tuareg
<Riastradh> ...oh, duh.
<mrvn> stef: debian?
<stef> I am searching the tuareg emacs stuff
<stef> nope, mdk
<jason_> Are you just learning Ocaml?
<stef> yes
<jason_> Get "Developing Applications with Objective Caml"
<mrvn> tuareg on debian comes with a doc package with a good introduction.
<mrvn> It's the same as on the web.
<jason_> It's like.. The best applied programming book I've ever seen before.
<stef> thx
<jason_> I mean that for 'any' language.
<jason_> I mean, the thing is friggen huge too.
<jason_> But, it's not huge in the "useless info taking up room" kind of way.
<jason_> Like, once you get through it, you'll wonder how they hell they fit so much into so little room.
<jason_> Just one thing after another. Like, I honestly knew more about programming concepts in general after reading it. Knowing the syntax of Ocaml is secondary.
<Riastradh> Have you read SICP?
<jason_> O.o No, what is it?
<Riastradh> There are many who would say about SICP what you say about this OCaml book.
<jason_> I'll check it out.
<jason_> Thanks :)
<jason_> Yeah, I printed the Ocaml Ora book out at Kinkos.
<jason_> Heh.
<stef> ho, apparently the installation of ocaml shoved me some .el file in site-lisp
<stef> tuareg is better than that stuff?
<Riastradh> Yes.
<stef> ok
<stef> good to know
<jason_> I put the tuareg stuff in my site-lisp directory on my Gentoo machine at work.
<jason_> But, it screwed a bunch of stuff up some how.
<jason_> Like.. My .emacs file needed some other things.
<jason_> I have it working on my laptop here though.
<jason_> I've just been using vi at work.
<jason_> Hm, maybe I should just copy my .emacs from here to there ;) Hehe.
<stef> I will switch back to vi the day it will support shell buffers
<stef> emacs is so messy
<jason_> Blah.
<jason_> Shell buffer schmell buffers.
<jason_> Hm, what'do you guys think of FreeBSD?
* monochrom whispers Eclipse and runs
monochrom has quit ["hello"]
<Riastradh> Yet another Unix, jason_. Uninteresting.
<mellum> Riastradh: But it has less users than Linux, so it must be cooler
<avlondono> stef: isn't gnu screen good enough?
CosmicRay has joined #ocaml
<jason_> Hm.
<jason_> Unix is definitely ineresting :0
<jason_> I think everything is interesting.
<Riastradh> Unix might have been interesting as a lightweight & easily portable OS in 1970.
<jason_> Hm, so, what operating systems are 'more' interesting these days?
<Riastradh> Not many. Real OS research died over a decade ago.
<jason_> And, you forget how many programming languages came about in the late 70's that are still somewhat interesting.
<jason_> Hm, ever seen "Plan 9"?
* Riastradh doesn't forget that.
<Riastradh> A bit; I am unimpressed.
<jason_> Hm, why? Distributed operating systems.
<jason_> Not such a bad idea.
<Riastradh> Distribution isn't very interesting to me if it's just distribution of the same old thing.
<jason_> Hm. I think it's very interesting. A lot of potential fo rit.
<jason_> The ability to levy out massive computations to other machines.
<jason_> All over the internet.
<Riastradh> There have been almost no radical OS concepts presented in the last decade.
<jason_> Like, a computation cluster that just forms out of every computer on the planet.
<Riastradh> Parallelization & distribution aren't new or innovative.
<jason_> In an operating system, they definitely are.
<Riastradh> Certainly not. They've been around for much longer than a decade.
<avlondono> with that logic Riastradh, nothing on earth is innovative or new.
<jason_> I mean, the storage of information and the presentation of it wasn't 'new' or innovative either. But making it massively available via the internet was definitely interesting.
<jason_> I mean, what you're talking about is extremely local, and naive views of the actual realization of a massive internet based virtual computer.
<jason_> Yeah, it's like Neuton said, he figured out realtively nothing in his entire life span. His major advancements came about by "Standing on the shoulders of Giants."
<Riastradh> With that insult to my logic, avlondono, you have not made me care to elaborate on my statements. I'm uninterested in discussing anything with people who randomly insult me thus.
<jason_> By taking old ideas, integrating them, and forming something new.
<avlondono> beh, easy to insult you are
<avlondono> :P
<jason_> I'm assuming since you said 'people' you're including me in the matter.
<Riastradh> I have been attacked with great vigour on frivolous matters at least four times in the past couple days, and I'm sick of it.
<avlondono> and I don't see how my commentary was insulting
<Riastradh> jason_, no, but I'm now in a foul mood.
<avlondono> it's not my fault how your daily life is.
<jason_> Hm.. Well, your views are simply being doubted ;) I really didn't mean to 'attack' you by any means. I'm incredibly sorry if I've offended you.
<avlondono> so I won't discuss anything, it was productive for jason_
CosmicRay has quit ["Leaving"]
<avlondono> please, don't stop it because of me.
<Riastradh> jason_, no, I'm not claiming you attacked me or offended me.
<jason_> Okay :) I'm sorry though-- I was just meaning to have a friendly debate over the matter.
<jason_> I really wouldn't enage in a discussion with you if I didn't feel you were intelligent, and your opinion likely valid.
Submarine has quit ["Leaving"]