Leonidas changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.13.0 released: https://ocaml.org/releases/4.13.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
<d_bot> <Et7f3> Btw your not_ doesn't need type x i think
<d_bot> <EduardoRFS> nope it doesn't, but merlin doesn't add a warning, I only clean them when the compiler tells me
ns12 has quit [Quit: bye]
ns12 has joined #ocaml
Techcable has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
unyu has quit [Ping timeout: 268 seconds]
<dh`> growl
<dh`> I'm fixing up an old library of C bindings and it's full of alloc_string for things that are now Bytes.t
<dh`> but there's no alloc_bytes in the FFI that I can find
<dh`> what is one supposed to use?
<williewillus> dh`: the same thing, apparently. searching in the tree: https://github.com/ocaml/ocaml/blob/cce52acc7c7903e92078e9fe40745e11a1b944f0/runtime/str.c#L72-L79
<williewillus> that's where Bytes.make leads to
<dh`> hmm ok thanks
<williewillus> my guess is that they are represented the same way in the runtime
<williewillus> the types are just distinguished at the ocaml level
<dh`> yeah, it makes sense, especially since distinguishing the two has been a multiyear incremental effort
<dh`> but I sort of expected an alloc_bytes to appear in the ffi anyway even if it's the same under the covers
<dh`> since Bytes.t happens a lot with external functions
<dh`> and it's not set up to be at all easily checkable :-/
<dh`> (so the change should be made when you need to change the signatures of the external bindings)
<dh`> oh well, this is why C has #define
<dh`> that reminds me, I have a related question (that is not tonight's project)
<dh`> what's the recommended interface for storing arbitrary ocaml values in a database (that is, preferably efficiently and in binary)
<dh`> (a nosql database, so converting to sql types is neither an issue nor the solution)
unyu has joined #ocaml
Everything has quit [Quit: leaving]
Tuplanolla has quit [Quit: Leaving.]
<dh`> hmm, guess nobody knows :-p
<dh`> anyway, I guess the other question is: is it expected that in the long term converting bytes back and forth to string is free?
<dh`> (so string should be treated like const in C, that is, you can't change this but someone else might)
waleee has quit [Ping timeout: 250 seconds]
xd1le has joined #ocaml
<d_bot> <Et7f3> One way would be marshall but when your update OCaml compiler you will have to convert all values (unserialise in other form like json and serialize again). Or just go the binprot/protobuf root
rgrinberg has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
<d_bot> <leviroth> `Bytes.{to,of}_string` are certainly not free.
<d_bot> <leviroth> They both involve copying the underlying byte sequence.
<d_bot> <Anurag> `unsafe_(to/from)_string` could be an option (with due care)
rgrinberg has quit [Read error: Connection reset by peer]
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dh`> ok, so it _does_ copy each time?
spip has joined #ocaml
Guest8168 has quit [Ping timeout: 256 seconds]
spip is now known as Guest6828
<d_bot> <rgrinberg> The unsafe versions do not make copies
<dh`> hmm, unsafe_blit_string apparently exists but isn't in the documentation
<dh`> bah
<dh`> what's the recommended way to match bytes against string literals?
Colt_ has joined #ocaml
Colt has quit [Ping timeout: 268 seconds]
mbuf has joined #ocaml
<dh`> Error: Error on dynamically loaded library: /usr/pkg/lib/ocaml/site-lib/stublibs/dllgraphics_stubs.so: /usr/pkg/lib/ocaml/site-lib/stublibs/dllgraphics_stubs.so: Undefined PLT symbol "caml_process_pending_signals" (symnum = 9)
<dh`> anyone know what might be up with that? the goog doesn't
<dh`> recompiling ocaml-graphics didn't make it go away
<dh`> (ocaml 4.11.2)
<dh`> ah, silly mistake, found it
shawnw has joined #ocaml
vb has quit [Ping timeout: 240 seconds]
vb has joined #ocaml
gravicappa has joined #ocaml
rgrinberg has joined #ocaml
Colt_ is now known as Colt
Guest6828 has quit [Ping timeout: 240 seconds]
Guest6828 has joined #ocaml
jlrnick has joined #ocaml
rgrinberg has quit [Read error: Connection reset by peer]
rgrinberg has joined #ocaml
xiongxin has joined #ocaml
hackinghorn has quit [Ping timeout: 268 seconds]
slothby has quit [Quit: brb ... maybe]
mbuf has quit [Quit: Leaving]
hackinghorn has joined #ocaml
szkl has joined #ocaml
hackinghorn has quit [Quit: Leaving]
rgrinberg has quit [Read error: Connection reset by peer]
rgrinberg has joined #ocaml
Tuplanolla has joined #ocaml
Guest6828 has quit [Quit: Konversation terminated!]
hackinghorn has joined #ocaml
spip has joined #ocaml
spip is now known as Guest6142
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Haudegen has joined #ocaml
KvL has joined #ocaml
bartholin has joined #ocaml
<d_bot> <octachron> @EduardoRFS allowing constraints on locally abstract type is on the type system (implicit) todo list: it would also also allow to stick with `type a. ... ` for all use cases of `'a. ...` .
xiongxin has quit [Ping timeout: 240 seconds]
xiongxin1 has joined #ocaml
xiongxin1 is now known as xiongxin
mro has joined #ocaml
<d_bot> <Et7f3> I think unsafe conversion and pattern match
mro has quit [Remote host closed the connection]
<dmbaturin> Is there a specific reason why Camomile doesn't provide UTF8.sub and similar functions?
waleee has joined #ocaml
xiongxin has quit [Quit: xiongxin]
KvL has quit [Ping timeout: 256 seconds]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
dalek-caan has joined #ocaml
<dmbaturin> Also, anyone knows what's the exact issue with Camomile and PPC64?
mro has joined #ocaml
mro has quit [Remote host closed the connection]
Colt has quit [Remote host closed the connection]
Colt has joined #ocaml
Colt has quit [Remote host closed the connection]
Colt has joined #ocaml
Colt has quit [Remote host closed the connection]
Colt has joined #ocaml
Colt has quit [Remote host closed the connection]
Colt has joined #ocaml
Colt has quit [Read error: Connection reset by peer]
Everything has joined #ocaml
mro has joined #ocaml
Colt has joined #ocaml
mro has quit [Remote host closed the connection]
jlrnick has quit [Ping timeout: 256 seconds]
xd1le has quit [Quit: xd1le]
spip has joined #ocaml
Guest6142 has quit [Ping timeout: 268 seconds]
spip is now known as Guest5422
gravicappa has quit [Ping timeout: 260 seconds]
reynir has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Remote host closed the connection]
Anarchos has joined #ocaml
Anarchos has quit [Ping timeout: 240 seconds]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bartholin has quit [Quit: Leaving]
dalek-caan has quit [Quit: dalek-caan]