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]