larhat has quit [Read error: Connection reset by peer]
larhat has joined #ocaml
lggr has joined #ocaml
ulfdoz has quit [Quit: kernel update]
<wieczyk>
Which standard library extension do you use? Batteries or Core? It is common to use both?
eni has quit [Ping timeout: 245 seconds]
<wieczyk>
If not, then it is small pitfail of community... not popular language and when you write some library you have to decide which extension you want to use.
ulfdoz has joined #ocaml
lggr has quit [Ping timeout: 276 seconds]
lggr has joined #ocaml
sgnb has quit [Remote host closed the connection]
sgnb has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
<pippijn>
is it true that in revised syntax, I can not make my own True and False variants?
lggr has joined #ocaml
pango has joined #ocaml
elixey has quit [Ping timeout: 276 seconds]
lggr has quit [Ping timeout: 245 seconds]
Anarchos has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 272 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
GnomeStoleMyBike has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
GnomeStoleMyBike has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
pima has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
theplanet has joined #ocaml
pima_ has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
pima__ has joined #ocaml
pima_ has quit [Client Quit]
lggr has joined #ocaml
sivoais has quit [Read error: Connection reset by peer]
sivoais has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
<wieczyk>
Does ocaml use references?
<wieczyk>
If I put for example
<wieczyk>
let v = some-value-of-algebraic-data-type in
<wieczyk>
[v; v; v; v; v]
<wieczyk>
Does this list constainf of references to value of v or copies of value v?
<wieczyk>
Whats about Hashtbl, Map etc?
<Kakadu>
wieczyk: 1st, I think
<adrien>
wieczyk: check with the (==) operator
<wieczyk>
Good idea, I forgot about physical comparision.
<wieczyk>
references.
<wieczyk>
Good, but I was expecting this due to persistent data structures.
<wieczyk>
It would be weird of doing copy of immutable data.
<wieczyk>
Another question
<wieczyk>
let r = ref 0
<wieczyk>
r := 5;
<wieczyk>
r := 6;
<wieczyk>
It is optimalized for integer? The r is mutable storage of integer type or it is mutable reference to boxed immutable integer?
sivoais has quit [Read error: Connection reset by peer]
sivoais has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
<adrien>
your second possibility would seema little bit extreme
<wieczyk>
But it is possible.
<adrien>
there's no reason to share integers
<adrien>
so I doubt they're shared
<wieczyk>
It depends on how ref is implemented. Maybe it has only general mechanism and basic types have to be boxed.
<wieczyk>
See C# for example and polymorphism here (generics)
<adrien>
boxed doesn't mean it's immutable
<adrien>
# let x = ref 42;;
<adrien>
val x : int ref = {contents = 42}
sgnb has quit [Remote host closed the connection]
lggr has joined #ocaml
sgnb has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
beckerb has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
theplanet is now known as elixey
elixey has quit [Quit: leaving]
lggr has joined #ocaml
Anarchos has quit [Ping timeout: 252 seconds]
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
eni has joined #ocaml
ontologiae has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
<wieczyk>
Yes, boxed does not mean immputable. You have right.
<wieczyk>
(Sorry I have guest).
lggr has quit [Ping timeout: 246 seconds]
<wieczyk>
Whatever. I am asking how the references to an integer re implemented.
<wieczyk>
mutable for primitive type, mutable reference to immutable boxed value, mutable reference to mutable boxed value.
<wieczyk>
mutable store for*
<wmeyer>
wieczyk: references will be always boxed
<wmeyer>
it will be a block of one field
<wmeyer>
where the value will have least significant bit set
<wmeyer>
of course the compiler can optimise things
<wmeyer>
it could convert the references to a stack slot
lggr has joined #ocaml
<wieczyk>
Why the bit is set?
<wmeyer>
to distinguish between pointers to another block and integers, precise garbage collector needs to traverse the data structures, to do this, it needs to know two things, size of the block, and for each field whetever it's an integer or pointer to another block
<wmeyer>
and because memory blocks are aligned, it's guranteed that the least significant bit is cleared
<wmeyer>
the major reason is stack
pima__ has left #ocaml []
lggr has quit [Ping timeout: 255 seconds]
<wmeyer>
once you register the stack slot with Caml values, the gc at each collection which will happen in C code, will traverse them to make sure that the blocks they are referencing will be not collected
pima has quit [Quit: Page closed]
lggr has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
lggr has quit [Ping timeout: 246 seconds]
larhat has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
ulfdoz has quit [Remote host closed the connection]
ulfdoz has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
emmanuelux has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
<madroach>
hi, is there a way to define mutually recursive class types and types? Like this: http://pastebin.com/KJFixqci
<wmeyer>
madroach: yes, by wrapping them in recursive modules.
lggr has quit [Ping timeout: 260 seconds]
<wieczyk>
wmeyer: thanks for explanations, I have to concede I dont know how GC works.
<wieczyk>
Only basic idea that 'reachibility graph' is more reliable than 'reference counting'
<wieczyk>
due to cyclic pointers.
<wieczyk>
cycles*
<wieczyk>
cycles* in data
<wieczyk>
cycles in data*
<wieczyk>
pff that was hard correction
<wmeyer>
sed is turing complete!
<wmeyer>
:)
<madroach>
wmeyer: I don't yes know about recursive modules, but this sounds like a solution. Thanks :)
lggr has joined #ocaml
<wmeyer>
madroach: you welcome
<wieczyk>
(For me the recursive modules sounds like some perversy -- of course i did not use them and know nothing about this)
<wmeyer>
they are, but it's one of the features that is rarely used but needed occasionally - they also workaround some limitations of the type system sometimes
abeaulieu has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
abeaulieu has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
ftrvxmtrx has joined #ocaml
sgnb has quit [Read error: Connection reset by peer]
sgnb has joined #ocaml
lggr has joined #ocaml
ftrvxmtrx has quit [Read error: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number]
ftrvxmtrx has joined #ocaml
sgnb has quit [Ping timeout: 245 seconds]
ChristopheT has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
AdmiralBumbleBee has left #ocaml []
ulfdoz has quit [Quit: deprecated]
lggr has quit [Ping timeout: 240 seconds]
ulfdoz has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
emmanuelux has quit [Remote host closed the connection]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
ontologiae has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 246 seconds]
emmanuelux has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 272 seconds]
lggr has joined #ocaml
UncleVasya has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
Anarchos has joined #ocaml
lggr has joined #ocaml
BiDOrD has quit [Read error: Operation timed out]
BiDOrD has joined #ocaml
pango has quit [Ping timeout: 240 seconds]
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
pango has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
eni has quit [Quit: Leaving]
lggr has quit [Ping timeout: 260 seconds]
notdan has quit [Remote host closed the connection]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
Anarchos has quit [Ping timeout: 245 seconds]
djcoin has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
notdan has joined #ocaml
lggr has joined #ocaml
SanderM has joined #ocaml
Kakadu has quit [Ping timeout: 246 seconds]
ontologiae has joined #ocaml
cdidd has quit [Remote host closed the connection]
Kakadu has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
emmanuelux has joined #ocaml
SanderM has quit [Quit: I need to take it elsewhere.]
lggr has quit [Ping timeout: 276 seconds]
lggr has joined #ocaml
SanderM has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
jamii has joined #ocaml
Cyanure has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 265 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
ontologiae has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 272 seconds]
SanderM has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
sepp2k has quit [Read error: Connection reset by peer]
sepp2k has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
djcoin has quit [Quit: WeeChat 0.3.7]
lggr has joined #ocaml
SanderM has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
<hcarty>
wieczyk: I think Core existed first, but only as an internal project/library. Core's development has been opened up somewhat, but it is still closely tied to Jane St. Batteries began and continues as a community project.
<hcarty>
Batteries was started/released before any public releases of Core were made.
<wieczyk>
mhmh
cdidd has joined #ocaml
<hcarty>
Core requires a signed contributor agreement before contributions can be made, Batteries does not
<Kakadu>
wieczyk: Use both and decide what is better
lggr has joined #ocaml
<hcarty>
Core works hard to be consistent with its own standards. Batteries is designed to be (almost entirely) compatible with the stdlib out of the box.
tufisi has quit [Ping timeout: 248 seconds]
Cyanure has joined #ocaml
avsm has joined #ocaml
tufisi has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
SanderM has quit [Remote host closed the connection]
f[x] has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
<adrien>
hcarty: well, Batteries came first if you take extlib into account :P
* wmeyer
OCaml rule of four always stands.
lggr has joined #ocaml
<arsatiki>
what's the rule of four?
beckerb has quit [Ping timeout: 245 seconds]
rudi has joined #ocaml
<wmeyer>
OCaml has at least four different std-libraries, at least four different package managers and at least four different build systems
Jeaye has joined #ocaml
<arsatiki>
Ah
<arsatiki>
Since there are so many, they must all suck
<arsatiki>
I'll write a new one
<wieczyk>
20:28 < wmeyer> OCaml has at least four different std-libraries, at least four different package managers and at least four different build systems
<wieczyk>
hehehe
<wieczyk>
Well
<wieczyk>
we should provide three additional compilers.
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
<wmeyer>
yes, that would essentially be the Complete version of Rule of Four
<wmeyer>
and the rule of four says also that they have to be incompatible
<avsm>
js_of_ocaml, ocamlc, ocamlopt, ocamljs. i make that to be 4 :-P
rudi has quit [Remote host closed the connection]
<flux>
js_of_ocaml isn't really a compiler..
<wmeyer>
I agree with avsm at any rate we have also four different compilers too. We also have two different syntaxes (we need to think about two more, I would suggest the Brace Syntax for ocaml), and two different pre-processors (third is coming I think!)
<flux>
and those are all based on the same source
lggr has quit [Ping timeout: 245 seconds]
<wmeyer>
flux: there is always a blur distinction in between "everything" and "compiler" :-)
lggr has joined #ocaml
<wmeyer>
but js_of_ocaml looks more like a compiler backend ..
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
sepp2k has quit [Read error: Connection reset by peer]
UncleVasya has quit [Quit: UncleVasya]
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 272 seconds]
lggr has joined #ocaml
<wieczyk>
I hope that the Rule Of Four (ROF) will not tell about community's cardinality.
lggr has quit [Ping timeout: 255 seconds]
Anarchos has joined #ocaml
lggr has joined #ocaml
<wmeyer>
wieczyk: My hypothesis that ROF is almost equivalent to The Lisp Course.