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
maattdd has joined #ocaml
maattdd has quit [Ping timeout: 260 seconds]
zpe has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
jimmyrcom_ has quit [Ping timeout: 256 seconds]
jimmyrcom has quit [Ping timeout: 256 seconds]
troydm has quit [Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset]
maattdd has joined #ocaml
ziyourenxiang has joined #ocaml
maattdd has quit [Ping timeout: 260 seconds]
infinity0_ has joined #ocaml
infinity0_ has quit [Changing host]
infinity0 has quit [Killed (verne.freenode.net (Nickname regained by services))]
infinity0 has joined #ocaml
maattdd has joined #ocaml
atchoum has quit [Read error: Connection reset by peer]
maattdd has quit [Ping timeout: 256 seconds]
zpe has quit [Ping timeout: 256 seconds]
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
zpe has joined #ocaml
dtornabene has joined #ocaml
jao has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
pierpa has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
TheRuralJuror has quit [Read error: Connection reset by peer]
zpe has quit [Read error: No route to host]
zpe has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
zpe has quit [Ping timeout: 260 seconds]
zpe has joined #ocaml
zmt00 has quit [Quit: Leaving]
zmt00 has joined #ocaml
spew has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
spew has quit [Ping timeout: 260 seconds]
govg has joined #ocaml
mfp has quit [Ping timeout: 248 seconds]
zpe has quit [Ping timeout: 256 seconds]
barcabuona has quit [Ping timeout: 256 seconds]
ziyourenxiang has quit [Ping timeout: 256 seconds]
zpe has joined #ocaml
jimmyrcom has joined #ocaml
jimmyrcom_ has joined #ocaml
nomicflux has quit [Quit: nomicflux]
nomicflux has joined #ocaml
shinnya has joined #ocaml
zpe has quit [Ping timeout: 276 seconds]
zpe has joined #ocaml
nomicflux has quit [Quit: nomicflux]
sh0t has quit [Remote host closed the connection]
zpe has quit [Ping timeout: 268 seconds]
zpe has joined #ocaml
jimt_ has joined #ocaml
pierpa has quit [Quit: Page closed]
jimt has quit [Ping timeout: 264 seconds]
FreeBirdLjj has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
BitPuffin has joined #ocaml
zpe_ has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
jimt_ is now known as jimt
zpe_ has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
zpe has quit [Ping timeout: 240 seconds]
maattdd has joined #ocaml
zpe has joined #ocaml
maattdd has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
nicoo has quit [Ping timeout: 255 seconds]
FreeBirdLjj has quit [Ping timeout: 276 seconds]
maattdd has joined #ocaml
maattdd has quit [Ping timeout: 248 seconds]
zpe has quit [Ping timeout: 248 seconds]
maattdd has joined #ocaml
zpe has joined #ocaml
kakadu has joined #ocaml
maattdd has quit [Ping timeout: 255 seconds]
troydm has joined #ocaml
ziyourenxiang has joined #ocaml
tarptaeya has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 268 seconds]
jnavila has joined #ocaml
zpe has quit [Ping timeout: 255 seconds]
FreeBird_ has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 276 seconds]
TarVanimelde has joined #ocaml
FreeBirdLjj has joined #ocaml
zpe has quit [Remote host closed the connection]
FreeBirdLjj has quit [Ping timeout: 265 seconds]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 268 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 255 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
jnavila has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 248 seconds]
jnavila has joined #ocaml
seangrove has quit [Ping timeout: 256 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 248 seconds]
malc_ has joined #ocaml
TarVanimelde has quit [Quit: TarVanimelde]
mfp has joined #ocaml
nicoo has joined #ocaml
FreeBirdLjj has joined #ocaml
zolk3ri has joined #ocaml
letoh has quit [Ping timeout: 276 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
mk9 has joined #ocaml
mk9 has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
Haudegen has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 268 seconds]
FreeBirdLjj has joined #ocaml
moei has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
tarptaeya_ has joined #ocaml
tarptaeya has quit [Ping timeout: 248 seconds]
tarptaeya_ has quit [Quit: Leaving]
tarptaeya_ has joined #ocaml
tarptaeya_ has quit [Remote host closed the connection]
_y has joined #ocaml
FreeBirdLjj has joined #ocaml
_y has left #ocaml [#ocaml]
FreeBirdLjj has quit [Ping timeout: 260 seconds]
dtornabene has quit [Ping timeout: 248 seconds]
shinnya has quit [Ping timeout: 256 seconds]
ziyourenxiang has quit [Ping timeout: 264 seconds]
RalfJ has joined #ocaml
<RalfJ> Just updating to opam 2, now `opam update` shows "The repository 'coq-released' at https://coq.inria.fr/opam/released doesn't have a 'repo' file, and might not be compatible with this version of opam.". However, https://coq.inria.fr/opam/released/repo exists. Why is the warning still shown?
yaewa has joined #ocaml
moei has quit [Ping timeout: 255 seconds]
TheLemonMan has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
<Drup> RalfJ: 1.2 repositories should work with 2.0, so I'm not sure what's the issue. I recommend waiting for AltGr's answer
<RalfJ> Drup: for another repo taht did not have the `repo` file, I also got the warning -- but it went away after I added a `repo` file saying `opam-version: "1.2"`. for this repo however, it does not.
ziyourenxiang has joined #ocaml
<RalfJ> but yeah maybe that's actually related to the `ocaml-version` problem...
letoh has joined #ocaml
aziem has joined #ocaml
ganeshjacharya has joined #ocaml
tarptaeya has joined #ocaml
<ganeshjacharya> Error : symbolic link SETUP/config is missing
<ganeshjacharya> SETUP/CONFIGS directory
<ganeshjacharya> You can find examples of different configurations in
<ganeshjacharya> Please first create a symbolic link to your xxx_config.txt file.
<ganeshjacharya> ./configure is returning this
sh0t has joined #ocaml
<ganeshjacharya> During this installation
nomicflux has joined #ocaml
kakadu_ has joined #ocaml
<ganeshjacharya> What is ////Please first create a symbolic link to your xxx_config.txt file./////???
kakadu has quit [Ping timeout: 265 seconds]
kakadu has joined #ocaml
donoban has joined #ocaml
<donoban> Hi
<reynir> hi
<donoban> I have a string input from a python code with a list of records, [{field=x;field2=y},....]
kakadu_ has quit [Ping timeout: 248 seconds]
<donoban> is there some simple way to convert that string into an ocaml list or I need to write some parsing func?
spew has joined #ocaml
tarptaeya has quit [Ping timeout: 248 seconds]
spew has quit [Ping timeout: 248 seconds]
spew has joined #ocaml
tarptaeya has joined #ocaml
ganeshjacharya has quit [Remote host closed the connection]
<dmbaturin> donoban: It doesn't remind me of any commonly used format. Wouldn't be hard to parse though.
<dmbaturin> I wonder why the python code author went for a non-standard format though
<justin_smith> looks almost like json?
govg has quit [Ping timeout: 256 seconds]
govg has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
govg has quit [Ping timeout: 255 seconds]
<dmbaturin> justin_smith: Yeah, _almost_. :)
slash^ has joined #ocaml
tarptaeya has quit [Quit: Leaving]
<justin_smith> almost but not entirely unlike json
shinnya has joined #ocaml
barcabuona has joined #ocaml
jnavila has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
donoban has quit [Ping timeout: 260 seconds]
zolk3ri has quit [Remote host closed the connection]
rwmjones|afk is now known as rwmjones
zolk3ri has joined #ocaml
ziyourenxiang has quit [Quit: Leaving]
chaosite has joined #ocaml
mk9 has joined #ocaml
tarptaeya has joined #ocaml
mk9 has quit [Read error: Connection reset by peer]
nomicflux has quit [Quit: nomicflux]
mk9 has joined #ocaml
samposm has joined #ocaml
nomicflux has joined #ocaml
nomicflux has quit [Quit: nomicflux]
shinnya has quit [Ping timeout: 240 seconds]
mk9 has quit [Quit: mk9]
tane has joined #ocaml
jnavila has quit [Ping timeout: 256 seconds]
jnavila has joined #ocaml
<dmbaturin> aantron: I'm having an odd issue. Code to the effect of Lwt_unix.wait_read fd >>= (fun () -> Lwt_io.read ic ...) never gets to the right hand side, the program exists with 0 without any error conditions. How to debug this kind of stuff?
nullifidian_ has joined #ocaml
nomicflux has joined #ocaml
nullifidian__ has quit [Ping timeout: 276 seconds]
argent_smith has joined #ocaml
spew has quit [Ping timeout: 260 seconds]
spew has joined #ocaml
orbifx has joined #ocaml
orbifx has left #ocaml [#ocaml]
jahuri has joined #ocaml
chaosite has quit [Ping timeout: 256 seconds]
<jahuri> Hi! I have defined a function that typechecks as something -> 'a (it raises an exception), but when I try using it later in my code, it seems to be able to return only unit. It puzzles me as I havent used it as returning unit anywhere (but since the return type is generalized this should not matter). Any help would be greatly appreciated!
<lyxia> jahuri: do you have some example code
<jahuri> More or less, gimme one sec as I need to extract the relevant piece of code
nomicflux has quit [Quit: nomicflux]
<octachron> jahuri, two possibilities: either the value restriction, or you are passing the function as an argument and using it in two different contexts expecting two different return types
ygrek has joined #ocaml
zpe has joined #ocaml
<jahuri> So basically the function at fault is the one called error_incompatible_types here http://sebsauvage.net/paste/ . It is not passed as an argument, and unless my understanding of the value restriction is correct, this should not be relevant ?
<jahuri> Oh my link is not right
<jahuri> here http://sebsauvage.net/paste/?93ef2e5b03c4e067#AEO+W43EvIFdGgybJpAtb7eemJmZs32zg10zdQfnRUc=
Haudegen has quit [Remote host closed the connection]
<octachron> jahuri, if you are binding a partially applied version of the function, the value restriction might be relevant
<octachron> there are no errors within the snippet that you linked, the error lays elsewhere
<jahuri> ok, thank you for the sanity check :)
iZsh has quit [Quit: ZNC - http://znc.in]
tane has quit [Quit: Leaving]
iZsh has joined #ocaml
<samposm> I have simple ocaml wrapper to a random number generator written in C.
<samposm> I got this comment in my github, something about they cannot build it with ocamlbuild, https://github.com/samposm/ocaml-dSFMT/issues/1
<samposm> I am not entirely sure what that comment means?
Rome has quit [Changing host]
Rome has joined #ocaml
Haudegen has joined #ocaml
tsani has quit [Read error: Connection reset by peer]
<dmbaturin> samposm: It roughly means that people expect that ocaml libraries will follow build tool and packaging conventions. :)
<samposm> I last worked on my library 7 years ago. Did those conventions exist 7 years ago?
<samposm> Thanks for the link, I'll read it.
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
<jpdeplaix> samposm: opam did not but ocamlfind (the META file and the libraries hierarchy) definitely did
clog has quit [Ping timeout: 264 seconds]
zpe has quit [Ping timeout: 248 seconds]
tarptaeya has quit [Quit: Leaving]
slash^ has quit [Read error: Connection reset by peer]
spew has quit [Ping timeout: 256 seconds]
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
spew has joined #ocaml
donoban has joined #ocaml
spew has quit [Ping timeout: 240 seconds]
<donoban> hi again
<donoban> dmbaturin: I wrote the python code, I've used the OCaml list syntax because I though it should be easier to parse
tsani has joined #ocaml
<dmbaturin> donoban: Ah, I see. No, there's no simple way to parse ocaml syntax into ocaml value from a program — there's also always an issue with deserialization type safety.
argent_smith has quit [Quit: Leaving.]
<dmbaturin> I like Yojson, it's easy to use and uses polymorphic variants for deserialized values so it's safe (even if it forces you to unwrap everything).
<companion_cube> I wonder why ppx_deriving couldn't have a parser like that
<companion_cube> the opposite of `deriving show` would be `deriving read`
<donoban> I only need to pass a list, do you think it's worth to use Yojson or similars?
<Leonidas> I use ppx_deriving_yojson because I can't be bothered writing the unwrapping code.
<reynir> can atdgen generate python code?
<thizanne> companion_cube: probably because show is much easier both to define and to implement
<companion_cube> yeah right :/
<companion_cube> otoh having python generate json sounds not too difficult?
<thizanne> and we have ppx_deriving_yojson which kind of does that ?
<Leonidas> to read semi-arbitrary data I'd say binprot or something like this is better suited since JSON has hardly any data types.
<dmbaturin> donoban: You can use ppx_deriving_yojson to save time writing deserializing and unwrapping, it throws exceptions if the types inside JSON do not match the type it's mapped to.
<reynir> (doesn't seem so...)
<donoban> well, it's a list of records with some option fields
<Leonidas> dmbaturin: it doesn't throw exceptions, it returns a result type.
<Leonidas> (at least the current version)
BitPuffin has quit [Remote host closed the connection]
tsani has quit [Ping timeout: 240 seconds]
<donoban> thanks for the info, I think that I will do my own parser func for learning
<dmbaturin> Leonidas: Ah, yeah, I forgot. I mostly used it in the other direction lately. :)
<dmbaturin> What the hell, that Lwt_unix.wait_read works fine from the REPL.
<dmbaturin> donoban: That API boils down to Yojson.Safe.from_string, dead simple. But then you need to deal with lots of polymorphic variants since it wraps everything including ints and strings in `Int and `String and the like.
<dmbaturin> * or from_channel if you wish.
<donoban> uhM
<Leonidas> Still easier than to write a parser that does not break down in trivial cases
<dmbaturin> That's the part ppx_deriving_yojson really saves you from.
<dmbaturin> Yeah, JSON is not as simple to get right in every case as if may seem.
<donoban> I suppose that there is not other way to pass data to OCaml from another process?
<dmbaturin> There are many ways. S-expressions, protobuf etc.
<donoban> well, in my case there are even differents virtual machines, I only can pass an string
<reynir> what are you using, qubes-rpc?
<donoban> I'm reading a qubesdb entry
<reynir> ok fair enough
pierpa has joined #ocaml
andreas_ has quit [Quit: Connection closed for inactivity]
remexre has joined #ocaml
<remexre> Is there a way to specify which switch to run ocamlfind on? I've got a project that builds both links-against-glibc and links-against-musl .o files from OCaml, and it's a bit of a PITA to have to `opam switch` between builds
<companion_cube> you might try sth based on `opam exec --switch=… ocamlfind`?
<companion_cube> but it'd be very manual
<remexre> That sounds like exactly what I want, but I get `opam: unknown command `exec'.'
<remexre> what version do I need?
<reynir> maybe something like this might work... ( OPAMSWITCH=switch1 opam con
<reynir> oops, hit enter tooearl
<companion_cube> ah, might be opam 2…
<reynir> maybe something like this might work... ( eval $(OPAMSWITCH=switch1 opam config env); do_build1; ); ...
<remexre> that won't work, since I'm not building from a shell script (I have to use a certain build system due to the rest of the project)
<remexre> but that did get me to run opam config --help
<remexre> and apparently `opam config exec' _is_ a thing
<remexre> so I'll try that
<remexre> yup, looks like that'll work
<remexre> thanks companion_cube, reynir
<companion_cube> ah right, must have been renamed
dtornabene has joined #ocaml
jnavila has quit [Quit: Konversation terminated!]
troydm has quit [Ping timeout: 268 seconds]
Denommus has joined #ocaml
troydm has joined #ocaml
clog has joined #ocaml
Denommus has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<remexre> Using opam config exec --switch 4.06+musl+static+flambda, I'm getting a weird error that seems to be referencing the 4.06.0 switch:
<remexre> Error: /home/nathan/.opam/4.06.0/lib/ocaml/compiler-libs/parse.cmx
<remexre> is not a compilation unit description
<remexre> would opam config exec still be using dependencies from the current switch?
tsani has joined #ocaml
tsani has quit [Ping timeout: 264 seconds]
<donoban> ouch, after writing a first version of my parsing function I discovered that Str is removed from MirageOS
<donoban> I was just using Str.split
<dmbaturin> There are a few pure ocaml regex libs, but I wonder why would they remove Str.
<dmbaturin> Not that Str is nice, but why force people to migrate existing working code.
<dmbaturin> donoban: Opal looks nice for a parser combinator. Can't beat Menhir or another LALR(1) generator at performance of course, but how many firewall rules will one reasonably have on a host...
<donoban> I don't think performance is very important, rules are only parsed when there is some change
<dmbaturin> Oh wait, Str has C parts? Odd.
<dmbaturin> donoban: Is the firewall itself written in ocaml by the way?
<donoban> yes
<donoban> this is the original version
<dmbaturin> Is it stateful?
<donoban> it has the rules hard coded
kakadu has quit [Remote host closed the connection]
<donoban> so you need to rebuild and reboot for doing changes
<donoban> do you mean if supports Nat, established, related?
yaewa has quit [Quit: Leaving...]
<dmbaturin> donoban: Yep.
<dmbaturin> Well, NAT can be stateless, even if these days such NAT would be mostly useless.
<donoban> it's pretty different but I would consider it stateful
<donoban> Opal an standard lib of OCaml?
<dmbaturin> Not standard, but it's in opam.
<donoban> is*
<dmbaturin> There are apparently hundreds parser combinators around (no wonder), but few are in the opam repo or seriously maintained by the authors at all.
<donoban> ok, I will read about it
troydm has quit [Ping timeout: 255 seconds]
<dmbaturin> Well, you can't go wrong with Menhir, if nothing else. :)
<donoban> hehe I thought that I had it with my own func
troydm has joined #ocaml
<donoban> well I will continue another day
<donoban> thanks for your help
<donoban> see you guys
<dmbaturin> donoban: What do you use for IP address manipulation by the way?
<dmbaturin> E.g. checking if address is inside a subnet mentioned in the rule.
seangrove has joined #ocaml
<donoban> uhM, I didn't wrote it, I'm trying to do it dinamically
<donoban> I think that it does not check subnets, it has a list of clients (VM's) connected to the firewall VM
ygrek has quit [Ping timeout: 256 seconds]
<donoban> then classifies a packet between an internal client, the firewall VM itself, the NetVM (which has the outdoor network interface), and if not match any classifies it as External
<Drup> Ugh, I wouldn't use Opal
<Drup> I admit, I dislike parser combinators, but if you are going to use a Parsec copy in OCaml, you might want something decent: Either fast or with good error messages
<Drup> Opal as neither
<companion_cube> has*
<donoban> well, see you guys! bye
jahuri has quit [Ping timeout: 260 seconds]
<dmbaturin> Drup: Which ones are the better parser combinators?
<Drup> dmbaturin: for what purpose ?
<companion_cube> for speed, probably angstrom
<Drup> yeah, for speed/streaming, definitely angstrom
<dmbaturin> For quick and dirty parsers, what else would one use them for. :)
<Drup> for usage-fronting languages ... just use menhir already,
<dmbaturin> I'm quite a fan of Menhir.
donoban has quit [Ping timeout: 260 seconds]
<dmbaturin> Lwt_unix.sleep in its place behaves the same so it's probably something stupid.