adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Current MOOC: https://huit.re/ocamlmooc | OCaml 4.04.0 release notes: http://ocaml.org/releases/4.04.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
yomimono has quit [Ping timeout: 260 seconds]
ygrek has quit [Ping timeout: 258 seconds]
jimt has joined #ocaml
orbifx has joined #ocaml
jimt_ has quit [Ping timeout: 260 seconds]
myst|fon has joined #ocaml
snhmib has quit [Quit: WeeChat 1.6]
mfp has quit [Ping timeout: 255 seconds]
maattdd has joined #ocaml
maattdd has quit [Ping timeout: 260 seconds]
richi235 has joined #ocaml
jimt_ has joined #ocaml
jimt has quit [Ping timeout: 258 seconds]
jimt has joined #ocaml
jimt_ has quit [Ping timeout: 240 seconds]
pilne has quit [Quit: Quitting!]
orbifx has quit [Ping timeout: 252 seconds]
maattdd has joined #ocaml
maattdd has quit [Ping timeout: 260 seconds]
ziyourenxiang has joined #ocaml
aubian has quit [Ping timeout: 260 seconds]
aubian has joined #ocaml
infinity0_ has joined #ocaml
infinity0_ has quit [Changing host]
infinity0 is now known as Guest67660
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
rgrinberg has quit []
rgrinberg has joined #ocaml
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
richi235 has quit [Ping timeout: 252 seconds]
spew has joined #ocaml
maattdd has joined #ocaml
maattdd has quit [Ping timeout: 260 seconds]
maattdd has joined #ocaml
AlexRussia has quit [Ping timeout: 240 seconds]
AlexRussia has joined #ocaml
maattdd has quit [Ping timeout: 252 seconds]
AlexRussia has quit [Ping timeout: 268 seconds]
AlexRussia has joined #ocaml
nomicflux has joined #ocaml
adamrbk has joined #ocaml
AlexRussia has quit [Ping timeout: 268 seconds]
AlexRussia has joined #ocaml
maattdd has joined #ocaml
AlexRussia has quit [Ping timeout: 260 seconds]
nomicflux has quit [Quit: nomicflux]
AlexRussia has joined #ocaml
maattdd has quit [Ping timeout: 268 seconds]
xaimus_ is now known as xaimus
maattdd has joined #ocaml
maattdd has quit [Ping timeout: 260 seconds]
nomicflux has joined #ocaml
jao has quit [Ping timeout: 252 seconds]
maattdd has joined #ocaml
maattdd has quit [Ping timeout: 260 seconds]
aubian is now known as Fistine
nomicflux has quit [Quit: nomicflux]
spew has quit [Quit: foobar]
AlexDenisov has joined #ocaml
adamrbk has quit [Quit: Connection closed for inactivity]
copy` has quit [Quit: Connection closed for inactivity]
psacrifice has joined #ocaml
freusque has joined #ocaml
AlexRussia has quit [Ping timeout: 252 seconds]
AlexRussia has joined #ocaml
govg has quit [Quit: leaving]
infinity0 has joined #ocaml
sz0 has joined #ocaml
psacrifice has quit [Remote host closed the connection]
psacrifice has joined #ocaml
MercurialAlchemi has joined #ocaml
AlexRussia has quit [Ping timeout: 258 seconds]
AlexRussia has joined #ocaml
TheLemonMan has joined #ocaml
argent_smith has joined #ocaml
richi235 has joined #ocaml
AltGr has joined #ocaml
kakadu has joined #ocaml
AlexRussia has quit [Ping timeout: 240 seconds]
copy` has joined #ocaml
AlexRussia has joined #ocaml
lucadje has joined #ocaml
<lucadje> hello everybody
<lucadje> i'm new in ocaml and i can't find a solution to this message
Orion3k has quit [Ping timeout: 252 seconds]
<mrvn_> It would really help if you would share this message.
mrvn_ is now known as mrvn
<mrvn> I'm using in_channel with Unix.select. Problem is that sometimes the channel has data buffered already but nothing left on the FD and then select hangs. How do I check if an in_channel has buffered data?
dhil has joined #ocaml
maattdd has joined #ocaml
<companion_cube> not sure it's possible
psacrifice has quit []
<flux> the solution is not to use Unix.select and in_channel together
<flux> same in C, btw ;)
Orion3k has joined #ocaml
orbifx-m has quit [Quit: Simple IRC: The quit option.]
maattdd_ has joined #ocaml
orbifx has joined #ocaml
<companion_cube> is it really worth using Unix.select directly, now that Lwt exists?
<mrvn> never used Lwt before
<companion_cube> well it's higher level
<mrvn> does Lwt have something to start another programm and connect it's stdin/stdout?
maattdd has quit [Ping timeout: 252 seconds]
<companion_cube> sure
<companion_cube> including the with_process* family of functions ♥
AlexRussia has quit [Ping timeout: 258 seconds]
<mrvn> How well does Lwt scale? Could I create a thread per pixel for a 4k display?
kamog has joined #ocaml
govg has joined #ocaml
<companion_cube> hum
<companion_cube> sounds like a lot
<companion_cube> I mean, it's lightweight threads
<mrvn> yeah, a couple of millions.
<companion_cube> but *that* much… not sure Unix.select would handle it
<companion_cube> you can create a couple million lwt threads, I think
<mrvn> nah, I'm not selecting on that many. The select is for worker proceses, one per core.
<TheLemonMan> select is going to break with more than 1024 fds iirc
<mrvn> TheLemonMan: no, select doesn't care. open() fails unless you raise the limit though.
<mrvn> select just takes O(n) time so it really craps out with that many FDs.
<TheLemonMan> I think it's more a matter of FD_SETSIZE being too small to hold your n
<TheLemonMan> "The value of this macro is the maximum number of file descriptors that a fd_set object can hold information about."
AlexRussia has joined #ocaml
<mrvn> TheLemonMan: true. whatever that is for your system.
<mrvn> /usr/include/linux/posix_types.h:#define __FD_SETSIZE 1024
<mrvn> You get into performance problems with select way before that though anyway.
sz0 has quit [Quit: Connection closed for inactivity]
<TheLemonMan> I think that with that many threads the lwt scheduler may be overwhelmed anyway
<companion_cube> things like libev/libevent/libuv are more modern than "raw" select, I think?
<companion_cube> TheLemonMan: depends on whether all the threads are active all the time
<TheLemonMan> they're wrappers over select/poll/kqueue/whatever
<companion_cube> well they use epoll and the likes if available, so it's better?
<mrvn> anyway, here is my problem: I want to compute a Mandelbrot fractal on many cores. So I want a pool of processes that can do some computation. Requests are send to stdin, results come from stdout. Then I want to fire requests to compute every pixel at the pool and plot the pixel when the results come in.
<mrvn> companion_cube: epoll and kqeue are O(1) so way better
<mrvn> Looking at Lwt I'm thinking combining Lwt_pool with Lwt_process. Is that the right path?
lucadje has left #ocaml [#ocaml]
<TheLemonMan> you can also fork, pin the fork to a core and use the shared memory feature
<mrvn> TheLemonMan: not for networking.
<mrvn> Where is the share memory part hidden?
<TheLemonMan> well, you said many cores and didn't really specify they are not on the same machine :)
<TheLemonMan> I mean the linux's shm* functions
<mrvn> true. Having plain processes just gives me the option to use "ssh host slave" as command.
<mrvn> TheLemonMan: ouch. Those don't play well with the Gc.
<TheLemonMan> I think you can just register those as off-heap external buffers
<mrvn> you can use BigArray.mmap but you basically have to manage them yourself.
<TheLemonMan> disclaimer, I know little to none about ocaml's gc implementation, so take my advice with a grain of salt
<mrvn> Or lots of C stubs if you want structured data and not just an array.
<TheLemonMan> if you only need to store pixels then an array of uint32 is enough
<companion_cube> mrvn: yes, lwt_pool is cool
<mrvn> TheLemonMan: if only. I need (float * float * int) at the least
<companion_cube> mrvn: for display, wouldn't you be better of with 3 arrays instead?
<companion_cube> struct-of-arrays
<companion_cube> that would play nicely with bigarray
<mrvn> companion_cube: I don't see anything getting called when a pool needs to shut down. How do I clean up the processes when they aren't needed anymore?
<mrvn> companion_cube: struct of arrays kills cache locality though.
<mrvn> What do I use as "generator" to produce the request to compute a pixel? It's probably not a good idea to create a few million Lwt.t at once.
<TheLemonMan> mrvn, have you read the recent article about how reddit built /r/place ? they've used a redis instance to store all the pixels
<mrvn> no, url?
mfp has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ygrek has joined #ocaml
freusque has quit [Quit: WeeChat 1.7]
<mrvn> companion_cube: How do I do pipelineing with Lwt_pool? I want to send 10 requests to each worker before it blocks.
<companion_cube> the way I use it is: conceptually, I do everything in parallel (e.g. map a big list in parallel using Lwt_list.map_p)
<companion_cube> but each task needs to acquire a lwt_pool with 10 elements
<companion_cube> so in practice, only 10 tasks are active at the same time
AlexRussia has quit [Ping timeout: 258 seconds]
<mrvn> companion_cube: That's a different problem. I want 10 items to share the same worker.
<mrvn> Some buffering against network latency.
<companion_cube> I'd use a kind of bounded queue, with size 10
<mrvn> Maybe I can make a Lwt_pool with 10 elements that all share the same worker process each.
orbifx has quit [Ping timeout: 260 seconds]
ciniglio has quit [Ping timeout: 246 seconds]
cranmax has joined #ocaml
orbifx has joined #ocaml
TheLemonMan has quit [Quit: ]]
<mrvn> companion_cube: "Lwt_stream.create_bounded 10" looks like a bounded queue.
orbifx has quit [Ping timeout: 240 seconds]
copy` has quit [Quit: Connection closed for inactivity]
mengu has joined #ocaml
dhil has quit [Ping timeout: 258 seconds]
sillyotter has joined #ocaml
AlexDenisov has joined #ocaml
argent_smith has quit [Quit: Leaving.]
adamrbk has joined #ocaml
argent_smith has joined #ocaml
demonimin has quit [Remote host closed the connection]
dhil has joined #ocaml
demonimin has joined #ocaml
<companion_cube> something like that
<companion_cube> although I'm not that fond of lwt_stream
<companion_cube> but there is no consensus on what the good solution would be
sillyotter has quit [Quit: WeeChat 1.4]
jao has joined #ocaml
AlexRussia has joined #ocaml
snhmib has joined #ocaml
jao has quit [Ping timeout: 260 seconds]
orbifx has joined #ocaml
cranmax has quit [Quit: Connection closed for inactivity]
yomimono has joined #ocaml
orbifx has quit [Ping timeout: 240 seconds]
yomimono has quit [Ping timeout: 258 seconds]
freusque has joined #ocaml
silver has joined #ocaml
dhil has quit [Ping timeout: 258 seconds]
freusque has quit [Quit: WeeChat 1.7]
octachron has joined #ocaml
arquebus has joined #ocaml
demonimin_ has joined #ocaml
dhil has joined #ocaml
freusque has joined #ocaml
demonimin has quit [Ping timeout: 260 seconds]
arquebus has quit [Client Quit]
arquebus has joined #ocaml
adamrbk is now known as adam123
adam123 is now known as ajdkrnxjzn
govg has quit [Ping timeout: 252 seconds]
ajdkrnxjzn has quit []
yomimono has joined #ocaml
AlexDeni_ has joined #ocaml
AlexDenisov has quit [Ping timeout: 255 seconds]
AlexDeni_ has quit [Remote host closed the connection]
AlexDenisov has joined #ocaml
kakadu has quit [Remote host closed the connection]
arquebus has quit [Quit: Leaving]
Guest82186 has quit [Ping timeout: 240 seconds]
sh0t has joined #ocaml
orbifx has joined #ocaml
TheLemonMan has joined #ocaml
hongbo_ has joined #ocaml
yomimono has quit [Ping timeout: 260 seconds]
govg has joined #ocaml
yomimono has joined #ocaml
shinnya has joined #ocaml
ziyourenxiang has quit [Quit: Leaving]
orbifx has quit [Ping timeout: 240 seconds]
myst|fon has quit [Quit: Connection closed for inactivity]
myst|fon has joined #ocaml
adi_____ has quit []
jabroney has joined #ocaml
adi_____ has joined #ocaml
jbrown has joined #ocaml
nomicflux has joined #ocaml
AlexDenisov has quit [Remote host closed the connection]
AlexDenisov has joined #ocaml
ryanartecona has joined #ocaml
jbrown has quit [Ping timeout: 260 seconds]
cranmax has joined #ocaml
ygrek has quit [Ping timeout: 268 seconds]
dhil has quit [Ping timeout: 252 seconds]
jbrown has joined #ocaml
jabroney1 has joined #ocaml
jabroney has quit [Read error: Connection reset by peer]
menasw has quit []
menasw has joined #ocaml
sz0 has joined #ocaml
jbrown has quit [Ping timeout: 258 seconds]
<mrvn> Anyone know something to write out a video given a stream of raw images?
yomimono has quit [Ping timeout: 252 seconds]
<flux> ffmpeg can convert ie. yuv420p to mp4
<flux> I also have bindings.. but they are broken :)
<mrvn> I'm looking at https://github.com/savonet/ocaml-ffmpeg at the moment.
dhil has joined #ocaml
<flux> I don't think it supports writing video files at all
<mrvn> yeah, seems to only have bindings to decode video/sound.
<flux> this thing _does_ write working mpeg4 files, though: https://github.com/eras/webcamviewer
yomimono has joined #ocaml
<flux> but it's the new and revised ffmpeg bindings that don't work :)
<mrvn> flux: thanks. looks good. ffmpeg/ffmpegTest.ml
<mrvn> is pretty much all I need.
<flux> right, forgot about that. yeah, so the only problem left is compiling it for your project :)
jbrown has joined #ocaml
<TheLemonMan> I love how the compiler errors give you the character span where the error is instead of just showing the part of the code that's wrong
<mrvn> TheLemonMan: the toplevel does when it fits on the screen.
<TheLemonMan> I don't see why the compiler doesn't do that though
ygrek has joined #ocaml
<mrvn> easier for editors to jump to the right place
<mrvn> What bugs me is that the character span counts <tab> as 1 space and emacs doesn't.
freusque has quit [Quit: WeeChat 1.7]
<flux> I guess that should be fixed in emacs :). also, please do, I've found it annoying as well :)
AltGr has left #ocaml [#ocaml]
shinnya has quit [Ping timeout: 258 seconds]
jbrown has quit [Ping timeout: 240 seconds]
orbifx has joined #ocaml
ygrek has quit [Ping timeout: 268 seconds]
SublimeCaML has joined #ocaml
<SublimeCaML> Trying to get Sublime Text 2 to highlight OCaml source. Any help on where I could find the .tmLanguage files already premade?
<SublimeCaML> Found something at https://packagecontrol.io/packages/OCaml for any others looking
SublimeCaML has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
jabroney1 has left #ocaml [#ocaml]
maattdd has joined #ocaml
maattdd_ has quit [Ping timeout: 258 seconds]
spew has joined #ocaml
cranmax has quit [Quit: Connection closed for inactivity]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<pirbo> Hi, I try to cross compile from debian to windows the program `let () = Lwt_main.run (Lwt_io.print "Hello\n")` using https://github.com/whitequark/opam-cross-windows.
<pirbo> The result is `Fatal error: exception Invalid_argument("Lwt_unix.on_signal: unavailable signal")`
<pirbo> (using wine but also in a real windows) any insight about how I can try to debug that?
copy` has joined #ocaml
fraggle_ has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
ryanartecona has joined #ocaml
jao has joined #ocaml
dhil has quit [Ping timeout: 260 seconds]
<pirbo> Just so you know if you want to help me. I tried to upgrade from lwt.2.6.0 to 2.7.1 (see https://github.com/pirbo/opam-cross-windows) and the error is now `err:seh:setup_exception stack overflow 3456 bytes in thread 0024 eip 00007f2096b61545 esp 0000000000700880 stack 0x700000-0x701000-0x1700000`
ryanartecona has quit [Quit: ryanartecona]
orbifx has quit [Ping timeout: 240 seconds]
ocml_ has joined #ocaml
hongbo_ has quit [Quit: Connection closed for inactivity]
<copy`> This is pretty cool: https://github.com/reynir/ocp-index-top/
jbrown has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
richi235 has quit [Ping timeout: 255 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
AlexRussia has quit [Ping timeout: 258 seconds]
AlexRussia has joined #ocaml
richi235 has joined #ocaml
yomimono has quit [Ping timeout: 240 seconds]
dhil has joined #ocaml
orbifx has joined #ocaml
AlexDenisov has joined #ocaml
orbifx has quit [Ping timeout: 240 seconds]
Xadnem has joined #ocaml
maarhart has joined #ocaml
maarhart has quit [Client Quit]
kamog has quit [Remote host closed the connection]
ygrek has joined #ocaml
silver has quit [Quit: rakede]
argent_smith has quit [Quit: Leaving.]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pilne has joined #ocaml
Xadnem has quit [Ping timeout: 260 seconds]
octachron has quit [Quit: Leaving]
ryanartecona has joined #ocaml
kakadu has joined #ocaml
Xadnem has joined #ocaml
Xadnem has quit [Client Quit]
richi235 has quit [Ping timeout: 240 seconds]
richi235 has joined #ocaml
strykerkkd has joined #ocaml
nomicflux has quit [Quit: nomicflux]
orbifx has joined #ocaml
orbifx has quit [Ping timeout: 252 seconds]
MercurialAlchemi has quit [Ping timeout: 260 seconds]
sh0t has quit [Remote host closed the connection]
ryanartecona has quit [Quit: ryanartecona]
kakadu has quit [Remote host closed the connection]
ocml_ has quit [Quit: Page closed]
snhmib has quit [Ping timeout: 252 seconds]
<vmonteco> Hello!
<mengu> hello vmonteco
<vmonteco> I have a little question, I made a custom type (string * change_numbers) where change_numbers is a record. But I get a syntax error when I try to define this custom type by directly putting the record in the definition (like (string * {s1 : int; s2: int;})) I get a syntax error, why?
<Drup> vmonteco: because you can't define records like, you need to give them a name
dhil has quit [Read error: No route to host]
strykerkkd has quit [Quit: Leaving]
richi235 has quit [Ping timeout: 260 seconds]
jao has quit [Remote host closed the connection]
jao has joined #ocaml