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
ben__ has quit [Ping timeout: 244 seconds]
pierpal has quit [Ping timeout: 256 seconds]
kvda has joined #ocaml
BitPuffin has quit [Remote host closed the connection]
sgnb has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
jao has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 244 seconds]
jbrown has quit [Remote host closed the connection]
jimt has quit [Quit: jimt]
gtrak has joined #ocaml
silver_ has quit [Read error: Connection reset by peer]
silver_ has joined #ocaml
ziyourenxiang has quit [Ping timeout: 244 seconds]
jimt has joined #ocaml
silver_ has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
gtrak has quit [Ping timeout: 268 seconds]
gtrak has joined #ocaml
mfp has quit [Ping timeout: 240 seconds]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
spew has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
spew has quit [Read error: Connection reset by peer]
hdon has quit [Ping timeout: 264 seconds]
FreeBirdLjj has quit [Ping timeout: 248 seconds]
pierpal has joined #ocaml
gtrak has quit [Ping timeout: 240 seconds]
pierpa has quit [Quit: Page closed]
gtrak has joined #ocaml
tormen has joined #ocaml
gtrak has quit [Ping timeout: 260 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
tormen_ has quit [Ping timeout: 268 seconds]
kvda has joined #ocaml
dedgrant has quit [Ping timeout: 256 seconds]
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
<xvilka> so if anyone knows the answer - please help
pierpal has quit [Ping timeout: 265 seconds]
pierpal has joined #ocaml
lostman has quit [Quit: Connection closed for inactivity]
cbot has quit [Quit: Leaving]
Soni has quit [Ping timeout: 260 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
<kvda> Is 'so' a monitoring bot?
<Khady> Error: No implementations provided for the following modules:
<Khady> Condition referenced from /home/louis/.opam/frontend/lib/netsys/netsys_oothr_mt.cmxa(Netsys_oothr_mt)
<Khady> Mutex referenced from /home/louis/.opam/frontend/lib/netsys/netsys_oothr_mt.cmxa(Netsys_oothr_mt)
<Khady> Thread referenced from /home/louis/.opam/frontend/lib/netsys/netsys_oothr_mt.cmxa(Netsys_oothr_mt)
<Khady> Trying to compile a project using dune
<Khady> I'm wondering if someone else faced this problem
Soni has joined #ocaml
hdon has joined #ocaml
<Khady> I think I have to enable threads or something
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
hdon has quit [Ping timeout: 240 seconds]
jnavila has joined #ocaml
<Enjolras> Khady: did you try to add "threads" to the libraries section ?
<Khady> yes
<Khady> and actually it seems that I didn't put it at the good place
<Khady> (executable (name main) (libraries netsys threads))
<Khady> this doesn't work
<Khady> (executable (name main) (libraries threads netsys))
<Khady> this works
<Enjolras> ah yes, i've had this issue already. I've no idea why this matters :/
jnavila has quit [Ping timeout: 240 seconds]
reynir has quit [Quit: WeeChat 2.1]
mbuf has joined #ocaml
tarptaeya has joined #ocaml
reynir has joined #ocaml
srax1 is now known as srax
shinnya has quit [Ping timeout: 248 seconds]
malina has quit [Ping timeout: 248 seconds]
TarVanimelde has joined #ocaml
sagotch has joined #ocaml
hdon has joined #ocaml
hdon has quit [Ping timeout: 264 seconds]
Haudegen has joined #ocaml
ben___ has joined #ocaml
ygrek has quit [Ping timeout: 268 seconds]
ben___ has quit [Ping timeout: 240 seconds]
TarVanimelde has quit [Quit: TarVanimelde]
lostman has joined #ocaml
kakadu has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
vladan has quit [Ping timeout: 256 seconds]
freyr69 has joined #ocaml
vladan has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
jao has joined #ocaml
shinnya has joined #ocaml
ben___ has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
argent_smith has joined #ocaml
hdon has joined #ocaml
hdon has quit [Ping timeout: 248 seconds]
dhil has joined #ocaml
freusque has joined #ocaml
silver has joined #ocaml
freusque has quit [Quit: WeeChat 2.0]
FreeBirdLjj has joined #ocaml
freusque has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
pistachio has joined #ocaml
Sagiftw has joined #ocaml
tarptaeya_ has joined #ocaml
tarptaeya has quit [Ping timeout: 248 seconds]
tarptaeya_ is now known as tarptaeya
kvda has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
mfp has joined #ocaml
<freyr69> Ptime (posix time) defines a timestamp as a number of days since epoch + picosecond offset
<freyr69> is it a standard thing?
<freyr69> I can't find such a ``posix'' time
<reynir> I think that's used in /etc/shadow for password date and such
<freyr69> So there is no standard call which returns days + picoseconds
<hannes> freyr69: that is correct. There is Ptime_clock.now () (from the ptime/src-os directory) which uses Unix gettimeofday to convert to a Ptime.t
<companion_cube> the number of days seems something difficult to compute, as well as dependent on the timezone? :/
lostman has quit [Quit: Connection closed for inactivity]
<freyr69> No, it's not, I'm just thinking of time representation in the C part of my project, which is better to be standard
<freyr69> And I am a bit confused with this variety of standards
<hannes> freyr69: here's how a Ptime.t is retrieved via clock_gettime http://erratique.ch/repos/ptime/tree/src-os/ptime_clock_stubs.c#n42
zolk3ri has joined #ocaml
<hannes> you'll have to ask the author of ptime, dbuenzli, about the decision which representation to use. he's not on irc..
<freyr69> hannes: thanks, I'll stick to timespec then
freyr69 has quit [Remote host closed the connection]
freyr69 has joined #ocaml
mengu has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pioneer42 has left #ocaml [#ocaml]
sagotch has quit [Read error: Connection reset by peer]
kvda has joined #ocaml
BitPuffin has joined #ocaml
freyr69 has quit [Quit: ERC (IRC client for Emacs 26.1)]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mk9 has joined #ocaml
hdon has joined #ocaml
pistachio has quit [Quit: WeeChat 2.1]
pistachio has joined #ocaml
hdon has quit [Ping timeout: 265 seconds]
jao has joined #ocaml
Haudegen has quit [Remote host closed the connection]
mk9 has quit [Quit: mk9]
jao has quit [Ping timeout: 256 seconds]
ziyourenxiang has joined #ocaml
mk9 has joined #ocaml
mk9 has quit [Client Quit]
Sagiftw has quit [Quit: Page closed]
freusque has quit [Quit: WeeChat 2.0]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
sagotch has joined #ocaml
spew has joined #ocaml
mengu_ has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
mbuf has quit [Quit: Leaving]
mengu has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
mengu has joined #ocaml
webshinra has quit [Remote host closed the connection]
mengu_ has quit [Ping timeout: 260 seconds]
webshinra has joined #ocaml
<discord> <Perry> I'm curious about the use of picoseconds. That's the time it takes light to travel 0.3mm. It is unlikely any commercial system will be measuring and synchronizing time that accurately for many many decades to come, if ever. Even nanoseconds are pretty short -- the distance light travels in a ns is 30cm.
<reynir> it doesn't mandate any particular resolution
<discord> <Perry> Ah, so I misread.
ryyppy has joined #ocaml
hdon has joined #ocaml
_andre has joined #ocaml
hdon has quit [Ping timeout: 264 seconds]
neatonk has quit [Remote host closed the connection]
bumpkin has joined #ocaml
neatonk has joined #ocaml
bumpkin has left #ocaml [#ocaml]
neatonk has quit [Ping timeout: 268 seconds]
ryyppy has quit [Read error: Connection reset by peer]
neatonk has joined #ocaml
gtrak has joined #ocaml
jao has joined #ocaml
dhil has quit [Ping timeout: 256 seconds]
ryyppy has joined #ocaml
hdon has joined #ocaml
hdon has quit [Ping timeout: 240 seconds]
tarptaeya has quit [Remote host closed the connection]
tarptaeya has joined #ocaml
mengu has quit [Quit: Leaving...]
shinnya has quit [Ping timeout: 248 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
tarptaeya has quit [Remote host closed the connection]
tarptaeya has joined #ocaml
dhil has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
gtrak has quit [Ping timeout: 260 seconds]
al-damiri has joined #ocaml
gtrak has joined #ocaml
sagotch has quit [Ping timeout: 245 seconds]
cbot has joined #ocaml
gtrak has quit [Ping timeout: 260 seconds]
argent_smith has quit [Quit: Leaving.]
ryyppy has quit [Ping timeout: 268 seconds]
gtrak has joined #ocaml
cryptocat1094 has joined #ocaml
opios has quit [Ping timeout: 244 seconds]
jnavila has joined #ocaml
xa0 has quit [Ping timeout: 256 seconds]
jnavila has quit [Ping timeout: 256 seconds]
dedgrant has joined #ocaml
jnavila has joined #ocaml
xa0 has joined #ocaml
xa0 has quit [Ping timeout: 244 seconds]
xa0 has joined #ocaml
malina has joined #ocaml
malina has quit [Ping timeout: 240 seconds]
spew has quit []
shinnya has joined #ocaml
kvda has joined #ocaml
spew has joined #ocaml
spew has quit [Changing host]
spew has joined #ocaml
kvda has quit [Ping timeout: 264 seconds]
<Leonidas> I always found Core.Command difficult but Cmdliner feels completely mysterious. Like I am programming in a strange language
FreeBirdLjj has quit [Remote host closed the connection]
hdon has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
<dmbaturin_> Leonidas: Which is why I often stick with Arg despite all its drawbacks. :)
GreyFaceNoSpace has joined #ocaml
<Leonidas> I finally managed to coerce it to do what I want and also compile \o/
dhil has quit [Ping timeout: 244 seconds]
Haudegen has quit [Read error: Connection reset by peer]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
<discord> <Bluddy> Arg is pretty easy to use
<discord> <Bluddy> it feels similar to doing the same thing in python/ruby etc
<flux[m]> buut, mutation :/
<flux[m]> I certanily agree that Cmdliner is not easy get going, but once you do, it's solid ;-)
<flux[m]> ..just copy paste code from your previous project and you're set..
<dmbaturin_> Until you need to do something different.
<flux[m]> and you get manual page for free!
<flux[m]> like what? I think the same problem comes waayy earlier with Arg
<flux[m]> can you even do subcommands with it?
shinnya has quit [Ping timeout: 240 seconds]
<dmbaturin_> Not directly. Whether reimplementing subcommands yourself is worse than strange APIs is not clear to me.
mk9 has joined #ocaml
<reynir> I feel like the names used in cmdliner are usually not very helpful to me
<dmbaturin_> What I do not like about cmdliner in particular is that it defined the way the receiver of the command line options is called, essentially it creeps into your own logic.
<flux[m]> dmbaturin_: you may find that implementing subcommands youself on top of Arg may be quite annoying
<flux[m]> or how would you deal with ./multicommand --foo ls ls ?
<flux[m]> (where ls is argument to foo)
<dmbaturin_> Arg, as annoying is it can get, can be easily kept isolated from the rest of the code.
<flux[m]> I guess that's because it can be difficult to arrange it to call your own functions directly with the parset arguments, whereas with Cmdliner it's easy. constructing nice configuration objects from Cmdliner would be an additional intermediate step.
dmbaturin_ is now known as dmbaturin
<flux[m]> whereas with Arg you might have a nice record of values, but they are all refs or mutable
<flux[m]> if there was a way to incrementally construct typed records in OCaml (ie. go from {foo : str} to {foo : str, bar : int} then perhaps Cmdliner would be more convenient. with cmdliner your actual functions end up having a lot of arguments you might usually use records for.
<flux[m]> not sure if Cmdliner actually has something to deal with this, haven't followed it (..or most OCaml actually..) for a while.
tarptaeya has quit [Quit: Konversation terminated!]
<discord> <Bluddy> I really want Arg to be updated to support more stuff, like sub-commands and aliases between commands.
kakadu has joined #ocaml
<apache2> 19:21 < flux[m]> or how would you deal with ./multicommand --foo ls ls ?
<apache2> that's pretty easy with cmdliner
<apache2> I find the most annoying thing about cmdliner to be that the args aren't named
<apache2> so when you end up with a function with 20 arguments you have to keep track of which arg goes where
<apache2> I try to limit the problem by mixing args with incompatible types, and to use arg converters instead of parsing inside the command
<apache2> I also find it pretty hard to get sensible manpages when there are subcommands in the mix
<apache2> it would be nice if the default --help could just join all the subcommands into one big index somehow
<apache2> and I still haven't figured out how to force newlines inside docstrings for args and subcommands
<apache2> which makes for some pretty fucked-up man pages
<apache2> but manpages aside it's quite nice
<reynir> Isn't there something like [`P "Foo:"; `P "Something about foo"] ?
* reynir haven't used cmdliner in a while
<apache2> reynir: yes, for the manpage. not for the info/whatever strings associated with arguments
<reynir> Ah, I see
<apache2> companion_cube: you can't compute days from unix time since unix time is not real seconds
<apache2> it's like imaginary unix seconds
<apache2> "American seconds"
<reynir> lol
argent_smith has joined #ocaml
<apache2> to be fair things like American tons (which are slightly smaller than normal-people tons) actually have a fixed definition so the unix time is an odd-one out even as far as American units go
<reynir> ahh :( My laptop crashed while running opam upgrade
pierpa has joined #ocaml
Haudegen has joined #ocaml
cryptocat1094 has quit [Quit: gtg]
asdf123 has left #ocaml ["Leaving"]
<ELLIOTTCABLE> gack.
<ELLIOTTCABLE> I feel like such an idiot, 'cuz I'm sure this is such a noob question.
<ELLIOTTCABLE> Can anybody help me with my lexer/parser delineation?
<ELLIOTTCABLE> details here https://stackoverflow.com/questions/51370405/branching-at-the-parser-lever-based-on-the-content-of-a-token but I'm just tryna parse, basically, `stuff | that | looks | like | this`
<ELLIOTTCABLE> problem is, I can't match on the *payload* of a token, in Menhir; and I am trying to ensure that disallowed values are a parse-error
<Armael> shouldn't you filter illegal values at lexing time?
<Armael> or turn it into an error after parsing
jnavila has quit [Remote host closed the connection]
<dmbaturin> ELLIOTTCABLE: Why can't you use an existing CSV library for this?
<ELLIOTTCABLE> that's basically what I'm required to write :P
<ELLIOTTCABLE> doing ‘homework’ for a job-app.
<ELLIOTTCABLE> Armael: problem is, lexing doesn't know the structure in this case, y'know?
<dmbaturin> Ah. Well, if the set of valid values for fields is predefined, I'd argue they _should_ be lexer tokens.
<Armael> ah, I see
<ELLIOTTCABLE> i.e. if I have the name `Male Mr. Female`, then `Female | Male | Male` or whatever would lex as gender tokens
<Armael> well if they can't be lexer tokens because it depends on the context, I'd say you have to check after parsing
<dmbaturin> Also, menhir has built-in function for separated list.
<ELLIOTTCABLE> dmbaturin: yah, belatedly saw that.
<ELLIOTTCABLE> oops 🤣
<ELLIOTTCABLE> I read the entire Menhir manual in detail last year. apparently I forgot everything I learned between then and now. -_-
<dmbaturin> But the order of the fields is supposed to be fixed, isn't it?
<dmbaturin> Otherwise the format is inherently ambiguous.
<ELLIOTTCABLE> k, tl;dr I'm not an idiot and this would be unnecessarily Hard™ to do at parse-time. I'll just do the conversion afterwards. 🙄
<ELLIOTTCABLE> mmhmm, but the lexer doesn't know that order, unless I make it modal
<ELLIOTTCABLE> in which case it's basically become a parser, soooo …
malina has joined #ocaml
<Armael> yea it's simpler to do it afterwards
<dmbaturin> ELLIOTTCABLE: I was mostly responding to Armael who said it may be context dependent.
* ELLIOTTCABLE nods
<ELLIOTTCABLE> but yeah no kidding this is just begging for basically gsub
<ELLIOTTCABLE> '|' → ',' and feed it into ocaml-csv or whatever. sigh.
<dmbaturin> ELLIOTTCABLE: If it's any consolation, I've had to do this: https://github.com/vyos/libvyosconfig/blob/master/parser/vyos1x_lexer.mll#L15 to deal with an ambiguous format whose designer thought they don't need no explicit separators between statements.
<dmbaturin> I should add an explanation of the lexer hack or else I'll myself forget what it was for.
argent_smith has quit [Quit: Leaving.]
Jesin has joined #ocaml
mk9 has quit [Quit: mk9]
kakadu has quit [Remote host closed the connection]
kvda has joined #ocaml
_andre has quit [Quit: leaving]
cbot has quit [Ping timeout: 260 seconds]
bartholin has quit [Ping timeout: 240 seconds]
bartholin has joined #ocaml
malina has quit [Ping timeout: 244 seconds]
spew has quit [Quit: Connection closed for inactivity]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mrvn has quit [Ping timeout: 260 seconds]
Haudegen has quit [Remote host closed the connection]
Jesin has quit [Ping timeout: 260 seconds]
pierpal has quit [Ping timeout: 244 seconds]
hdon has quit [Changing host]
hdon has joined #ocaml