rwmjones changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.1 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
jlouis has quit ["leaving"]
sergez_ has joined #ocaml
ita has quit [Remote closed the connection]
mbishop has joined #ocaml
<Snrrrub> Okay, newbie question: why would the compiler insist that my List.filter expression return unit in a function that has the form: let f l = List.filter someFunction l; ()
Mr_Awesome has joined #ocaml
<thermoplyae> in the expression a ; b (typed as 'a), a is supposed to have type unit and b type 'a
<thermoplyae> what you actually mean to write above is let f l = ignore (List.filter someFunction l), or maybe let f l = let _ = List.filter someFunction l in ()
<Snrrrub> So does the expression a <- b have type unit?
mbishop has quit [Remote closed the connection]
<thermoplyae> it does
<Snrrrub> I see. Thanks, that clarifies a LOT! :)
<ozzloy> http://xrl.us/beyoq why doesn't this work? eval_fn is defined in expr.ml
<ozzloy> is this not the right way to include files?
<Smerdyakov> #use isn't part of the language.
<Smerdyakov> It's just a directive for the toplevel.
<Smerdyakov> There is no language construct to include a file.
<ozzloy> ok. the ocaml shell we have available to us does not have history. nor do we have rlwrap. do you have a suggestion?
<ozzloy> what's your environment like for writing ocaml?
sergez_ has quit [Read error: 113 (No route to host)]
<Smerdyakov> You really should read some of the manual. OCaml has a story for multi-file development just like C does.
<ozzloy> Smerdyakov: could you provide me with a link to this documentation?
<ozzloy> Smerdyakov: are you talking about ocaml-tutorial.org?
timchen1` is now known as nasloc__
mbishop has joined #ocaml
Snrrrub__ has joined #ocaml
mbishop has quit ["brb"]
Snrrrub has quit [Read error: 110 (Connection timed out)]
sergez_ has joined #ocaml
mbishop has joined #ocaml
sergez__ has joined #ocaml
sergez_ has quit [Read error: 104 (Connection reset by peer)]
sergez__ has quit [Read error: 110 (Connection timed out)]
Tetsuo has joined #ocaml
sergez_ has joined #ocaml
sergez_ has quit [Read error: 110 (Connection timed out)]
middayc has quit []
AxleLonghorn has joined #ocaml
sergez_ has joined #ocaml
thermoplyae has left #ocaml []
sergez_ has quit [Read error: 110 (Connection timed out)]
Snrrrub__ is now known as Snrrrub
AxleLonghorn has left #ocaml []
<flux> hmh, does anyone else hate that godi-tools are godi_xx instead of godi-xx - you always need to press shift..
<flux> I guess it's too late now to fix it :)
pantsd has joined #ocaml
pantsd has quit [Client Quit]
<flux> sigh, on solaris godi's bootstrap insists on executing /usr/lib/dc, which is a directory (and not in the path even); the real binary would be at /opt/gnu/bin/dc
<flux> and I can't figure out where it is calling it from, to fix it.. any ideas? http://modeemi.fi/~flux/bootstrap.log
netx has quit [Read error: 110 (Connection timed out)]
kmeyer has left #ocaml []
l_a_m has joined #ocaml
<unfo-> flux, nice domain
<flux> it's the domain of the local (old) university computer club
<unfo-> figures :)
<flux> we also like the logo (which can be seen in the main page), which we lended (with premission) from (I think) HP ;)
ttamttam has joined #ocaml
<unfo-> :D
<unfo-> flux, you wouldn't happen to be in any way related to fluxbox teh WM?
<flux> nope
<unfo-> just checking :)
oooook100 has joined #ocaml
<oooook100> how is ocaml falling down ?
<oooook100> thats a pretty big jump down from last month
<bla> What fun! Can you manipulate the multipliers and weights to make your favourite language the best programming language in the Benchmarks Game?
<bla> what the heck?
Snrrrub__ has joined #ocaml
<tsuyoshi> that's probably it.. ocaml is well known to have poor threading support
<bla> It's higher without threading...
<flux> I wonder if the cothread threading library would suit the benchmarks
<bla> C also lost on threading to C++.
Snark has joined #ocaml
Snrrrub has quit [Read error: 110 (Connection timed out)]
netx has joined #ocaml
<bla> Probably because C++ has no threading program written at all.
<bla> and D has 'error' in place of thread-speed.
<bla> Nevertheless ocaml threading could be nicer...
<pango_> would writting it using lwt be considered cheating? ;)
<pango_> after all, Haskell program use lightweight threads too
<bla> So there shouldn't be problem.
<bla> Their ocaml program on mine computer after 3 minutes of running took 280mb of memory and didn't finished.
<bla> I wonder if I understand argument correctly.
<bla> sml, lisp, basic has no threading program also.
<bla> Pascal, C and OCaml looses much on this threading. ;d
ygrek has joined #ocaml
<bla> Ada also.
filp has joined #ocaml
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
cygnus_ has quit [Read error: 110 (Connection timed out)]
sergez_ has joined #ocaml
sergez_ has quit [Client Quit]
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
Mr_Awesome has joined #ocaml
Snrrrub__ has quit [Read error: 110 (Connection timed out)]
seafood_ has joined #ocaml
hkBst has joined #ocaml
* bla was able to get down to 49 seconds from 3 minutes using mutexes and static array for transfering data.
<bla> (Like the C program)
<bla> Just why it prints 360 instead of 361. ;p
<flux> mutability strikes back ;-)
<bla> TIme would be c-alike if the issue was solved. ;p
<bla> Ah, got it.
<bla> Maybe you can improve something. I've got to go. ;)
cygnus_ has joined #ocaml
ygrek has quit [Remote closed the connection]
semaphore has joined #ocaml
ygrek has joined #ocaml
alexp has joined #ocaml
seafood__ has joined #ocaml
seafood_ has quit [Read error: 104 (Connection reset by peer)]
seafood__ has quit []
seafood_ has joined #ocaml
Tetsuo has quit ["Leaving"]
Yoric[DT] has joined #ocaml
<Yoric[DT]> HI
<Yoric[DT]> Sorry, hi.
Snark has quit ["Ex-Chat"]
seafood_ has quit []
asmanur has joined #ocaml
petchema has quit [Remote closed the connection]
seafood_ has joined #ocaml
petchema has joined #ocaml
seafood_ has quit []
sergez has joined #ocaml
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
munga has joined #ocaml
olleolleolle has joined #ocaml
RobertFischer has joined #ocaml
dramsay has joined #ocaml
ecc has quit ["Client exiting"]
middayc has joined #ocaml
Tetsuo has joined #ocaml
filp has quit [Read error: 104 (Connection reset by peer)]
filp has joined #ocaml
postalchris has joined #ocaml
olleolleolle has quit []
pango_ has quit [Remote closed the connection]
filp has quit [Read error: 110 (Connection timed out)]
filp has joined #ocaml
bluestorm has joined #ocaml
pango_ has joined #ocaml
ecc has joined #ocaml
<bluestorm> hm Yoric[DT], are you the one talking about arithmetic modules normalization ? (i might add a link to my Numeric modules :p )
<Yoric[DT]> That was the idea :)
<bluestorm> i first thought "haha, he is not aware of my bright new idea"
<bluestorm> then i noticed the IP was suspicious
<Yoric[DT]> You're even watching IPs ?
* Yoric[DT] is feeling tracked down :)
filp has quit ["Bye"]
RobertFischer has quit ["Trillian (http://www.ceruleanstudios.com"]
ecc has quit ["leaving"]
postalchris has quit [Read error: 110 (Connection timed out)]
RobertFischer has joined #ocaml
ecc has joined #ocaml
jlouis has joined #ocaml
ttamttam has left #ocaml []
Morphous_ has joined #ocaml
Snrrrub__ has joined #ocaml
Snrrrub___ has joined #ocaml
jderque has joined #ocaml
<Yoric[DT]> Good night everyone.
Yoric[DT] has quit ["Ex-Chat"]
delamarche has joined #ocaml
bongy has joined #ocaml
postalchris has joined #ocaml
Morphous has quit [Read error: 110 (Connection timed out)]
psnively has joined #ocaml
darinm has joined #ocaml
Snrrrub__ has quit [Read error: 110 (Connection timed out)]
jlouis_ has joined #ocaml
alexp has quit ["Leaving"]
jlouis has quit [Read error: 110 (Connection timed out)]
munga has quit ["Leaving"]
darinm has quit []
bongy has quit ["Leaving"]
darinm has joined #ocaml
middayc has quit []
semaphore has left #ocaml []
<flux> bla, but the problem might be that cothread is a (big) library to put in; maybe it is ok, I don't know
<bla> I also don't.
ecc has quit [Remote closed the connection]
ecc has joined #ocaml
<bla> http://temp.thera.be/threadring2.ml this one doesn't use global variables; threads create each other recursively. Time ~48s.
<bla> Can you comment it? I'd like to send it there... ;d
oooook101 has joined #ocaml
<bluestorm> how does the shootout current implementation times on your machine ?
oooook100 has quit [Read error: 104 (Connection reset by peer)]
asmanur has quit ["tralala"]
<bla> I don't understand word 'shootout'.
<bluestorm> i mean
<bla> Vanilla version took 3 minutes about.
<bluestorm> ok
<bla> Over 3 minutes.
<bla> I can give vanilla C time for comparison:
<bla> C: 0m37.385s OCaml: real 0m48.309s
<bluestorm> i don't think they would accept a CoThreads version
<bluestorm> you may try to recode it as a Unix.fork() one
marmottine has joined #ocaml
<bla> Might do; fork + wait_signal + kill
<bluestorm> (as i guess the speedup of CoThreads over Threads on multicore comes from the use of different processes)
<bla> AFAIR Linux treats threads as separate processes.
<bla> Sharing some memory (man clone)
<bluestorm> ocaml Threads are "green threads"
<bluestorm> and are not multi-threads actually
<bluestorm> hmm
<bluestorm> actually
<bluestorm> the implementation might use OS threads
<bluestorm> (must depend on the compilation options and so on)
<bla> Hm.
<bluestorm> but there is only one thread executing at a time, anyway
<bluestorm> while of course fork()ed processes can run simultaneously
<bla> I can try it tomorrow evening;
RobertFischer has quit ["Trillian (http://www.ceruleanstudios.com"]
<bla> http://temp.thera.be/threadring1.ml http://temp.thera.be/threadring2.ml This are mine two versions so far. First smaller, but I guess dirtier. Now I should be off to some exam-learning...
<bluestorm> :p
<psnively> OCaml has both green and native threads, but the GC is not concurrent, so you lose on multicore.
<psnively> If you really, really must have parallelism, that's what JoCaml is for (that is, multiple communicating processes).
marmottine has quit [Remote closed the connection]
marmottine has joined #ocaml
pango_- has joined #ocaml
filp has joined #ocaml
ttamttam has joined #ocaml
ReachingFarr has joined #ocaml
darinm has quit []
<jonafan> Why doesn't foo compile? http://www.podval.org/~sds/ocaml-sucks.html#language
<jonafan> you can write a suitable printerf function, and the return value of this function should be whatever printerf returns
<jonafan> it looks perfectly legal to me
<flux> I guess there is a reason, dunno if it can be fixed without breaking backwards compatibility (common sense would say so, but common sense might not play quite right here ;))
<jonafan> the type of foo should be (('a -> string) -> 'a -> 'b) -> t -> 'b
<bla> But type inferring won't let you do it.
<bla> And, can it be 'a? What if you pass char to it?
<jonafan> that 'a is for the printerf function's first argument, to convert the 'a to a string. if you pass something that converts a char to a string, why not?
<flux> actually that's a point I learned some time ago, but apparently forgot also :)
<jonafan> i mean, it's not like it's not trivial to write something equivalent in ocaml, but i just don't understand why it doesn't compile
postalchris has quit [Connection timed out]
<cygnus_> because the first use of it binds the variables to accept int
<cygnus_> i think you must write it using functors
<flux> there was a page listing the numerous options on how to write that
<flux> actually it was for the fix-function, but the problem was similar, I think
<flux> as the document says: not pretty :)
<bluestorm> thats not soo ugly
<jonafan> or just have the pattern match thingy return the string value and pass that to something that prints strings
<bluestorm> anyway
marmottine has quit ["Quitte"]
<bluestorm> the snippet in the document is quite stupid
<bluestorm> it would make much more sense to use a "print : string -> unit" function
<bluestorm> and then doo
<bluestorm> printerf (string_of_int i)
<bluestorm> printerf (string_of_float x)
<jonafan> right
<bluestorm> printerf ((fun s -> s) str)
<flux> perhaps in that case, but there are other cases where that kind of syntax is desirable
<jonafan> i agree, it's not exactly a deal breaker for the language
<bluestorm> i don't say you can't run into the rank-2 polymorphism problem in practice
<bluestorm> but the example is quite bad
<bluestorm> and i think we have quite correct workarounds
<bluestorm> (one of them being the code i showed before)
<cygnus_> #
<cygnus_> type 'b printer = { printer : 'a. ('a -> string) -> 'a -> unit }
<cygnus_> this is making a polymorphic type , but what is the { } for ?
<bluestorm> hm
<bluestorm> it's a struct-like declaration
<bluestorm> "record"
<bluestorm> it's a record
<cygnus_> i thought type must have constructors?
<bluestorm> type coord = { x : int; y : int }
<bluestorm> cygnus_: algebraic datatypes must
<cygnus_> ok so a polymorphic record
<cygnus_> is the 'a. meaning for all a ?
<bluestorm> yes
<bluestorm> it's were rank-2 polymorphism is involved
<bluestorm> actually rank-2 polymorphism is a quite "elaborate" type-system feature, and i think (but i'm not sure really) it's originally been introduced in OCaml for the object system
<bluestorm> we can have it in records too
<bluestorm> but it hasn't been extended to general types
<bla> Well. It can work without this struct. Can't it?
<bluestorm> (i guess the added complexity wasn't worth the benefits)
<bluestorm> bla: i don't think so
<bluestorm> to use that you have to use a record or an object
<cygnus_> hmm
<bla> Hm. I'll try experimenting on clean ocaml then.
<cygnus_> why can't you just define the function and use it
<bluestorm> you'll run into a type-inference problem
<bluestorm> but it's a quite rare problem
<cygnus_> how do you define a function with polymorphic argument types
<bla> Checking...
<bla> Well. It seems to work.
<bla> Or I am mistaken.
<cygnus_> ye
<bluestorm> bla:
<bluestorm> you're mistaken :-'
<bluestorm> your argument is "erf", not "printer"
<bla> Duh I must be.
<bluestorm> (parameter)
<bla> Heh.
<bluestorm> of course the use of printer as a global variable is correct
<bluestorm> the problem is with the inference of the parameter type of the foo function
<bla> Ok. There wouldn't be any problem if it would just work.
<bluestorm> ?
<bla> (We wouldn't be talking about this now)
<flux> I tried even working that around with recursive modules but no go..
<bluestorm> :p
<cygnus_> bluestorm: does the use of a record allow the inference to be delayed ?
<flux> that's actually a bit weird imo :)
<bluestorm> cygnus_: the type inside the record is different
<cygnus_> yes
<bluestorm> (('a -> string) -> 'a -> unit) and ('a . ('a -> string) -> 'a -> unit) are different types
<bluestorm> when using the record, you don't have ocaml inferencing the erf.printer type
<cygnus_> how come the ocaml language does not bind the types inside the record to be "int"
<bluestorm> it's already enforced by your declaration
<cygnus_> ok
delamarche has quit []
<flux> http://pastebin.be/8629 - modules won't fix it
<bla> Pity that you can't do it that way also:
<bla> let foo (printer : ('a -> string) -> 'a -> unit) arg = (...)
<bluestorm> if rank-2 polymorphism was extended to every type, not only record and objects
<cygnus_> flux: i think if you parameterise with functor it probably can
<bluestorm> you would do let foo (printer : ('a. 'a -> string) -> 'a -> unit) arg =
<cygnus_> actually maybe not still
<cygnus_> sine it just wont allow it
<cygnus_> i hate ocaml
<cygnus_> ;p
thermoplyae has joined #ocaml
<flux> the problem is quite rare in practice
<flux> I suppose though that someone writing a combinator library could hit it constantly
<flux> I've used polymorphic record fields and object methods a few times
marmottine has joined #ocaml
<bluestorm> i think the general consensus is to use object-oriented code when you need something like that
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
<flux> but slightly related to this discussion, I whipped up a simple dynamic typing module: http://modeemi.cs.tut.fi/~flux/software/ocaml/narrow.mli and http://modeemi.cs.tut.fi/~flux/software/ocaml/narrow.ml
<flux> I wonder if it is useful for anything, though :)
<flux> you'd still need your own tagging, I suppose, or a mechanism for checking if the tag matches
<flux> or maybe just using objects is more suitable for the task
Illocution has quit ["Lost terminal"]
postalchris has joined #ocaml
<hcarty> Where are the IRC logs for #ocaml? Someone provided a link a few days ago, but I can't find it...
pango_- is now known as pango
<flux> I don't know, but if I were to google for them, I'd search for some phrase from looong ago in my backbuffer :)
<flux> darn, didn't work :-)
<hcarty> Sadly, I only have ~1 day in by buffer currently :-)
<flux> I have a week or so, and still it failed :(
<flux> another idea: search for a combination of nick usually loud in the channel..
<flux> for the record, I use flux hcarty pango :)
<flux> used, even
<hcarty> Excellent, thank you
<hcarty> 08.01.26 - has the meeting transcription as well as a link to the Cal Tech book. Seems worth keeping around.
ttamttam has left #ocaml []
Illocution has joined #ocaml
postalchris has quit [Connection timed out]
<bluestorm> wow
<bluestorm> Yoric even typed live code examples :D
darinm has joined #ocaml
<bluestorm> hcarty: to what i personally understood, Xavier Leroy didn't say they would include anything inside the inria-provided packages
<bluestorm> he said he would be happy to have a bigger distribution somewhere, and point users to it
<bluestorm> (wich is quite the same anyway)
<bluestorm> this is why the "installation / management tools" for such a distribution are so important
<bluestorm> (in this regard i think the general consensus was that we should try to make GODI fit that purpose)
filp has quit ["Bye"]
Tetsuo has quit ["Leaving"]
darinm has quit [Read error: 110 (Connection timed out)]
seafood_ has joined #ocaml
ReachingFarr has quit ["Leaving."]
seafood_ has quit [Read error: 104 (Connection reset by peer)]
seafood_ has joined #ocaml
seafood_ has quit [Read error: 104 (Connection reset by peer)]
jderque has quit [Read error: 113 (No route to host)]
seafood_ has joined #ocaml
seafood_ has quit [Read error: 104 (Connection reset by peer)]
seafood_ has joined #ocaml
seafood_ has quit [Read error: 104 (Connection reset by peer)]
seafood_ has joined #ocaml
seafood__ has joined #ocaml
seafood_ has quit [Read error: 104 (Connection reset by peer)]
CRathman has joined #ocaml
ita has joined #ocaml
seafood__ has quit [Read error: 104 (Connection reset by peer)]
seafood_ has joined #ocaml
seafood_ has quit [Read error: 104 (Connection reset by peer)]
seafood_ has joined #ocaml
ygrek has quit [Remote closed the connection]
dudley has joined #ocaml
seafood_ has quit [Read error: 104 (Connection reset by peer)]
seafood_ has joined #ocaml
seafood_ has quit [Read error: 104 (Connection reset by peer)]
seafood_ has joined #ocaml
<dudley> hi all
<dudley> I've decided to learn ocaml and was just wondering if there are good IDEs around. I use a Mac
<dudley> anybody there?
dudley has left #ocaml []
<bluestorm> :D
<mbishop> heh
<ita>
dudley has joined #ocaml
seafood_ has quit [Read error: 104 (Connection reset by peer)]
dudley has left #ocaml []
seafood_ has joined #ocaml
kelaouch1 has joined #ocaml
seafood_ has quit []
kelaouchi has quit [Read error: 110 (Connection timed out)]
<bla> I love people with 4-minute-patience.
<bluestorm> i sent him a private message
<bluestorm> but he disconnected short after
Yoric[DT] has joined #ocaml
<bla> bluestorm, i doubt that mine fork implementation will be faster from Thread one. ;d
<bluestorm> on a multi-core machine ?
<bluestorm> you should try
<bla> No, amd64 one.
<bluestorm> (i haven't)
<bla> I do now.
<bla> But it needs a bit twitching still.
<bluestorm> hm if it's a one-core one of course it isn't very interesting
<bla> I almost fork-bombed mine computer with it. ;p
<bluestorm> but i guess the contest is evaluated on a multi-core machine, right ?
<bla> I can try on mine server; It's dual-processor-with-HT-each.
<bla> It's some pentium 4.
<bla> But, there are 503 concurrent tasks.
<bluestorm> hm
<bluestorm> you could try a hybrid approach
<bluestorm> you fork, say, 50 process, and make them compute 10 tasks each
<bluestorm> or 10/50
<bla> for n=1000000, 14s (thread does this in 4s)
<bla> How would you sent token over forked processes?
<bla> Is there any option of using clone()?
<bla> I'm doing it currently with pipes.
<bla> And it takes about 11MB per process. By sharing some memory segments it could be done nicer.
<bla> Hybrid approach could be nice.
<bla> Pipes also do synchronisation here.
<pango> most of this memory should still be shared, Linux does COW (copy on write)
<bla> With fork()?
<pango> of course
<bla> I guess it's not so difficult to 'touch' some memory in such high-level language.
<bla> Touch one which could be shared otherwise. ;d
<pango> at least we don't have reference counters
<pango> but better not enable memory compaction ;)
<pango> (well, it seldom fires)
<bla> Hmmm. ;d
<bla> SHR per process is 188.
<bla> RES 684, VIRT 11504
<bla> Pipes are slow.
<bla> Shared memory segments would be better.
<pango> memory segments don't provide synchronisation, so you'd need some sort of locks too
<bla> I could use signals. Wonder how fast they are. ;d
<bla> real 2m27.703s
<bla> That's correct answer for their N (10000000)
<bla> It's still faster than their vanilla implementation. (over 3 minutes!)
<pango> question is, whether it's a concurrency, or parallelism benchmark. Since they have little requirements for threads kind, I'd say it's concurrency
<bla> I'll send them today version 2. It's fastest what I can think about without using non-standard threads.
marmottine has quit [Remote closed the connection]
RobertFischer has joined #ocaml
CRathman_ has joined #ocaml
CRathman_ has quit [Remote closed the connection]
RobertFischer has left #ocaml []
CRathman has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]> Well good night everyone.
Yoric[DT] has quit ["Ex-Chat"]
bluestorm has quit ["Konversation terminated!"]
dramsay has quit [Read error: 110 (Connection timed out)]
hkBst has quit ["Konversation terminated!"]