sponge45 changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/
nonpop has left #ocaml []
Z4rd0Z has joined #ocaml
bronaugh has joined #ocaml
<bronaugh> can someone suggest a good book on ocaml that's pitched at beginning programmers?
<bronaugh> looking for such a thing for an office mate; rather spread ocaml than python or perl.
<Smerdyakov> I list the usual suspects here: http://www.cs.berkeley.edu/~adamc/mlcomp/
<bronaugh> great, thanks.
<Smerdyakov> "Developing Applications with Objective Caml" is the classic book to recommend.
<Smerdyakov> But perhaps ocaml-tutorial.org would be sufficient.
<bronaugh> ok.
dleslie has joined #ocaml
dleslie has quit [Client Quit]
dleslie has joined #ocaml
dleslie has quit [Read error: 104 (Connection reset by peer)]
danly has joined #ocaml
pango_ has joined #ocaml
jlouis has joined #ocaml
<mbishop> Smerdyakov: never did write up why you think SML is better eh?
<Smerdyakov> mbishop, I would just point to the elements there that matter most to me.
pango has quit [Remote closed the connection]
Skal has quit [Remote closed the connection]
bronaugh has left #ocaml []
bzzbzz has joined #ocaml
danly has quit ["Leaving"]
Eridius has left #ocaml []
smimou has quit ["bli"]
pango_ is now known as pangoafk
swater has quit ["Quat"]
danly has joined #ocaml
slipstream has joined #ocaml
slipstream-- has quit [Read error: 60 (Operation timed out)]
johnnowak has joined #ocaml
Smerdyakov has quit ["Leaving"]
shans has joined #ocaml
<shans> is there any function to turn an in into a hexadecimal string representation?
<shans> like string_of_int does in decimal?
<stevan> shans: not that I know of, but writing one is pretty trivial
<jdev> Printf.sprintf "%x" ?
<shans> jdev: thanks, that works :)
johnnowak has quit []
b00t has joined #ocaml
Mr_Awesome has quit [Read error: 60 (Operation timed out)]
Mr_Awesome has joined #ocaml
Mr_Awesome has quit ["and the Awesome Level drops"]
MrCraps has joined #ocaml
pantsd has joined #ocaml
Z4rd0Z has quit []
danly has quit ["Leaving"]
_velco has joined #ocaml
pangoafk is now known as pango
ramkrsna has quit [Remote closed the connection]
MrCraps has quit ["Verlassend"]
asmanian has joined #ocaml
pango has quit [Remote closed the connection]
mc__ has quit [Connection timed out]
love-pingoo has joined #ocaml
velco has joined #ocaml
pango has joined #ocaml
smimou has joined #ocaml
slipstream has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
b00t has quit [Remote closed the connection]
shawn has quit [Read error: 110 (Connection timed out)]
smimou has quit ["bli"]
bluestorm has joined #ocaml
little-nick has joined #ocaml
little-nick is now known as tomppa
delamon has joined #ocaml
bluestorm has quit [Remote closed the connection]
bluestorm has joined #ocaml
bluestorm has quit [Remote closed the connection]
bluestorm has joined #ocaml
asmanian has quit [Remote closed the connection]
nonpop has joined #ocaml
johnnowak has joined #ocaml
shans_ has joined #ocaml
Skal has joined #ocaml
shans has quit [Read error: 110 (Connection timed out)]
klapmuet1 is now known as klapmuetz
tomppa has quit [Read error: 104 (Connection reset by peer)]
johnnowak has quit []
ikaros has quit [Read error: 60 (Operation timed out)]
pango has quit [Remote closed the connection]
<flux__> it has been quiet this year :-)
<flux__> well, maybe not exceedingly so
<flux__> maybe I'll just share this to wake conversation: let future v = let c = Event.new_channel () in let _t = Thread.create (fun () -> Event.sync (Event.send c (Lazy.force v))) () in lazy (Event.sync (Event.receive c))
<flux__> (it's a function of Lazy.t to Lazy.t that evaluates the stuff in background)
<flux__> are futures any good in writing actual parallel softwarE?
<flux__> I suppose not very useful in ocaml, unless you 'future' io-bound stuff
<flux__> or, alternatively, do something io-bound during futures are being performed
<flux__> I suppose the return value should be something like Future.t, so you could wait for one of many futures to be ready
<flux__> turns out it's difficult to google for 'future' in the context of programming languages..
ikaros has joined #ocaml
<delamon> flux__: dont you think that 'Thread.create' is too expensivefo it, do you ?
<flux__> well, not if you don't use vmthreads
<flux__> threads are really fast that way
<flux__> and even if they were, you could find a way to avoid creating a thread
<flux__> albeit it would involve more message passing
<flux__> maybe something like: Event.sync (Event.send worked_thread (fun () -> Event.send c (Lazy.force v))
<flux__> there would need to be multiple worker threads
<delamon> afaik, there is no vmthreads if you are compiling in native.
<flux__> hm, right
<flux__> that can easily become very expensive if performed often in that case
<delamon> well, i'm using some sort of CPS + libevent to simulate that stuff.
<flux__> futures?
slipstream-- has joined #ocaml
<delamon> no. It's IO inversion.
<flux__> I'm guessing: you are writing 'naturally flowing code' which emulates threading with the assistance of libevent?
<delamon> exactly.
<flux__> I actually played around with something like that, but it used Unix.select
<flux__> I have one program which uses loads of threads, which I guess could be optimized much by using a similar method
<delamon> select is very expensive then you have 2000+ descriptors.
<flux__> how do you handle exception with your system?
<flux__> (in plural)
<flux__> this is the result of my playing: http://modeemi.cs.tut.fi/~flux/software/ocaml/ioframework.ml
<delamon> well, i'm not that expirienced, but i can't see any problem with exceptions.
<delamon> oh, i forget main thing. CPS is done via pa_monad.
<flux__> oh
<flux__> that might make the syntax ever-so-much-prettier
<flux__> I guess using monads would make it more realistic to convert the program into CPS
<delamon> and, in fact, it did.
<flux__> :)
<flux__> so you used threads before?
<bluestorm> hum flux__
<delamon> never. i'm afraid of locking.
<bluestorm> you might have a look at ocisgen
Smerdyakov has joined #ocaml
<flux__> locking isn't that bad when you just do message passing
<flux__> I did have a related problem though, by accidentally using the same database handle simultaneously in two places: disaster
<flux__> (one difficult to trace, too)
swater has joined #ocaml
<delamon> i've used to threading just in one case - i was unable to find ocaml binding to adns.
<flux__> a wrapper function that asserted if called twice in parallel found the problems
<flux__> bluestorm, hm, nice
<bluestorm> it's used in a web server (ocsigen's one)
<flux__> what's the license?
<bluestorm> hum
<flux__> google found it: LGPL
<delamon> nice. lwt + pa_monad
<flux__> ah, debian also has ocsigen
<flux__> I do wonder though if erlang would be more suitable for programming a web-server, with live updates and all
slipstream has quit [Read error: 110 (Connection timed out)]
<flux__> (just listening to the hype, I've never used Erlang ;-))
<bluestorm> flux__: ocsigen is an experiment to do web programming in ocaml
<bluestorm> so you shouldn't ask them about erlang ^^
<flux__> ;-)
<delamon> flux__: Erlang -> dynamic typing. :-(
<flux__> yes :(
<flux__> but I hear they have some type-inference based checker tools
<flux__> so it might not be that bad
<flux__> hmph, ocsigen's debian package provides .cmos, .cmis, but no .mlis or manual pages: gotta browse the html pages
<bluestorm> just download the source ^^
klapmuet1 has joined #ocaml
<flux__> <- lazy!
<flux__> (although apt-get source will do it for me ;-))
<flux__> I wonder if exception backtracing works with that thing
<flux__> it has been valuable
<delamon> flux__: well, i think if you start IO - no backtracking.
<delamon> flux__: you can't backtrack World.
<flux__> actually I meant exception stack-dump
<Smerdyakov> flux__, you might like to look at the Singularity model and the associated static checks in the Sing# language. Everything is based on message passing, with static checking of ownership discipline.
<Smerdyakov> (Re: your problem with using a database handle in two places at once)
<flux__> well, it was related to writing a debug message
swater has quit ["Quat"]
<delamon> flux__: they (swt) do exception passing partialy by exception monad.
<delamon> s/swt/lwt/
<flux__> which wanted to display the database backend pid
<flux__> oh, actually now I remember there was another issue too
<flux__> a lazy statement that issued a database query
<flux__> that was the difficult one to pin down :)
<flux__> (stupid developer error..)
<Smerdyakov> You sure wouldn't have that kind of problem in a pure language.
<flux__> sure, but then again debug messages might be a problem too (witness Haskell's Debug.Trace)
bluestorm has quit [Remote closed the connection]
bluestorm has joined #ocaml
swater has joined #ocaml
klapmuetz has quit [Read error: 110 (Connection timed out)]
Aradorn has joined #ocaml
mc__ has joined #ocaml
<mc__> whats the best ocaml tutorial for complete ocaml newbies`
<bluestorm> depends on wheter they've already used another programming language or not, i think
<bluestorm> but you seemed to say ocaml-tutorial.org was not bad
<mc__> Im already used mainly to imperative languages like c++ and java
<mc__> but i do also some Ruby and CommonLisp
<bluestorm> i know a good introductory tutorial, but it's written in french
<mc__> pity
<bluestorm> the second is really complete (it's a bit old but it's not a problem)
<bluestorm> but i found it a little bit hard to understand at the beginning
<mc__> bluestorm: alright,thank you
<bluestorm> and i never used the first to learn ocaml but i still find useful informations in it
gunark has joined #ocaml
nonpop has left #ocaml []
velco has quit [Client Quit]
smimou has joined #ocaml
nonpop_ has joined #ocaml
nonpop_ has quit [Client Quit]
nonpop_ has joined #ocaml
nonpop_ has left #ocaml []
nonpop has joined #ocaml
_velco is now known as velco
slowriot has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
nonpop has quit ["leaving"]
danly has joined #ocaml
nonpop has joined #ocaml
Submarine has joined #ocaml
bluestorm is now known as bluestorm_aw
pango has joined #ocaml
Skal has quit [Read error: 54 (Connection reset by peer)]
Submarine has quit [Remote closed the connection]
nonpop has quit ["Changing server"]
bluestorm_aw is now known as bluestorm
nonpop has joined #ocaml
bluestorm is now known as bluestorm_aw
nonpop has quit [Client Quit]
nonpop has joined #ocaml
shawn has joined #ocaml
shawn has quit [Client Quit]
shawn has joined #ocaml
nonpop has quit ["leaving"]
nonpop has joined #ocaml
nonpop has quit [Client Quit]
nonpop has joined #ocaml
nonpop has quit [Client Quit]
_JusSx_ has joined #ocaml
_JusSx_ has quit [Client Quit]
Skal has joined #ocaml
bluestorm_aw is now known as bluestorm
Aradorn has quit ["This computer has gone to sleep"]
Smerdyakov has quit ["Leaving"]
Aradorn has joined #ocaml
Aradorn has quit [Client Quit]
_JusSx_ has joined #ocaml
david_koontz has joined #ocaml
danly has quit [Remote closed the connection]
gene9 has joined #ocaml
gene9 has quit [Client Quit]
shans_home_ has joined #ocaml
shans_home has quit [Read error: 110 (Connection timed out)]
<mc__> is the Ocaml Graphics library suited for simple 2d game programming?
<mc__> or do i have to use some c stuff?
<bluestorm> hmm
<bluestorm> the Graphics library seems me a bit poor
<bluestorm> but you should look at the Hump
<bluestorm> (for example)
<mc__> bluestorm: thanks