adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.06.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.06/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
groovy2shoes has quit [Ping timeout: 246 seconds]
cbot has joined #ocaml
weird_error has quit [Quit: weird_error]
ctrlsbstr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
weird_error has joined #ocaml
weird_error has quit [Quit: weird_error]
StrykerKKD has quit [Quit: Konversation terminated!]
pierpal has joined #ocaml
kleimkuhler has joined #ocaml
pierpal has quit [Ping timeout: 264 seconds]
zv has quit [Ping timeout: 268 seconds]
zv has joined #ocaml
kleimkuhler has quit [Quit: kleimkuhler]
mfp_ has quit [Ping timeout: 265 seconds]
zmt00 has quit [Quit: Leaving]
zmt00 has joined #ocaml
zmt00 has quit [Remote host closed the connection]
zmt00 has joined #ocaml
<Drup> TIL both the jpeg and the png file formats have comment sections where you can put arbitrary text
<discord1> <Perry> I had no idea.
gtrak has joined #ocaml
ziyourenxiang has quit [Ping timeout: 260 seconds]
gtrak has quit [Ping timeout: 248 seconds]
FreeBirdLjj has joined #ocaml
cslqj has joined #ocaml
cslqj has quit [Remote host closed the connection]
cslqj has joined #ocaml
<Drup> and GIF as well
<Drup> However, GIF requires the end of the format to be the end of the file, which is NotFun™
cslqj has quit [Ping timeout: 256 seconds]
gtrak has joined #ocaml
kleimkuhler has joined #ocaml
tormen_ has joined #ocaml
shinnya has quit [Ping timeout: 240 seconds]
tormen has quit [Ping timeout: 255 seconds]
gtrak has quit [Ping timeout: 240 seconds]
_xvilka_ has quit [Ping timeout: 256 seconds]
_xvilka_ has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 276 seconds]
pierpal has joined #ocaml
cobreadmonster has quit [Quit: Connection closed for inactivity]
tarptaeya has joined #ocaml
exarkun has quit [Read error: Connection reset by peer]
kleimkuhler has quit [Quit: kleimkuhler]
exarkun has joined #ocaml
govg has quit [Ping timeout: 248 seconds]
jbrown has quit [Ping timeout: 260 seconds]
cslqj has joined #ocaml
cslqj has quit [Ping timeout: 240 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
shinnya has joined #ocaml
<_xvilka_> hi
<_xvilka_> are there any examples of jbuilder/dune alternative dependencies?
<_xvilka_> no explanation what is <target-filename> and <filename> in those (select forms)
<_xvilka_> nvm, figured out
cbot has quit [Quit: Leaving]
muelleme has joined #ocaml
<_xvilka_> one more question, I have comparisons like buf = "\x00", but since OCaml 4.06 they are illegal
<_xvilka_> is there any way to define that constant "\x00" as bytes instead?
<_xvilka_> some prefix or so?
<on_ion> hmm i just saw some in ocaml compiler code ...
<on_ion> @ bottom, maybe syntax is different
shinnya has quit [Ping timeout: 240 seconds]
dedgrant_ has quit [Read error: Connection reset by peer]
loli has joined #ocaml
shinnya has joined #ocaml
<_xvilka_> on_ion: no, it just extracts char by char
<on_ion> it?
<_xvilka_> seems the only was is to convert constant to bytes with Bytes.of_string and pray that compiler will optimize this
jimmyrcom_ has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
jimmyrcom_ has joined #ocaml
muelleme has quit [Ping timeout: 268 seconds]
ziyourenxiang has joined #ocaml
tarptaeya has quit [Remote host closed the connection]
tarptaeya has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
unyu has quit [Ping timeout: 255 seconds]
unyu has joined #ocaml
jimmyrcom_ has quit [Ping timeout: 240 seconds]
<flux[m]> it seems there's no bytes literal
<flux[m]> I doubt it optimizes it, though, but Bytes.unsafe_of_string is no-op
<flux[m]> but actually it might not be safe
<flux[m]> "For example, string literals are implicitly shared by the compiler, so you never uniquely own them."
<flux[m]> (at the bottom)
<_xvilka_> interesting
<flux[m]> I wonder though if it truly is unsafe. surely let a = "bar" and let b = "bar" cannot be so that both a and b mutate the same string?
<_xvilka_> so I think worth adding an issue then for creating new type of the bytes constants then
<_xvilka_> but github.com/ocaml/ocaml has issue tracker disabled
<flux[m]> I think a syntax for byte literals would be the appropriate solution
<flux[m]> s/byte/bytes/
<flux[m]> Unless "foo" will be that syntax, in which case strings should maybe have one that truly copies the literal
<_xvilka_> flux[m]: yes
<flux[m]> I sort of can't imagine this discussion wouldn't have been had back when 'bytes' was introduced, though..
<flux[m]> And if so, I wonder what were the results :)
<_xvilka_> I am opening a bug, lets see what will happen
<flux[m]> hmm
<flux[m]> actually it's been a time back since I've written ocaml and I think I got confused
<_xvilka_> decades of working on FOSS and with FOSS I learned one thing - "in case of doubt open a bug"
<flux[m]> I think I mixed up bytes and strings regarding mutability :-).
<_xvilka_> bytes are mutable, strings are not
<_xvilka_> but in this case the problem is still the same
<flux[m]> so setting myself on track, string is the immutable one, so obviously Bytes.unsafe_of_string "helo" is going to be unsafe, and there's no fast way to do it than Bytes.of_string "helo" and it cannot be optimized to be fast
<flux[m]> consider let foo () = let bytes = Bytes.of_string "a" in Bytes.set bytes 0 (Char.chr (Char.code (Bytes.get bytes 0) + 1)); Bytes.get bytes 0
<flux[m]> there's no way to avoid copying the string "a" for constructing the bytes
<flux[m]> (btw, not a beatiful sight that incrementing..)
<_xvilka_> maybe a poorly worded but issue created https://caml.inria.fr/mantis/view.php?id=7797
<_xvilka_> by the way, totally unrelated. Working on distributed application on zeromq bus. Every request/answer has some ID (request/answer in semantic meaning, they can exist on top of many different zeromq messages, like fragmented). Currently (at the early prototype stage) I just generate those IDs randomly. But there is still a chance of collision. What is the best solution to solve the uniqueness problem in
<_xvilka_> case of the big cluster of distributed workers?
orbifx has joined #ocaml
<zozozo> _xvilka_: hash the contents of the message ?
<_xvilka_> zozozo: hmm, you mean of the first message in the whole chain of request/answer? yeah, sounds like a good idea
<zozozo> or alternatively, hash the MAC or other unique hardware id + an increasing integer for each message
<_xvilka_> zozozo: no, hardware id is no go - there can be a cases of multiple workers at the same machine if the machine is powerful enough
<zozozo> hardware id + process id + unique increasgin integer ? though it becomes quite complex, :p
groovy2shoes has joined #ocaml
tarptaeya has quit [Quit: Konversation terminated!]
<_xvilka_> zozozo: I think your idea of hashing the message is good enough for my usecase
<zozozo> ^^
mfp_ has joined #ocaml
argent_smith has joined #ocaml
ChristopheT has joined #ocaml
orbifx has quit [Ping timeout: 255 seconds]
orbifx has joined #ocaml
zolk3ri has joined #ocaml
jnavila has joined #ocaml
Haudegen has joined #ocaml
weird_error has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
jnavila has joined #ocaml
silver has joined #ocaml
mk9 has joined #ocaml
mk9 has quit [Ping timeout: 256 seconds]
jnavila has quit [Ping timeout: 255 seconds]
malina has joined #ocaml
malina has quit [Quit: Throwing apples of Montserrat]
malina has joined #ocaml
bartholin has quit [Quit: Leaving]
mk9 has joined #ocaml
dhil has joined #ocaml
jnavila has joined #ocaml
malina has quit [Ping timeout: 276 seconds]
pierpal has quit [Read error: Connection reset by peer]
mk9 has quit [Quit: mk9]
<_xvilka_> I have a webserver which translates JSON web requests into the ZeroMQ. So it has two main threads - one is for the Opium and another for handling messaging. I am using Lwt. Is it possible to create a waiter thread in one function called from the web-server (Opium) thread and then wait for the message in the message-handling thread
<_xvilka_> here is the code I am working on https://paste.fedoraproject.org/paste/RlFZohbcPrlWzqGUmBTRgA/raw
<_xvilka_> it is not compilable yet, but you can get the idea
pierpal has joined #ocaml
<discord1> <rizo> I usually use Lwt_stream for that. It gives you exactly what you described, I think. I remember seeing mentioned that Lwt_stream has some design issues and might be changed/replaced in the future, though.
webchat192 has joined #ocaml
<discord1> <rizo> You can also take a look at the lwt-pipe package.
jimmyrcom_ has joined #ocaml
webchat192 has quit [Ping timeout: 260 seconds]
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
jimmyrcom_ has quit [Ping timeout: 240 seconds]
malina has joined #ocaml
<_xvilka_> @rizo: aha, thx
pierpal has quit [Read error: Connection reset by peer]
orbifx has quit [Ping timeout: 260 seconds]
mk9 has joined #ocaml
tarptaeya has joined #ocaml
exarkun has quit [Ping timeout: 248 seconds]
dhil has quit [Ping timeout: 248 seconds]
pierpal has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
exarkun has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
<seliopou> hannes that patch for bigstringaf looks like it should work?
pierpal has joined #ocaml
nullifidian has quit [Remote host closed the connection]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
pierpal has quit [Ping timeout: 240 seconds]
sh0t has joined #ocaml
jimmyrcom_ has joined #ocaml
elfring has joined #ocaml
cslqj has joined #ocaml
olopierpa[m] has quit [Ping timeout: 256 seconds]
hcarty[m] has quit [Ping timeout: 256 seconds]
olopierpa[m] has joined #ocaml
hcarty[m] has joined #ocaml
spectrumgomas[m] has quit [Ping timeout: 256 seconds]
mrallen1 has quit [Ping timeout: 256 seconds]
mrallen1 has joined #ocaml
pierpal has joined #ocaml
spectrumgomas[m] has joined #ocaml
ctrlsbstr has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
nullifidian has joined #ocaml
Haudegen has joined #ocaml
pierpal has quit [Ping timeout: 268 seconds]
pierpal has joined #ocaml
BitPuffin has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
jbrown has joined #ocaml
shinnya has quit [Ping timeout: 240 seconds]
sh0t has quit [Ping timeout: 248 seconds]
pierpal has joined #ocaml
ianconnolly_ has quit [Remote host closed the connection]
terrorjack has quit [Remote host closed the connection]
ianconnolly_ has joined #ocaml
picolino has quit [Ping timeout: 240 seconds]
orbifx has joined #ocaml
terrorjack has joined #ocaml
picolino has joined #ocaml
mk9 has quit [Quit: mk9]
Haudegen has quit [Ping timeout: 240 seconds]
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
Haudegen has joined #ocaml
ctrlsbstr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bartholin has joined #ocaml
kleimkuhler has joined #ocaml
ctrlsbstr has joined #ocaml
kleimkuhler_ has joined #ocaml
kleimkuhler has quit [Ping timeout: 240 seconds]
cslqj has quit [Remote host closed the connection]
cslqj has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]
kleimkuhler_ has quit [Quit: kleimkuhler_]
jnavila has joined #ocaml
kleimkuhler has joined #ocaml
orbifx has quit [Quit: WeeChat 2.0.1]
cslqj has quit [Remote host closed the connection]
cslqj has joined #ocaml
cslqj has quit [Remote host closed the connection]
cslqj has joined #ocaml
cslqj has quit [Remote host closed the connection]
cslqj has joined #ocaml
cslqj has quit [Remote host closed the connection]
cslqj has joined #ocaml
cslqj has quit [Ping timeout: 240 seconds]
ziyourenxiang has quit [Ping timeout: 276 seconds]
muelleme has joined #ocaml
sh0t has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
Haudegen has joined #ocaml
kakadu has left #ocaml ["Konversation terminated!"]
weird_error has quit [Quit: weird_error]
hratt has joined #ocaml
weird_error has joined #ocaml
<hratt> hey can someone here help explain the syntax of the `parser' function?
spew has joined #ocaml
<hratt> im trying to debug a file for a keyMerging utility but know 0 ocaml
Haudegen has quit [Ping timeout: 256 seconds]
<spew> hratt: now is your opportunity to learn
weird_error has quit [Quit: weird_error]
<hratt> im trying i cant find the syntax explained somewhere and its just this file out of around a hundred
ctrlsbstr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<thizanne> hratt: that's quite old
<hratt> ye the thing is using camlp4 natively but i switched it out for cppo as i know no other ways
<thizanne> alrhough that will probably be quite hard ot debug if you know 0 ocaml
<discord1> <Perry> cppo has nothing to do with camlp4...
muelleme has quit [Ping timeout: 240 seconds]
pmetzger has joined #ocaml
spew has quit [Ping timeout: 256 seconds]
sh0t has quit [Ping timeout: 256 seconds]
sh0t has joined #ocaml
gpietro has joined #ocaml
sh0t has quit [Read error: Connection reset by peer]
<hratt> I was meaning this ocaml-cppo https://github.com/mjambon/cppo
<hratt> by the way the syntax error was using ` | [< ` after the parser function call removed the bar alls fine - thank you very much @thizanne helped a lot
<thizanne> that's not a function, that's a keyword
<thizanne> camlp4 provides a syntax extension to ocaml that adds this keyword and the odd matching stuff
loli has quit [Quit: WeeChat 2.1]
<octachron> hratt, you cannot replace camlp4 by cppo except for some very basic use cases of camlp4, and parser is not amongst those use cases
<hratt> ive switched back but i realise now
<hratt> i think it was like perl where most cpan modules had 60000000 others cx
gpietro has quit [Remote host closed the connection]
gpietro has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
loli has joined #ocaml
kakadu has joined #ocaml
<pmetzger> If you don't know a language, it's probably not a good idea to start randomly replacing things with other things.
gpietro has quit [Ping timeout: 256 seconds]
pierpal has quit [Ping timeout: 256 seconds]
pierpal has joined #ocaml
pierpal has quit [Client Quit]
pierpal has joined #ocaml
Haudegen has joined #ocaml
exarkun has quit [Read error: Connection reset by peer]
pierpal has quit [Remote host closed the connection]
exarkun has joined #ocaml
jbrown has quit [Quit: Leaving]
kleimkuhler has quit [Quit: kleimkuhler]
kleimkuhler has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
pierpal has joined #ocaml
ctrlsbstr has joined #ocaml
Haudegen has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
hratt has quit [Quit: leaving]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
muelleme has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
malina has quit [Read error: Connection reset by peer]
BitPuffin has quit [Remote host closed the connection]
muelleme has quit [Ping timeout: 256 seconds]
pierpal has joined #ocaml
elfring has quit [Quit: Konversation terminated!]
spew has joined #ocaml
tane has joined #ocaml
tane has quit [Quit: Leaving]
ctrlsbstr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jnavila has quit [Read error: Connection reset by peer]
sz0 has quit [Quit: Connection closed for inactivity]
malina has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
spew has quit [Ping timeout: 256 seconds]
argent_smith has quit [Quit: Leaving.]
gtrak has joined #ocaml
kakadu has quit [Remote host closed the connection]
gtrak has quit [Ping timeout: 264 seconds]
ziyourenxiang has joined #ocaml
gtrak has joined #ocaml
FreeBirdLjj has joined #ocaml
gtrak has quit [Ping timeout: 264 seconds]
shinnya has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
Bronsa` has joined #ocaml
malina has quit [Quit: Throwing apples of Montserrat]
ChristopheT has quit [Ping timeout: 260 seconds]