wingsorc has quit [Remote host closed the connection]
wingsorc has joined #ocaml
adanwan has quit [Write error: Connection reset by peer]
azimut has quit [Remote host closed the connection]
adanwan has joined #ocaml
azimut has joined #ocaml
chrisz has quit [Ping timeout: 252 seconds]
chrisz has joined #ocaml
romildo has quit [Quit: Leaving]
wingsorc has quit [Quit: Leaving]
wingsorc has joined #ocaml
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
azimut has quit [Ping timeout: 268 seconds]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<gopiandcode>
Heyo! Anyone know if there are any rules on when and how it's safe to use Obj.magic
<dh`>
oh ffs when did the website become so ...commercial?
<gopiandcode>
(context is in the discuss post I made a few days ago, but it seems no one answered it :( )
<dh`>
it is only safe if you know that two values are really the same type but you can't persuade the type system
adanwan has quit [Remote host closed the connection]
<dh`>
one way that can be is as a workaround for messed up module constraints
adanwan has joined #ocaml
<dh`>
(but you're better off fixing the module constraints)
<dh`>
there are probably cases where it is sort-of-safe to treat the representation of one type as a representation of another, but I would avoid that as it can break without warning in the next version
<gopiandcode>
I'm not just using Obj.magic willy-nilly to just fix some spurious type errors
<dh`>
then you probably know more about it than I do
<dh`>
:-)
<gopiandcode>
I happen to have some reified expressions that I know are well typed, but it isn't worth it to convert it to a GADT encoding
<gopiandcode>
I'm just curious if there are any footguns that I'd run into, or what would be the safest way of using Obj.magic if I need it
<gopiandcode>
like, for example, might there be some kind of problem with using Obj.magic to create a list of values, some of which are boxed and some of which are unboxed? (provided I obj.magic them to the appropriate types before using them)
<gopiandcode>
should I use an existential wrapper - would that make a difference?
<dh`>
that seems likely to explode but you need someone who knows more about the internals than I do
<gopiandcode>
module Wrap = struct type t = Mk : 'a -> t let unwrap (Mk v) = Obj.magic v end
<gopiandcode>
type val = Wrap.t let ls = Wrap.[Mk 1; Mk object end; Mk ()]
<gopiandcode>
type val let ls = [Obj.magic 1; Obj.magic object end; Obj.magic ()]
<gopiandcode>
yup, just want to avoid writing some code that is too dependent on implementation-specific behaviour
<dh`>
if I had written the compiler it wouldn't be safe to assume that an unboxed t will always fit in a cons cell that's supposed to hold a generic t, but I didn't write the compiler and I have no idea to what extent that's true
williewillus has quit [Quit: Leaving]
bobo_ has quit [Ping timeout: 245 seconds]
spip has joined #ocaml
<gopiandcode>
hmm, yes, that's what I'm worrying about; at least if I use an existential type, it would enforce that everything was boxed
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
<dh`>
only if it's wrapped up where you're sure the compiler can't devirtualize it...
cedric has joined #ocaml
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
cedric has quit [Quit: Konversation terminated!]
Serpent7776 has joined #ocaml
orbifx has joined #ocaml
Haudegen has joined #ocaml
olle has joined #ocaml
hsw has quit [Remote host closed the connection]
<olle>
Phew, long post on ocaml forum
gopiandcode has quit [Ping timeout: 245 seconds]
gopiandcode has joined #ocaml
mmh has joined #ocaml
mmh has left #ocaml [#ocaml]
mima has joined #ocaml
kakadu has joined #ocaml
OCamlPro[m] has quit [Quit: You have been kicked for being idle]
bartholin has joined #ocaml
trev has joined #ocaml
gopiandcode has quit [Read error: Connection reset by peer]
omegatron has joined #ocaml
gopiandcode has joined #ocaml
gopiandcode has quit [Ping timeout: 252 seconds]
gopiandcode has joined #ocaml
bartholin has quit [Ping timeout: 268 seconds]
bartholin has joined #ocaml
wingsorc has quit [Quit: Leaving]
bartholin has quit [Ping timeout: 268 seconds]
John_Ivan_ has joined #ocaml
<gahr>
what the opam package ocaml at version 5.1.0?
<drakonis>
is 5.1.0 out yet?
<gahr>
ocaml-base-compiler is not at 5.1.0 yet, that's why I'm wondering
<drakonis>
ah right, i know why
bartholin has joined #ocaml
<drakonis>
5.1.0 would reflect trunk
<drakonis>
since it is the n+1 version now that 5.0.0 is frozen
<octachron>
gahr, the ocaml package is a meta-package that tracks the compiler version independently of the kind of the compiler. Currently the only package that is compatible with this meta-package is ocaml-variants.5.1.0+trunk.
<gahr>
ah, that explains!
<gahr>
I missed the "any of" line in the dependencies
<gahr>
is it there so any other package can depend on the ocaml meta-package, no matter what compiler flavour you have installed?
Serpent7776 has joined #ocaml
spip has quit [Read error: Connection reset by peer]
spip has joined #ocaml
gwizon has joined #ocaml
Haudegen has joined #ocaml
romildo has joined #ocaml
bartholin has quit [Ping timeout: 240 seconds]
gwizon has quit [Quit: Lost terminal]
bartholin has joined #ocaml
cedric has joined #ocaml
hyphen has quit [Read error: Connection reset by peer]
hyphen has joined #ocaml
zebrag has joined #ocaml
hyphen has quit [Read error: Connection reset by peer]
hippoid has joined #ocaml
hyphen has joined #ocaml
Tuplanolla has joined #ocaml
hyphen has quit [Ping timeout: 252 seconds]
hyphen has joined #ocaml
romildo has quit [Quit: Leaving]
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
trev has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
cedric has quit [Quit: Konversation terminated!]
orbifx has quit [Ping timeout: 245 seconds]
hyphen has quit [Ping timeout: 255 seconds]
bartholin has quit [Ping timeout: 245 seconds]
hyphen has joined #ocaml
Serpent7776 has quit [Quit: WeeChat 1.9.1]
bartholin has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
hyphen has quit [Ping timeout: 240 seconds]
bartholin has quit [Ping timeout: 252 seconds]
hyphen has joined #ocaml
azimut has quit [Ping timeout: 268 seconds]
azimut has joined #ocaml
bartholin has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xgqt has quit [Ping timeout: 252 seconds]
xgqt has joined #ocaml
rgrinberg has joined #ocaml
Serpent7776 has joined #ocaml
emp has quit [Ping timeout: 240 seconds]
emp has joined #ocaml
azimut has quit [Remote host closed the connection]
Haudegen has joined #ocaml
azimut has joined #ocaml
azimut has quit [Remote host closed the connection]
adanwan has quit [Remote host closed the connection]
azimut has joined #ocaml
adanwan has joined #ocaml
bartholin has quit [Ping timeout: 245 seconds]
bartholin has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbifx has joined #ocaml
rgrinberg has joined #ocaml
hyphen has quit [Ping timeout: 245 seconds]
hyphen has joined #ocaml
mima has quit [Ping timeout: 245 seconds]
Haudegen has quit [Ping timeout: 245 seconds]
Haudegen has joined #ocaml
hyphen has quit [Ping timeout: 268 seconds]
hyphen has joined #ocaml
dnh has joined #ocaml
hyphen has quit [Ping timeout: 240 seconds]
hyphen has joined #ocaml
orbifx has quit [Quit: WeeChat 3.4]
waleee has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bartholin has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
bartholin has joined #ocaml
adanwan has quit [Remote host closed the connection]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]