gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
arubin has quit [Quit: arubin]
emmanuelux has quit [Remote host closed the connection]
joewilliams is now known as joewilliams_away
mjonsson has joined #ocaml
oriba has quit [Quit: oriba]
lopex has quit []
jimmyrcom has quit [Ping timeout: 256 seconds]
philtor has joined #ocaml
mjonsson has quit [Remote host closed the connection]
EmmanuelOga has quit [Ping timeout: 252 seconds]
rwmjones has quit [Ping timeout: 252 seconds]
joewilliams_away is now known as joewilliams
rwmjones has joined #ocaml
dnolen has joined #ocaml
struktured has joined #ocaml
struktured has quit [Ping timeout: 260 seconds]
philtor has quit [Ping timeout: 252 seconds]
dnolen has quit [Quit: dnolen]
dnolen has joined #ocaml
dnolen has quit [Client Quit]
joewilliams is now known as joewilliams_away
Boscop has quit [Ping timeout: 252 seconds]
junsuijin has quit [Remote host closed the connection]
Skolem has joined #ocaml
Tommytom has joined #ocaml
<Tommytom> Hello, how remove Ocaml warning (Y: unused variable) ??
<_habnabit> use the variable, or name it _
<Tommytom> oh, yes of course, thank you !!
<flux> tommytom, you can also name it _y
<Tommytom> Ah nice too
<flux> (if the name holds some significancy to you that you don't want to lose)
<Tommytom> is it dirty ?
<flux> dirty? no, I think it's quite fine to use _foo
<Tommytom> But use unamed variable ?
<flux> I guess it depends
<flux> I sometimes use the same variable name for the same object throughout the program (if I'm threading, say, a context variable), and should I need to ignore it at times, I use the _name
<flux> but in general I think _ is just fine
<flux> typically I can ask emacs what is the type of the _ anyway, so it's not that much of hindrance to reading
<flux> you should always think how hard it is to read the code afterwards :)
<Tommytom> thank you, in my case is for widget (like separator) on lablgtk
Cyanure has joined #ocaml
edwin has joined #ocaml
ikaros has joined #ocaml
Tommytom has left #ocaml []
ttamttam has joined #ocaml
Cyanure has quit [Ping timeout: 258 seconds]
Boscop has joined #ocaml
ulfdoz has joined #ocaml
Cyanure has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
ankit9 has quit [Quit: Leaving]
Boscop has quit [Ping timeout: 258 seconds]
ulfdoz has quit [Ping timeout: 248 seconds]
larhat has joined #ocaml
ankit9 has joined #ocaml
lopex has joined #ocaml
mfp has quit [Read error: Connection reset by peer]
lusory has quit [Ping timeout: 260 seconds]
mfp has joined #ocaml
_andre has joined #ocaml
mfp has quit [Read error: Connection reset by peer]
mfp has joined #ocaml
Associat0r has quit [Quit: Associat0r]
rks has quit [Quit: bllblbl]
mjonsson has joined #ocaml
everyonemines has joined #ocaml
avsm has joined #ocaml
emmanuelux has joined #ocaml
yroeht has quit [Quit: WeeChat 0.3.5]
yroeht has joined #ocaml
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
redsteg has quit [Quit: leaving]
jamii has joined #ocaml
yroeht has quit [Quit: WeeChat 0.3.5]
yroeht has joined #ocaml
Boscop has joined #ocaml
dobroerlanger has joined #ocaml
yroeht has quit [Read error: Connection reset by peer]
ttamttam has quit [Ping timeout: 256 seconds]
<dobroerlanger> Hello. What is the least awful way of interfacing with C++?
<adrien> extern "C" {
<adrien> }
<adrien> and it's not even awful
<adrien> (same as C)
<adrien> which library?
<dobroerlanger> Own legacy library.
ttamttam has joined #ocaml
Boscop has quit [Ping timeout: 244 seconds]
Boscop has joined #ocaml
Boscop has quit [Ping timeout: 240 seconds]
jimmyrcom has joined #ocaml
redsteg has joined #ocaml
EmmanuelOga has joined #ocaml
EmmanuelOga has quit [Client Quit]
<everyonemines> Why does ocaml use boxed arrays instead of c style?
<thelema> everyonemines: how would you GC c-style arrays? you need some info for the GC to use
<thelema> oh, you're asking about ocaml's boxing of array elements
<thelema> ints and non-pointers aren't boxed, of course
<thelema> floats aren't boxed, but this is a special case
<everyonemines> I thought ocaml boxed ints in arrays...
<thelema> regular ints? no.
<thelema> Int32, Int64, Nativeint are always boxed
<everyonemines> ah
<everyonemines> although you shouldn't really need to box int32
<everyonemines> or int64
<thelema> arrays of arrays and arrays of records could be inlined, but then... hmm, I guess you'd just need more special cases / header info to deal with variable size objects
<thelema> whereas in ocaml, the thing passed around is always one machine word in size.
<thelema> which simplifies the runtime internals considerably
<thelema> as to boxing int32/int64, yes, those could be added as special cases for arrays as float is, but again, little benefit for much compiler/runtime complexity
<everyonemines> I don't see why you would need to handle int32 differently.
<everyonemines> If GC is on the whole array.
<thelema> if you want unboxed int32/64, use Bigarray
<everyonemines> yeah, I have
<thelema> GC for non-float arrays looks at the tag word for the array and then at all the values in the array
<thelema> it can detect ints from the low bit and not have to chase any pointers
<thelema> As it's possible to have both int-like values and pointers in the same array, the GC has to scan the whole array
<everyonemines> you mean with records?
<thelema> no, arrays too - an array of lists, for example.
<thelema> empty lists are int-like, whereas non-empty lists are a pointer to the head of the list
<everyonemines> Oh, I see. You build an array of arrays, then take a subarray. It's not copied unless it needs to be, but you want to throw away the unused array stuff.
<thelema> no, subarrays are copied.
<everyonemines> Then I'm not seeing why you would need to GC only part of an array.
<thelema> if an array of lists has all empty lists, the runtime representation is the same as an array of ints where all the ints are 0
<thelema> I'm arguing that the whole array has to be scanned even if it's all ints
<everyonemines> But you know that it's lists, not ints, and the GC could be adjusted to account for that.
<thelema> that's the trick - you don't know it's lists.
<thelema> types are erased during compilation, so the runtime doesn't know the type of any value.
<thelema> there'd be more overhead in ocaml if all values were tagged with their type.
<everyonemines> I was thinking of array tags for GC use.
<everyonemines> But I guess that complicates things if nothing else.
<thelema> at runtime, arrays are indistinguishable from tuples.
<thelema> (and records, for that matter)
<thelema> (except for float arrays)
oriba has joined #ocaml
hyperboreean has joined #ocaml
yroeht has joined #ocaml
ikaros has joined #ocaml
everyonemines has left #ocaml []
everyonemines has joined #ocaml
everyonemines has left #ocaml []
everyonemines has joined #ocaml
Cyanure has quit [Remote host closed the connection]
philtor has joined #ocaml
Boscop has joined #ocaml
dobroerlanger has quit [Ping timeout: 265 seconds]
<edwin> http://aichallenge.org/starter_packages.php <- they accept solutions in OCaml :)
<thelema> except their environment is a bit out of date
<thelema> it looks like they're running on ubuntu
<thelema> hmm, did 3.12 get into the latest ubuntu?
<thelema> yes, 3.12.0 in oneiric
<edwin> the latest ubuntu is unusable so I don't know
<edwin> 3.11.2 is not that bad
<edwin> its what Debian has in stable, doesn't it?
<thelema> I dunno.
lopex has quit [Ping timeout: 265 seconds]
randori_ has joined #ocaml
randori has quit [Disconnected by services]
randori_ is now known as randori
<Qrntzz> edwin: yes it does
ikaros has quit [Quit: Ex-Chat]
ttamttam has quit [Quit: Leaving.]
ankit9 has quit [Quit: Leaving]
junsuijin has joined #ocaml
joewilliams_away is now known as joewilliams
ftrvxmtrx has joined #ocaml
lopex has joined #ocaml
iris1 has joined #ocaml
ulfdoz has joined #ocaml
ankit9 has joined #ocaml
ztfw has joined #ocaml
ttamttam has joined #ocaml
EmmanuelOga has joined #ocaml
Snark has joined #ocaml
ikaros has joined #ocaml
everyonemines has quit [Quit: Leaving.]
ulfdoz has quit [Ping timeout: 240 seconds]
srcerer has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
jamii has quit [Read error: No route to host]
ikaros has quit [Quit: Ex-Chat]
ikaros has joined #ocaml
hto has quit [Read error: Operation timed out]
hto has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
avsm has quit [Quit: Leaving.]
ikaros has joined #ocaml
dobroerlanger has joined #ocaml
Snark has quit [Quit: Quitte]
ygrek has joined #ocaml
Associat0r has joined #ocaml
Associat0r has quit [Changing host]
Associat0r has joined #ocaml
lopex has quit [Ping timeout: 244 seconds]
yroeht has quit [Read error: Connection reset by peer]
ikaros has quit [Quit: Ex-Chat]
sepp2k has joined #ocaml
lopex has joined #ocaml
ikaros has joined #ocaml
_andre has quit [Quit: leaving]
fraggle_ has quit [Ping timeout: 258 seconds]
fraggle_ has joined #ocaml
ttamttam has quit [Quit: Leaving.]
edwin has quit [Remote host closed the connection]
sepp2k has quit [Ping timeout: 240 seconds]
lamawithonel has quit [Ping timeout: 240 seconds]
sepp2k has joined #ocaml
everyonemines has joined #ocaml
<everyonemines> I was looking at the google AI ocaml example and it has some weird code in it.
<everyonemines> eg http://pastebin.com/jhEWj4jQ
<_habnabit> what's weird about that?
<everyonemines> It uses 2 printf's for no reason.
<_habnabit> well, yes, it's quite silly.
<everyonemines> Author also doesn't seem to know about mutable records.
<_habnabit> IIRC the python example is quite bad as well.
<everyonemines> But that particular example I linked to...this is something I think I've seen multiple times.
<everyonemines> Not just in ocaml I mean. People using redundant functions like that.
<everyonemines> I don't really understand why.
<_habnabit> sure; there are a lot of bad programmers.
<_habnabit> a /lot/ of bad programmers.
<thelema> maybe it's because they took the shortest route to simplify some more complex code that needed two printf
<everyonemines> There are different ways people can be bad programmers.
<thelema> and they didn't really understand ocaml, so the less they change, the safer
<everyonemines> Not understanding recursion is different from not understanding sequence.
<thelema> ocaml's printf does have some tricky semantics
<everyonemines> Personally I feel that it's important to understand what people don't understand, so you can work around it.
<everyonemines> To be honest I didn't understand it at first, but that's because the explanation I was reading was terrible.
ankit9 is now known as ankit9|zzz
yroeht has joined #ocaml
edwin has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
edwin has left #ocaml []
everyonemines has quit [Quit: Leaving.]
edwin has joined #ocaml
edwin has quit [Remote host closed the connection]
ztfw has quit [Remote host closed the connection]
sepp2k has quit [Remote host closed the connection]
HalfMadDad has quit [Quit: Leaving]
HalfMadDad has joined #ocaml
randori has quit [Quit: leaving]
lopex has quit [Ping timeout: 276 seconds]
lopex has joined #ocaml
lopex has quit []
avsm has joined #ocaml
Amorphous has quit [Ping timeout: 260 seconds]
lopex has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
kalio has joined #ocaml
Amorphous has joined #ocaml
Skolem has quit [Quit: Skolem]
HalfMadDad has left #ocaml []
lamawithonel has joined #ocaml