adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Upcoming OCaml MOOC: https://huit.re/ocamlmooc | OCaml 4.03.0 release notes: http://ocaml.org/releases/4.03.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
sh0t has joined #ocaml
brunoro has joined #ocaml
Algebr` has quit [Ping timeout: 265 seconds]
brunoro has quit [Ping timeout: 260 seconds]
kevinch has joined #ocaml
smondet has quit [Ping timeout: 268 seconds]
nomicflux has joined #ocaml
Heasummn has joined #ocaml
johnelse has quit [Ping timeout: 268 seconds]
MrMateus has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
Heasummn has quit [Read error: Connection reset by peer]
eh_eff has joined #ocaml
johnelse has joined #ocaml
Heasummn has joined #ocaml
kevinch has quit [Quit: Computer has gone to sleep.]
<Heasummn> how would I add a ppx package to my executable in Oasis?
<Heasummn> I want to use sedlex
<octachron> a quick solution is to add the ppx package to the BuildDepends field
eh_eff has quit [Ping timeout: 252 seconds]
<Heasummn> you say quick solution, what would be the issue with that approach?
<libertas> hi, I don't understand why this gives a type error for the second function instead of returning bool.
<libertas> let rec equal_on_common =
<libertas> | h1::r1 -> function
<libertas> | [] -> true
<libertas> | [] -> true
<libertas> function
<libertas> | h2::r2 -> h1=h2 && equal_on_common r1 r2
<libertas> Am I missing parenthesis?
agarwal1975 has quit [Quit: agarwal1975]
<Heasummn> = binds greater than && I believe
<Heasummn> also
<Heasummn> that
<Heasummn> that's not the issue nvm
<Heasummn> you're returning a function
<Heasummn> a function that takes an arg and then matches it
<Heasummn> you probably want to math
<Heasummn> match*
<octachron> Heasummn, if I remember correctly, I have inherited dependencies issues with this solution: i.e. other package depending on the ppx-depending package inherits the ppx dependency
<Heasummn> I should be fine
<Heasummn> I'm only using a C codegen package, LLVM, and sedlex
<octachron> Heasummn, ah yes, the problem only starts to manifest if you are writing a library
<Heasummn> on that note
<Heasummn> the C codegen package I'm using is my own found of my hard drive somewhere
<Heasummn> are there any decent or common ones?
orbifx has quit [Ping timeout: 244 seconds]
<octachron> Heasummn, I don't know
<octachron> at least for generic C code generation? For binding generation, there is the ctype library.
<Heasummn> just generic C code generation
zpe has joined #ocaml
kamog` has joined #ocaml
kamog has quit [Ping timeout: 250 seconds]
brunoro has joined #ocaml
igitoor has quit [Ping timeout: 250 seconds]
igitoor has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
jerith has quit [Ping timeout: 256 seconds]
jerith has joined #ocaml
habnabit has quit [Ping timeout: 256 seconds]
_habnabit has joined #ocaml
brunoro has quit [Ping timeout: 256 seconds]
al-damiri has quit [Quit: Connection closed for inactivity]
eh_eff has joined #ocaml
eh_eff has quit [Ping timeout: 245 seconds]
igitoor has quit [Changing host]
igitoor has joined #ocaml
fraggle_ has quit [Ping timeout: 250 seconds]
fraggle_ has joined #ocaml
mfp has quit [Ping timeout: 245 seconds]
octachron has quit [Quit: Leaving]
TarVanimelde has joined #ocaml
wolfcore has quit [Ping timeout: 265 seconds]
kevinch has joined #ocaml
sh0t has quit [Remote host closed the connection]
wolfcore has joined #ocaml
kevinch has quit [Client Quit]
brunoro has joined #ocaml
wu_ng has joined #ocaml
brunoro has quit [Ping timeout: 265 seconds]
eh_eff has joined #ocaml
silver has quit [Read error: Connection reset by peer]
kevinch has joined #ocaml
eh_eff has quit [Ping timeout: 268 seconds]
nomicflux has quit [Quit: nomicflux]
ygrek has quit [Ping timeout: 260 seconds]
aggelos_ has quit [Ping timeout: 265 seconds]
aggelos_ has joined #ocaml
nomicflux has joined #ocaml
<sgronblo> Why does the ocaml compiler get confused about records with overlapping fields?
yomimono has quit [Ping timeout: 244 seconds]
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 250 seconds]
troydm has joined #ocaml
wxfdglm has joined #ocaml
eh_eff has joined #ocaml
eh_eff has quit [Ping timeout: 244 seconds]
mariano has quit [Ping timeout: 256 seconds]
jao has quit [Remote host closed the connection]
conrad4 has joined #ocaml
brunoro has joined #ocaml
eh_eff has joined #ocaml
pierpa has quit [Ping timeout: 250 seconds]
eh_eff has quit [Ping timeout: 250 seconds]
brunoro has quit [Ping timeout: 265 seconds]
Heasummn has quit [Quit: Leaving]
kevinch has quit [Quit: Computer has gone to sleep.]
conrad4 has quit [Ping timeout: 265 seconds]
milodavis has joined #ocaml
MercurialAlchemi has joined #ocaml
nomicflux has quit [Quit: nomicflux]
brunoro has joined #ocaml
TarVanimelde has quit [Read error: Connection reset by peer]
brunoro has quit [Ping timeout: 256 seconds]
ocaml174 has joined #ocaml
<ocaml174> Yo
<ocaml174> I need help with a program, is anyone on?
<ocaml174> Say I've defined a type test as "type test = Test of int"
MercurialAlchemi has quit [Ping timeout: 252 seconds]
<ocaml174> Then I "let a = Test 5"
<ocaml174> How would I then extract the primitive 5 from a?
<ocaml174> Thanks..
fluter has quit [Ping timeout: 245 seconds]
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 260 seconds]
<flux> ocaml174, let Test b = a
<flux> look at the beautiful symmetry ;)
<ocaml174> Whoa
<ocaml174> That just blew my mind
<ocaml174> I can't say I really understand how it works
<flux> the "let" is single-case pattern matching
<flux> same as "fun"
<flux> though fun matches any number of values
njpo has joined #ocaml
MercurialAlchemi has joined #ocaml
<ocaml174> Ohhhh
<ocaml174> That makes sense
<ocaml174> Thank you flux
TarVanimelde has joined #ocaml
eh_eff has joined #ocaml
Algebr` has joined #ocaml
eh_eff has quit [Ping timeout: 265 seconds]
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 244 seconds]
dmi3y has joined #ocaml
<Algebr`> companion_cube: ping
<companion_cube> pong
<Algebr`> since you know oasis, could you please make a patch that lets me grab environment varibales in _oasis
<Algebr`> if you have time to spare
<Algebr`> also put in the feature request in the oasis chat
<companion_cube> but I don't know oasis well, and I don't have time to spare on this, sorry :/
<Algebr`> kk
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jnavila has joined #ocaml
zpe has joined #ocaml
ygrek has joined #ocaml
zpe has quit [Ping timeout: 256 seconds]
TarVanimelde has quit [Read error: Connection reset by peer]
TarVanimelde has joined #ocaml
fluter has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 268 seconds]
Simn has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
dmi3y has quit [Read error: Connection reset by peer]
dmi3y has joined #ocaml
argent_smith has joined #ocaml
zpe has joined #ocaml
mpenet has joined #ocaml
AlexDenisov has joined #ocaml
ocaml174 has quit [Ping timeout: 260 seconds]
AltGr has joined #ocaml
frefity has joined #ocaml
<Algebr`> lablgtkosx has a bug in it, it won't build correctly on OSX, trivial path issue, emailed maintainer but no reply....so open a ticket on opam-repository?
brunoro has joined #ocaml
ontologiae has joined #ocaml
silver has joined #ocaml
larhat has joined #ocaml
<sgronblo> Why does the ocaml compiler get confused about records with overlapping fields?
wolfcore has quit [Ping timeout: 260 seconds]
brunoro has quit [Ping timeout: 256 seconds]
wolfcore has joined #ocaml
<companion_cube> it doesn't if you write the types explicitely
<companion_cube> but otherwise, it's because fields are used to infer the type of the value
<companion_cube> writing `a.foo` implies "a's type is the record which has the field foo"
grayswandyr has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
calculemus has quit [Ping timeout: 250 seconds]
calculemus has joined #ocaml
TarVanimelde has quit [Ping timeout: 244 seconds]
eh_eff has joined #ocaml
TarVanimelde has joined #ocaml
eh_eff has quit [Ping timeout: 265 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
mfp has joined #ocaml
blahblah has joined #ocaml
zpe has quit [Ping timeout: 244 seconds]
freusque has joined #ocaml
<reynir> hrm, unison has a 'dependency' ocaml-version < "4.03.0" :/
aantron has quit [Remote host closed the connection]
aantron has joined #ocaml
brunoro has joined #ocaml
jwatzman|work has joined #ocaml
brunoro has quit [Ping timeout: 250 seconds]
blahblah has left #ocaml [#ocaml]
freusque has quit [Quit: WeeChat 1.5]
freusque has joined #ocaml
wu_ng has quit [Read error: Connection reset by peer]
wu_ng has joined #ocaml
<companion_cube> isn't unison unmaintained nowadays?
kakadu has joined #ocaml
wu_ng has quit [Ping timeout: 260 seconds]
bbc_ is now known as bbc
<Algebr`> wondering about having caml_alloc override malloc for a C library
jbrown has quit [Quit: Leaving]
<reynir> companion_cube: it's at least in maintenance mode at best
jbrown has joined #ocaml
<reynir> On github there's a branch that supposedly fixes unison on 4.03.0, but it didn't seem to build for me
<companion_cube> I tried to use it, a while ago, but the incompatibility between versions was really annoyin
<companion_cube> g
underscore has joined #ocaml
<reynir> Yea. There's an incompatibility between 4.01 and 4.02, too
<companion_cube> they use Marshall
<companion_cube> they should not use Marshal
<companion_cube> they should have a properly defined storage format
d0nn1e has quit [Ping timeout: 260 seconds]
ousado has quit [Ping timeout: 258 seconds]
d0nn1e has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 250 seconds]
dmi3y has quit [Quit: dmi3y]
freusque has quit [Quit: WeeChat 1.5]
underscore has quit [Ping timeout: 265 seconds]
freusque has joined #ocaml
Soni has quit [Quit: Leaving]
Soni has joined #ocaml
mariano_ has joined #ocaml
underscore has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 268 seconds]
eh_eff has joined #ocaml
jao has joined #ocaml
eh_eff has quit [Ping timeout: 260 seconds]
eh_eff has joined #ocaml
dmi3y has joined #ocaml
brunoro has joined #ocaml
eh_eff has quit [Ping timeout: 260 seconds]
dreadedfrog_ has joined #ocaml
ploverblow has quit [Ping timeout: 245 seconds]
demonimin has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
jao has quit [Ping timeout: 256 seconds]
zpe has joined #ocaml
demonimin has joined #ocaml
agarwal1975 has joined #ocaml
jao has joined #ocaml
yomimono has joined #ocaml
mariano_ has quit [Quit: Konversation terminated!]
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
<sgronblo> companion_cube: but why doesnt it work if i write explicit types in an mli file?
Algebr` has quit [Ping timeout: 245 seconds]
Algebr` has joined #ocaml
<seliopou> companion_cube: any chance you'd add c stubs to ocaml-bigstring?
<companion_cube> compiling the .ml does not use the .mli afaik
<companion_cube> seliopou: what for?
<companion_cube> oh
<companion_cube> I guess that's reasonable
<companion_cube> (can you PR? :p)
<seliopou> if you do that I can get rid of the cstruct requirement in a few places
octachron has joined #ocaml
<companion_cube> erf
<companion_cube> I suppose the benchmarks show a large difference
<seliopou> (in my libs)
<seliopou> yeah i'll pr
<companion_cube> cool!
<companion_cube> (looks like cstruct is possibly BSD, from the header, that could help a lot)
<seliopou> i'm just going to replicate the file as is, so it'll be other people's copyright and maybe not your typical license
<seliopou> ISC I think
<companion_cube> ah, ISC
<companion_cube> should be fine, I think, if you keep the header
<seliopou> there are also js stubs if that's of any interest to you
<seliopou> companion_cube: upon further investigation i discovered that you're not using oasis, in which case I have no idea how to get this thing to build...
<companion_cube> hmmmmmmmm
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<companion_cube> ah right, I switched to oasis even for something simple like minisat :/
<companion_cube> it is reasonable to move to oasis, actually
<seliopou> wait let me try something
<companion_cube> the _oasis file would be trivial
TarVanimelde has quit [Quit: Leaving]
conrad4 has joined #ocaml
kevinch has joined #ocaml
<seliopou> got it to compile... not sure how to make it link...
conrad4 has quit [Ping timeout: 260 seconds]
<companion_cube> you might need to add something in META
<companion_cube> hmm wait
<companion_cube> "Extra C object files"
<companion_cube> must be -cclib or something
<companion_cube> oh, not even needed if it's just stubs
jao has quit [Disconnected by services]
jao has joined #ocaml
AlexDenisov has joined #ocaml
<seliopou> I should get back into theory so I never have to compile code ever again
<seliopou> i'll take a look later, gotta keep going with the current lib
sh0t has joined #ocaml
<companion_cube> sure
<kakadu> Folks, do we have some known approacjes to print the type of the value? (only name, without any inforamation which constuctors this type might have)
<Algebr`> use print_endline on it, compiler errors, tells you what type it is
<kakadu> No, no for debugging
<kakadu> I need something like `show`
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<kakadu> but with a type name
<kakadu> And ofcourse I want polymorphic values too
<Algebr`> maybe ocamldebug can query for it?
<kakadu> ocamldebug doesn't sound simpler than typedPPX
t4nk789 has joined #ocaml
wxfdglm has quit [Ping timeout: 250 seconds]
al-damiri has joined #ocaml
wxfdglm has joined #ocaml
dmi3y has quit [Quit: dmi3y]
kevinch has quit [Quit: Computer has gone to sleep.]
dmi3y has joined #ocaml
mpenet has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"]
nomicflux has joined #ocaml
<octachron> kakadu: the [%extension_constructor] mechanism may be the closest thing to what you want (and it is still quite afar)
kamog` has quit [Quit: ERC (IRC client for Emacs 25.1.1)]
jao has quit [Read error: Connection reset by peer]
jao has joined #ocaml
freusque has quit [Quit: WeeChat 1.5]
freusque has joined #ocaml
jao has quit [Ping timeout: 250 seconds]
copy` has joined #ocaml
shinnya has joined #ocaml
t4nk789 has quit []
freusque has quit [Ping timeout: 250 seconds]
freusque has joined #ocaml
njpo has quit [Quit: Page closed]
beginner has joined #ocaml
<beginner> how can i create new lwt threads within a lwt thread that is just a loop reading from some socket?
<hannes> beginner: Lwt.async
ryanartecona has joined #ocaml
ocaml427 has joined #ocaml
<ocaml427> assume i have defined types a and b, and want a type c to be "functions from a's to b's" what does this mean?
<kakadu> a ->b ?
ryanartecona has quit [Ping timeout: 256 seconds]
<Algebr`> type ('a, 'b) c = a -> b
<ocaml427> how would i use that? like i just tried "type c = a-> b" and it compiled, but how would i be able to create a 'thing' of type c?
MercurialAlchemi has quit [Ping timeout: 260 seconds]
<Algebr`> (fun param -> "foo") : ('a, string) c
<Algebr`> I am not clear the intent
<Algebr`> on the*
nomicflux has quit [Quit: nomicflux]
<ocaml427> like i can declare "type id = Name of string", then declare "let bob = Name "bob"" and now i have a bob object with type id
<ocaml427> can i do something similar to result in an object of type c?
<octachron> ocaml427: you can, but 'a -> 'b is a structural type, so without annotation the type checker will infer a -> b rather than c
<asmanur_> you can do though type c = C of (a -> b)
<octachron> with type annotation, you can define " let f: c = fun x -> …"
<ocaml427> at this point would it be easier to just seperately define a function that takes a type a as parameter and returns a type b, and then somehow point type c at it? is that even possible?
blackfry has quit [Ping timeout: 245 seconds]
th5 has joined #ocaml
<beginner> hannes: thanks, so i use this function o create a custom thread for every incoming connection?
jao has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
<hannes> beginner: usually I'd call accept on the server socket in a loop, and handle each client request in an asynchronous task (spawned with Lwt.async)
ryanartecona has joined #ocaml
<beginner> hannes: do you use this in a real world scenario? i was wondering if its faster that the thread reading from the socket communicates with client threads through mailbox or stream, or through waking this thread up when there is incoming messages
blackfry has joined #ocaml
<hannes> beginner: one example is https://github.com/mirleft/ocaml-tls/blob/master/lwt/examples/echo_server.ml but likely there are others (here, accept_ext is called in a loop which calls then out to async)
<beginner> hannes: thanks a lot, seems to be exactly what i was looking for
<hannes> beginner: well, this is using Tls_lwt, not Lwt on its own (Tls_lwt is the effectful layer of tls using lwt, thus it is using lwt sockets in the background)
<hannes> (lwt also has Lwt_ssl, but that uses a wrapper around openssl)
AlexDenisov has joined #ocaml
<beginner> hannes: do you have experiences using lwt for real world scenarios?
<hannes> beginner: the "real world" is where the pizza delivery comes from, this big blue room?
kevinch has joined #ocaml
AlexDenisov has quit [Client Quit]
<hannes> beginner: I run several services which use some lwt code inside it (some mirage unikernels like https://nqsb.io), I also heard that docker for mac/win32 is based on lwt, as well as the people from ahref use lwt in production
underscore has quit [Ping timeout: 250 seconds]
grayswandyr has quit [Quit: Page closed]
conrad4 has joined #ocaml
<beginner> hannes: i am curious how it performs, if lots of concurrent connections are open and have to be handled?
AlexDenisov has joined #ocaml
<Algebr`> I also use something like this, for iphones and usb tunneling of their connections to a linux machine, although that use case is about 15 devices all passing data at once
conrad4 has quit [Ping timeout: 260 seconds]
<beginner> Algebr`: you never encountered any performance issues in that setting?
nomicflux has joined #ocaml
maattdd has quit [Read error: Connection reset by peer]
jao has quit [Ping timeout: 245 seconds]
ocaml427 has quit [Ping timeout: 260 seconds]
jao has joined #ocaml
MrMateus has joined #ocaml
<Algebr`> no, it does about 6000 connections every 24 hours i think
<Algebr`> the biggest performance issue was the linux kernel itself not allocating enough memory for the usb3 controller
veggie_ has joined #ocaml
conrad4 has joined #ocaml
maattdd has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
eh_eff has joined #ocaml
conrad4 has quit [Ping timeout: 260 seconds]
eh_eff has quit [Ping timeout: 250 seconds]
noddy has quit [Ping timeout: 260 seconds]
underscore has joined #ocaml
freusque has quit [Quit: WeeChat 1.5]
nomicflux has quit [Quit: nomicflux]
jao has quit [Ping timeout: 256 seconds]
nomicflux has joined #ocaml
noddy has joined #ocaml
dmi3y has quit [Quit: dmi3y]
dmi3y has joined #ocaml
dmi3y has quit [Ping timeout: 250 seconds]
ygrek has joined #ocaml
octachron has quit [Quit: Page closed]
MercurialAlchemi has joined #ocaml
malina has joined #ocaml
smondet has joined #ocaml
pierpa has joined #ocaml
slash^ has joined #ocaml
underscore has quit [Ping timeout: 250 seconds]
larhat has quit [Quit: Leaving.]
agarwal1975 has quit [Quit: agarwal1975]
beginner has quit [Quit: Leaving]
jnavila has quit [Quit: It was time]
ryanartecona has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
Algebr` has quit [Ping timeout: 244 seconds]
underscore has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
rgrinberg has quit [Remote host closed the connection]
eh_eff has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
rgrinberg has joined #ocaml
ygrek has joined #ocaml
brunoro has quit [Ping timeout: 256 seconds]
nomicflux has quit [Quit: nomicflux]
nomicflux has joined #ocaml
ontologiae has quit [Ping timeout: 260 seconds]
malina has quit [Ping timeout: 260 seconds]
nomicflux has quit [Client Quit]
conrad4 has joined #ocaml
Algebr` has joined #ocaml
average has quit [Quit: leaving]
noddy has quit [Ping timeout: 260 seconds]
conrad4 has quit [Ping timeout: 268 seconds]
malina has joined #ocaml
veggie_ has quit [Ping timeout: 252 seconds]
wxfdglm has quit [Ping timeout: 245 seconds]
wxfdglm has joined #ocaml
tane has joined #ocaml
yomimono has quit [Ping timeout: 245 seconds]
rgrinberg has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
grinbergr has joined #ocaml
average has joined #ocaml
jao has joined #ocaml
nomicflux has joined #ocaml
noddy has joined #ocaml
ocaml825 has joined #ocaml
maattdd has quit [Remote host closed the connection]
dmi3y has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
jao has quit [Ping timeout: 256 seconds]
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 268 seconds]
AlexDenisov has joined #ocaml
tester_314 has joined #ocaml
underscore has quit [Quit: leaving]
<tester_314> hi, may I ask some help?
tester_314 has quit [Client Quit]
<smondet> tester_314: don't ask to ask, just ask :)
rgrinberg has quit [Quit: WeeChat 1.6]
<ocaml825> where do i find the sleep function in Core?
veggie_ has joined #ocaml
<grinbergr> Unix.sleep
veggie_ has quit [Ping timeout: 256 seconds]
malina has quit [Ping timeout: 260 seconds]
Soni is now known as APNG
veggie_ has joined #ocaml
eh_eff has quit [Ping timeout: 265 seconds]
<ocaml825> do lwt threads have unique ids or how can i send a message to a specific thread?
<flux> I don't really know about that, but don't you usually arrange both ends to have access to the same synchronization/message passing primitive?
sh0t has quit [Quit: Leaving]
kakadu has joined #ocaml
<aantron> ocaml825: lwt's threads are very fine-grained. you can effectively only ever send one message to an lwt thread. create the thread with Lwt.wait, this gives you an Lwt.t (thread) and Lwt.u (wakener, actually the same object in memory as the thread). call Lwt.wakeup on the wakener
<aantron> more likely you have some kind of loop or other construct that repeatedly starts these fine-grained threads
brunoro has joined #ocaml
<aantron> if so, you may still be able to use Lwt.wait to create them and pass out the wakeners, but you may want some more-disciplined structure like Lwt_stream
<aantron> and flux: and Lwt.t/Lwt.u pair is that primitive :) at least the most basic one in lwt
<ocaml825> aantron: what i would like to have is one thread that reads zeromq messages from an lwt zeromq socket and passes those to the worker threads
brunoro has quit [Ping timeout: 260 seconds]
<aantron> ocaml825: try looking at Lwt_stream (part of Lwt), or Lwt_pipe (https://github.com/c-cube/lwt-pipe, said to be better). do they help?
brunoro has joined #ocaml
<aantron> actually since it sounds like you have multiple worker threads, Lwt_stream may be a bad idea, so Lwt_pipe
<ocaml825> aantron: i want to encode the protocol as a finite state machine in each worker thread, and the main thread just distributes the incoming messages
brunoro has quit [Ping timeout: 256 seconds]
<aantron> not sure what you are doing exactly, so not sure if you just need a message queue or something more complicated
<ocaml825> basically one message queue per worker thread
<aantron> if each message queue will have one reader (worker thread), and one writer (socket thread), you can use either Lwt_stream or Lwt_pipe to pass the messages
<ocaml825> and the main thread has a map from client id to stream?
<aantron> perhaps. i dont actually know anything about zeromq, but that doesnt sound unreasonable
<ocaml825> why unreasonable?
<ocaml825> misread you
<aantron> sorry, double negative :p
<Drup> ocaml825: At this point, I just want to point out that Lwt threads are not system threads and are very light weights (usually called promises in other languages). You seem to think in term of heavy weight threads
<ocaml825> Drup: i want to use these threads just for distribution purposes, the heavy lifitng happens in separate processes
<aantron> yes, you probably have a loop that is repeatedly creating lwt threads
<aantron> in lwt e.g. each bind creates a fresh new lwt thread
<Drup> That is absolutely correct, just want to point out that you can't really think of lwt threads as an adressable long lived entity.
conrad4 has joined #ocaml
<aantron> +1
wxfdglm has quit [Ping timeout: 256 seconds]
<ocaml825> Drup: so its a bad idea to encode the message protocol as a state machine with lwts?
agarwal1975 has joined #ocaml
<Drup> Nope, that's fine
<Drup> aantron: isn't there a basical example of the classical consumer/producer architecture using Lwt_stream ?
<Drup> remember seing one, I think that it would help :)
<Armael> +1 for an example about Lwt_stream, I think that's a common pattern
<aantron> none that i see in the repo right now...
<aantron> and yes it would help.
<aantron> docsdocsdocsdocs...
<Drup> the endless struggle :p
<aantron> hehe not endless... but for Lwt, colossal :)
conrad4 has quit [Ping timeout: 268 seconds]
<aantron> not that it's hard to write one, but i wonder where you saw it
<Drup> don't remember :/
<aantron> hmm looking in mirage
ryanartecona has quit [Quit: ryanartecona]
<Drup> aantron: well, it may be quicker to write it yourself :p
<aantron> yes :) but i also like to read prior examples to see what they focused on etc.
<companion_cube> next challenge: a use case of lwt_stream that handles resources properly ;-)
<aantron> anyway can't find it
uris77 has joined #ocaml
uris77 has quit [Client Quit]
<aantron> companion_cube: what are you referring to?
<aantron> ah i think i remember :p
orbifx has joined #ocaml
orbifx has quit [Client Quit]
AltGr has left #ocaml [#ocaml]
brunoro has joined #ocaml
veggie_ has quit [Ping timeout: 245 seconds]
tane has quit [Ping timeout: 260 seconds]
brunoro has quit [Ping timeout: 245 seconds]
infinity0 has quit [Ping timeout: 250 seconds]
slash^ has quit [Read error: Connection reset by peer]
veggie_ has joined #ocaml
infinity0 has joined #ocaml
dmi3y has quit [Quit: dmi3y]
maattdd has joined #ocaml
tane has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 250 seconds]
th5 has quit []
kevinch has quit [Quit: Computer has gone to sleep.]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
brunoro has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
brunoro has quit [Ping timeout: 260 seconds]
average has quit [Quit: leaving]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
ryanartecona has joined #ocaml
kevinch has joined #ocaml
kevinch has quit [Quit: Computer has gone to sleep.]
ryanartecona has quit [Quit: ryanartecona]
kevinch has joined #ocaml
conrad4 has joined #ocaml
kevinch has quit [Quit: Computer has gone to sleep.]
conrad4 has quit [Ping timeout: 256 seconds]
malina has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 260 seconds]
veggie_ has quit [Read error: Connection reset by peer]
veggie_ has joined #ocaml
argent_smith1 has joined #ocaml
argent_smith has quit [Ping timeout: 256 seconds]
malina has quit [Ping timeout: 250 seconds]
obadz has quit [Quit: brb]
tane has quit [Quit: Leaving]
agarwal1975 has quit [Ping timeout: 244 seconds]
<MrMateus> hey anyone can help me ?
obadz has joined #ocaml
malina has joined #ocaml
Heasummn has joined #ocaml
<MrMateus> i am getting a syntax error at line of done in this example : in a while !check do <blablabla> done;;
<MrMateus> can it be a compiler erro?
<lyxia> you should paste the actual code
malina has quit [Read error: Connection reset by peer]
argent_smith1 has quit [Quit: Leaving.]
Simn has quit [Quit: Leaving]
pyx has joined #ocaml
pyx has quit [Client Quit]
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 256 seconds]
agarwal1975 has joined #ocaml
smondet has quit [Ping timeout: 252 seconds]
conrad4 has joined #ocaml
average has joined #ocaml
kakadu has quit [Remote host closed the connection]
ocaml825 has quit [Ping timeout: 260 seconds]
yomimono has joined #ocaml
conrad4 has quit [Ping timeout: 260 seconds]
d0nn1e has quit [Ping timeout: 256 seconds]