gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.11.2 released | Batteries 1.2.0 released http://batteries.forge.ocamlcore.org
<elehack> thelema, ping
boscop_ has quit []
Tomcat has joined #ocaml
Tomcat has quit [Ping timeout: 260 seconds]
<travisbrady> When wrapping a C library is it preferable to register your exceptions and raise from C or to return a result object to ocaml, interrogate it there and then raise as appropriate?
travisbrady has quit [Quit: travisbrady]
travisbrady has joined #ocaml
<palomer> hello
<palomer> anyone have experience with curses?
<elehack> very, very litt.e
<elehack> *little
<palomer> I'm just creating a window
<palomer> and then drawing to it
<palomer> that's my code
<palomer> doesn't do anything
<palomer> (prints a blank screen)
* elehack doesn't think he can be of much help, unfortunately, and also needs to head off for the evening
elehack has quit [Quit: Goodbye...]
* palomer curses the gods
pad has quit [Remote host closed the connection]
drk-sd has quit [Ping timeout: 276 seconds]
drk-sd has joined #ocaml
mfp has quit [Ping timeout: 265 seconds]
thrasibule has quit [Read error: Operation timed out]
mfp has joined #ocaml
rjsimmon has joined #ocaml
sshc_ has joined #ocaml
sshc has quit [Ping timeout: 264 seconds]
sshc_ is now known as sshc
ulfdoz has joined #ocaml
joewilliams is now known as joewilliams_away
Associat0r has quit [Quit: Associat0r]
fraggle_laptop has quit [Ping timeout: 240 seconds]
rjsimmon has quit [Quit: Leaving.]
ttamttam has joined #ocaml
Amorphous has quit [Read error: Connection reset by peer]
coucou747 has joined #ocaml
ttamttam has quit [Quit: Leaving.]
travisbrady has quit [Quit: travisbrady]
Amorphous has joined #ocaml
ikaros has joined #ocaml
jeddhaberstro has quit [Quit: jeddhaberstro]
ftrvxmtrx has quit [Quit: Leaving]
Yoric has joined #ocaml
ttamttam has joined #ocaml
Yoric has quit [Quit: Yoric]
f[x] has quit [Ping timeout: 260 seconds]
ftrvxmtrx has joined #ocaml
f[x] has joined #ocaml
valross has quit [Quit: Ex-Chat]
barismetin has joined #ocaml
Yoric has joined #ocaml
Edward_ has joined #ocaml
Edward_ has quit [Ping timeout: 260 seconds]
Edward_ has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
rixed has quit [Quit: demenachment]
nejimban has quit [Ping timeout: 264 seconds]
Edward_ has quit [Ping timeout: 240 seconds]
kg4qxk has quit [Quit: So long, and thanks for all the fish!]
theDroggl has joined #ocaml
<theDroggl> hi all
<theDroggl> I'm new to ocaml, for what I could find on the web it seems there is no real preemtive multithreading available for the language, is that true?
<theDroggl> (i.e. "threads" from the standard lib states that it does not exploit multicore systems & I couldn't find anything else that looked like a multithreading lib or so)
Edward_ has joined #ocaml
<f[x]> theDroggl, there exists ocaml implementation with "true" multithreading, but is kinda experimental
<f[x]> and not used much
<f[x]> if at all (?)
<theDroggl> hm that sounds bad
<theDroggl> so no one really writes concurrent programs with ocaml?
<theDroggl> or do people commonly use multiple processes and some sort of ipc?
<flux> that's the plan usually
<f[x]> multiprocessing, light weight threads
<flux> or if you have something cpu-bound, you can use C. of course, that's not a perfect solution either.
<theDroggl> hm kk
<theDroggl> I kinda was looking for a programming language with a functional touch that exploits the immutability of values for painless multithreading without the use for explicit locking
<theDroggl> but I'm just looking around and not planning to actually do anything big in the next time so not that crucial
<flux> well, you may take a look at jocaml
<theDroggl> j=jvm?
<flux> no, J-calculus
<theDroggl> good :)
<theDroggl> thnx for the hint I'll google around a bit for that
<flux> actually there was some concurrency-oriented ML also, not elisa but something starting with e I think? someone might remember :)
<flux> (but its development has ceased recently)
hyperboreean has quit [Remote host closed the connection]
thrasibule has joined #ocaml
<f[x]> alice
thrasibule has quit [Ping timeout: 260 seconds]
<theDroggl> the jocaml stuff looks quite interesting
<theDroggl> I think when I have the time (in case that ever happens) I'll play around with it a little
derdon has joined #ocaml
<theDroggl> "As a result of its design, JoCaml inherits the limitations of Objective Caml thread implementations. In particular, there can be at most one thread actually executing at a time, even on multi-core machines."
<theDroggl> waah fuck
<theDroggl> ok bye bye jocaml
<flux> but apparently it's easier to dispatch tasks with it
<flux> take a look at the raytracer example?
<theDroggl> yeah ease of dispatching is one thing, but I dislike the thought that I will be unable to extend a program to exploit multi core machines efficiently
<theDroggl> I mean like almost every computer these days has at least hyperthreading
<theDroggl> ok as this seems to be a limitation deep down in the ocaml core, is there a cool ipc lib for ocaml that allows exchanging objects between processes or so?
<theDroggl> oh nevermind I guess the distributed programming features of jocaml should be great for that task
boscop has joined #ocaml
<flux> you can marshal (serialize+deserialize) ocaml objects across same instances of the same binary
Edward_ has quit [Ping timeout: 240 seconds]
<flux> unfortunately, I don't think there are libraries that would make this task effortless
ccasin has joined #ocaml
Edward_ has joined #ocaml
<gildor> flux, theDroggl: jocaml can exploit multi-core but not through thread
<theDroggl> how does it work, then?
<gildor> theDroggl: I don't know precisely jocaml, but I think it is through a kind of message passing and multiprocess
<theDroggl> ic then probably you are talking about http://jocaml.inria.fr/manual/distributed.html what I suspected to be a good solution for that
<gildor> theDroggl: if you have time, there is a nice presentation by a guy from Glyde who use Jocaml for efficient computation
<theDroggl> seems that can also distrubute stuff over network
<flux> wish I had a good idea that would make a perfect task for jocaml :)
<gildor> theDroggl: yes this is it, the guy from glyde says it was pretty efficient
<theDroggl> Actually I shouldn't spent time on looking at programming languages today at all and rather finish my diploma thesis but what the hell ;)
<theDroggl> flux: I have one if you want
<theDroggl> do you know the "reactor" game for iphone?
<theDroggl> thnx gildor
<flux> thedroggl, nope
ikaros has joined #ocaml
<theDroggl> flux: imagine a grid of discs, each have an "L" printed on them
<flux> ok..
<theDroggl> you can turn the discs abound any multiple of 90 degrees
<theDroggl> after you started the game you pick one disc
<theDroggl> that turns right about 90 degrees
<theDroggl> all discs which have one line of the L aligned with one line of the L of the disc that just moved now turn 90 degrees to the right too
<theDroggl> and so on
<flux> you'd like to find solutions to such puzzles?
<theDroggl> question is: what is a start configuration that produces the longest chain reaction (or alternatively the must "turns")
<theDroggl> yeah I once started to fiddle around with a genetic algorithm
<flux> the problem doesn't hit my a spark in me, so perhaps not :)
<theDroggl> hehe ok
<flux> I did btw try genetic algorithms for something else: http://www.modeemi.fi/~flux/software/ganame/
<theDroggl> I found it quite interesting to see the solutions improve
<theDroggl> but maybe its only fun if you can actually try the result ;)
<theDroggl> nice idea flux
fraggle_laptop has joined #ocaml
<flux> I could parallelize that, but that would be relatively simple task
fraggle_laptop has quit [Read error: Connection reset by peer]
fraggle_laptop has joined #ocaml
_unK has joined #ocaml
kaustuv has joined #ocaml
kaustuv has quit [Remote host closed the connection]
ikaros has quit [Quit: Leave the magic to Houdini]
ikaros has joined #ocaml
joewilliams_away is now known as joewilliams
rjsimmon has joined #ocaml
ikaros has quit [Ping timeout: 276 seconds]
derdon has quit [Ping timeout: 248 seconds]
Bazarov has joined #ocaml
ikaros has joined #ocaml
rjsimmon has quit [Quit: Leaving.]
Edward_ has quit []
<palomer> http://paste.lisp.org/display/111449 <--anyone have a clue why this displays a blank window?
ikaros has quit [Quit: Leave the magic to Houdini]
<thelema> sorry - curses is a mystery to me still
<palomer> it's so cool!
<palomer> if it would only work
__mattam__ has joined #ocaml
__mattam__ has left #ocaml []
Guest63782 has joined #ocaml
Guest63782 has left #ocaml []
nejimban has joined #ocaml
jimmyb2187 has quit [Ping timeout: 240 seconds]
Yoric has quit [Quit: Yoric]
ttamttam has quit [Quit: Leaving.]
derdon has joined #ocaml
nejimban has quit [*.net *.split]
infoe has quit [*.net *.split]
infoe has joined #ocaml
nejimban has joined #ocaml
nejimban has quit [Max SendQ exceeded]
nejimban has joined #ocaml
Edward_ has joined #ocaml
mbishop_ has joined #ocaml
mbishop has quit [Ping timeout: 276 seconds]
<palomer> it seems revised syntax does not have fun
<thelema> yes, I don't have fun when programming in revised syntax
<palomer> errr, I mean "function"
<palomer> (the keyword)
barismetin has quit [Quit: Leaving...]
<thelema> :)
mbishop_ has quit [Ping timeout: 265 seconds]
ulfdoz has quit [Ping timeout: 265 seconds]
ulfdoz has joined #ocaml
<palomer> so I have to do (fun x -> match x with ....) all over the place
travisbrady has joined #ocaml
Yoric has joined #ocaml
ttamttam has joined #ocaml
mbishop_ has joined #ocaml
eldragon has quit [Read error: Connection reset by peer]
<flux> palomer, I tried.. and failed, to make that example work. I'm tempted to try what happens in C, but I feel lazy :)
eldragon has joined #ocaml
<flux> gotta love how the curses api has 4 variations for each function..
ftrvxmtrx has quit [Quit: Leaving]
<palomer> I got it to work
<palomer> make the newwin bigger
<palomer> actually
<palomer> ah right, wclear the window first
Yoric has quit [Quit: Yoric]
<flux> wclear did the trick?
rbancroft has quit [Ping timeout: 245 seconds]
rbancroft has joined #ocaml
Submarine has joined #ocaml
rjsimmon has joined #ocaml
<palomer> I don't know what did the trick...
<palomer> I did a bunch of stuff until I found something that works
<palomer> here, ill figure it out
<palomer> ahh
<palomer> you need to call refresh
<palomer> before you do anything
<palomer> why? I have no clue
<palomer> so add a call to refresh after initscr
avsm has joined #ocaml
ccasin has quit [Quit: Leaving]
rjsimmon has quit [Quit: Leaving.]
ygrek has joined #ocaml
Dead_Dreamer has joined #ocaml
Bazarov has quit [Ping timeout: 248 seconds]
Edward_ has quit []
f[x] has quit [Ping timeout: 240 seconds]
f[x] has joined #ocaml
BigJ has quit [Read error: Connection reset by peer]
ikaros has joined #ocaml
derdon has quit [Ping timeout: 264 seconds]
oriba has joined #ocaml
BigJ has joined #ocaml
ftrvxmtrx has joined #ocaml
pad has joined #ocaml
oriba has quit [Quit: Verlassend]
ttamttam has quit [Quit: Leaving.]
avsm has quit [Quit: Leaving.]
<palomer> oh lord
<palomer> looks like I need polymorphic recursion
<palomer> let a = foo and b = bar in e <-- how do force ocaml to generalize a as soon as it type checks foo?
sepp2k has joined #ocaml
derdon has joined #ocaml
f[x] has quit [Ping timeout: 276 seconds]
rjsimmon has joined #ocaml
f[x] has joined #ocaml
Dead_Dreamer has quit []
_unK has quit [Remote host closed the connection]
mbishop_ is now known as mbishop
rjsimmon has quit [Quit: Leaving.]
<travisbrady> Are there plans in OCaml land for things like Haskell's forkIO? Should I use lwt if I want something like that?
<sgnb> palomer: it should (or your example is not enough self-contained)
<sgnb> travisbrady: looks similar to lwt indeed (I don't know much about forkIO, but I do know lwt)
<palomer> let () = let rec foo x = x and _ = foo 5 and _ = foo true in foo;; <--fails to typecheck
<palomer> huge bummer
<palomer> I think I'm going to have to wait for ocaml 3.12
<sgnb> indeed
<sgnb> or resort to the usual tricks
rjsimmon has joined #ocaml
<palomer> what are the usual tricks?
<sgnb> with a {module,class,record}
<palomer> oh, polymorphic recursion
<palomer> bummer!
<palomer> super bummer!
valross has joined #ocaml
<palomer> well, it works in 3.12:
<palomer> let y = let rec foo : 'a. 'a -> 'a = fun x -> x and _a = lazy(foo 5) and _b = lazy(foo true) in foo;;
<palomer> ironically, y has type '_a -> '_a
Edward_ has joined #ocaml
<sgnb> palomer: you should eta-expand it to make it polymorphic
<sgnb> (i.e. let y z = [...] in foo z)
<travisbrady> mfp: is your 'Comparing lightweight threads' post still available online? Google returns it in a search for 'ocaml lwt' but the link is broken
<sgnb> and what about the cached version?
<sgnb> I think it's the whole site which is unavailable
<travisbrady> sgnb: Oops, thank you. I forgot the google cache.
ulfdoz has quit [Ping timeout: 260 seconds]
Submarine has quit [Quit: Leaving]
<palomer> sgnb, yeah, but it's still ironic
ygrek has quit [Ping timeout: 245 seconds]
<sgnb> quite so indeed
emmanuelux has joined #ocaml
Yoric has joined #ocaml
middayc has joined #ocaml
sepp2k has quit [Quit: Leaving.]
mbishop has quit [Ping timeout: 265 seconds]
ikaros has quit [Quit: Leave the magic to Houdini]
derdon has quit [Ping timeout: 265 seconds]
mbishop has joined #ocaml
rjsimmon has quit [Quit: Leaving.]
rjsimmon has joined #ocaml
Yoric has quit [Quit: Yoric]
boscop_ has joined #ocaml
jeddhaberstro has joined #ocaml
boscop has quit [Ping timeout: 276 seconds]
rjsimmon has quit [Quit: Leaving.]
mbishop_ has joined #ocaml
mbishop has quit [Ping timeout: 265 seconds]
thrasibule has joined #ocaml
valross has quit [Ping timeout: 265 seconds]
valross has joined #ocaml