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
cthuluh has quit [Ping timeout: 260 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
sdothum has joined #ocaml
cthuluh has joined #ocaml
sdothum has quit [Client Quit]
Algebr` has quit [Remote host closed the connection]
sdothum has joined #ocaml
pyon has quit [Ping timeout: 240 seconds]
pyon has joined #ocaml
nzyuzin has quit [Ping timeout: 240 seconds]
nzyuzin has joined #ocaml
pyon has quit [Ping timeout: 244 seconds]
pyon has joined #ocaml
fluter has quit [Ping timeout: 250 seconds]
bc` has joined #ocaml
silver has quit [Quit: rakede]
rgrinberg has quit [Ping timeout: 244 seconds]
fluter has joined #ocaml
SilverKey has joined #ocaml
pyon has quit [Quit: bye bye, this system]
agarwal1975 has joined #ocaml
<bc`> ?
<bc`> /?
tmtwd has joined #ocaml
pyon has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
bc` has quit [Read error: Connection reset by peer]
ygrek has quit [Ping timeout: 265 seconds]
pyon has quit [Quit: brb]
tmtwd has quit [Ping timeout: 276 seconds]
bcj has joined #ocaml
darkf has joined #ocaml
tmtwd has joined #ocaml
bcj has quit [Remote host closed the connection]
tmtwd has quit [Ping timeout: 260 seconds]
rgrinberg has joined #ocaml
tmtwd has joined #ocaml
jsaq has joined #ocaml
johnelse has joined #ocaml
<jsaq> hey, I'm working through Real World OCaml and I'm having the following problem:
johnelse has quit [Ping timeout: 258 seconds]
<jsaq> any ideas?
fraggle_ has quit [Ping timeout: 260 seconds]
<pierpa> you are missing one argument somewhere
<pierpa> I don't know Core, but looks like Time.to_sec_string is expecting a second argument of type zone:Core.Zone.t
<jsaq> I copied the code straight off the book
<jsaq> Time.to_sec_string (Time.now()), for example, works
<pierpa> then, no idea
<jsaq> Oh, it doesn't work, it just returns another function
<jsaq> Yeah, I'm missing a second argument
<jsaq> Thank you
<jsaq> book is probably outdated
<pierpa> Check the list of known errors. Maybe is a known one.
MercurialAlchemi has joined #ocaml
fraggle_ has joined #ocaml
seangrove has quit [Ping timeout: 244 seconds]
jsaq has quit [Ping timeout: 250 seconds]
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
SilverKey has quit [Quit: Cheerio!]
govg has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 252 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
nicholasf has quit [Ping timeout: 252 seconds]
nicholasf has joined #ocaml
MercurialAlchemi has joined #ocaml
larhat has quit [Quit: Leaving.]
MercurialAlchemi has quit [Ping timeout: 240 seconds]
rgrinberg has quit [Ping timeout: 265 seconds]
sepp2k has joined #ocaml
rgrinberg has joined #ocaml
rossberg_ has quit [Ping timeout: 264 seconds]
rgrinberg has quit [Ping timeout: 260 seconds]
rossberg_ has joined #ocaml
johnelse has joined #ocaml
johnelse has quit [Ping timeout: 240 seconds]
chinglish has joined #ocaml
MercurialAlchemi has joined #ocaml
seangrov` has joined #ocaml
chinglish has left #ocaml [#ocaml]
fraggle_ has quit [Ping timeout: 260 seconds]
fraggle_ has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
orbitz has quit [Quit: reboot]
tmtwd has quit [Ping timeout: 265 seconds]
pierpa has quit [Ping timeout: 250 seconds]
ygrek has joined #ocaml
nore has quit [Quit: WeeChat 1.4]
ygrek has quit [Ping timeout: 244 seconds]
nore has joined #ocaml
seangrov` has quit [Ping timeout: 260 seconds]
ontologiae has joined #ocaml
orbitz has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 265 seconds]
ontologiae has quit [Ping timeout: 250 seconds]
nicholas_ has joined #ocaml
govg has quit [Ping timeout: 244 seconds]
nicholasf has quit [Ping timeout: 276 seconds]
govg has joined #ocaml
tane has joined #ocaml
nicholasf has joined #ocaml
dexterph has joined #ocaml
nicholas_ has quit [Ping timeout: 244 seconds]
orbifx has joined #ocaml
johnelse has joined #ocaml
ygrek has joined #ocaml
johnelse has quit [Ping timeout: 276 seconds]
AltGr has joined #ocaml
mpenet has joined #ocaml
Simn has joined #ocaml
_y has quit [Remote host closed the connection]
pierpa has joined #ocaml
tobiasBora has quit [Quit: Kthxbye]
johnelse has joined #ocaml
dhil has joined #ocaml
ygrek has quit [Ping timeout: 265 seconds]
d0nn1e has quit [Ping timeout: 260 seconds]
parataxis has quit [Ping timeout: 250 seconds]
mpenet has quit [Read error: Connection reset by peer]
mpenet has joined #ocaml
d0nn1e has joined #ocaml
parataxis has joined #ocaml
hay207_ has joined #ocaml
hay207 has quit [Remote host closed the connection]
Fleurety has quit [Ping timeout: 276 seconds]
Fleurety has joined #ocaml
larhat has joined #ocaml
tennix has joined #ocaml
johnelse_ has joined #ocaml
tennix has quit [Ping timeout: 250 seconds]
johnelse has quit [Ping timeout: 250 seconds]
Kakadu2[m] has joined #ocaml
jwatzman|work has joined #ocaml
doomy has quit [Quit: WeeChat 0.3.8]
seangrov` has joined #ocaml
dhil has quit [Ping timeout: 265 seconds]
seangrov` has quit [Ping timeout: 250 seconds]
regnat[m] has joined #ocaml
M-martinklepsch has joined #ocaml
M-jimt has joined #ocaml
Bluddy[m] has joined #ocaml
M-ErkkiSeppl has joined #ocaml
barkmadley[m] has joined #ocaml
M-pesterhazy has joined #ocaml
M-Illandan has joined #ocaml
tennix has joined #ocaml
ggole has joined #ocaml
nicholasf has quit [Remote host closed the connection]
orbifx1 has joined #ocaml
nicholasf has joined #ocaml
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
silver has joined #ocaml
rand__ has joined #ocaml
sdothum has joined #ocaml
fraggle_ has quit [Remote host closed the connection]
fraggle-boate has joined #ocaml
fluter has quit [Ping timeout: 258 seconds]
fraggle_ has joined #ocaml
nicholasf has quit [Ping timeout: 244 seconds]
fluter has joined #ocaml
nicholasf has joined #ocaml
johnelse_ is now known as johnelse
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
larhat1 has joined #ocaml
larhat has quit [Read error: Connection reset by peer]
_andre has joined #ocaml
bc` has joined #ocaml
<bc`> hi
<companion_cube> o/
dhil has joined #ocaml
_andre has quit [Quit: leaving]
_andre has joined #ocaml
orbifx1 has quit [Ping timeout: 260 seconds]
_andre has quit [Client Quit]
_andre has joined #ocaml
bc` has left #ocaml ["ERC (IRC client for Emacs 25.1.50.1)"]
agarwal1975 has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
agarwal1975 has quit [Quit: agarwal1975]
tennix has quit [Ping timeout: 244 seconds]
_andre has quit [Ping timeout: 276 seconds]
_andre has joined #ocaml
ocaml678 has joined #ocaml
<ocaml678> hi there
<ocaml678> I am a long-time ocaml user but a total newbie at lexing and parsing. I want to parse a language that has both delimiting angle brackets and "less than" operator
<ocaml678> the problem is in the lexer I would like to assign "<" to both "OPERATOR" token and "LANGLE" token
<ocaml678> and obviously this does not work, what's the correct way to do this?
<companion_cube> well, to have only one token, and let the parser disambiguate
<ocaml678> since "operator" may include arbitrary sequences of symbols, this means I have to reconstruct the operator name in the parser then?
rgrinberg has joined #ocaml
<ocaml678> in ocamllex I used a rule like (">" | "=" | "<"| "!" | "?" | "+" | "-" | "*" | "/")* as lxm {OP lxm}
rgrinberg has quit [Client Quit]
<ocaml678> which is then wrong, I have to do that in the parser?
rgrinberg has joined #ocaml
<Drup> not really, just add a rule above that transforms ">" into LANGLE, then in your parser, you have a rule operator: (LANGLE | OP)
<ocaml678> hmm but also <= is an operator, so that gets clumsy
<Drup> Wait, you want "<=" to be potentially parsed as a delimiter with "=" being the next token ?
<flux> why is it (..)* instead of just (..) ?
<flux> ah, right, ///= etc
<ocaml678> well it should be (...)+ actually, I'm seeing this now, but it's not the point
<ocaml678> Drup: no <= should never be parsed like that
<ocaml678> <= is always OPERATOR
<Drup> then it works as I said :)
<ocaml678> I'm probably dumb :) but how do you parse <= as operator then?
<flux> | LANGE -> { Operator "<=" } | Op x -> { Operator x } ? (I haven't used ocamlyacc for some time)
<ocaml678> flux: that would translate the string "<" into 'Operator "<="'
<Drup> ocaml678: I'm just going to show you how it's done in the ocaml lexer ;)
<ocaml678> Drup: that would be absolutely great :)
<flux> can't you have "<=" { LANGLE } in your lexer and then "<=" would always make "<=" become an LANGLE?
<Drup> | "<" { LESS }
<Drup> | ['=' '<' '>' '|' '&' '$'] symbolchar *
<Drup> { INFIXOP0(Lexing.lexeme lexbuf) }
<Drup> (there are a bunch of other rules for symbolchars that emits INFIXOPN with N between 0 and 5, for priorities
<Drup> and that's it
<ocaml678> ah
<ocaml678> yes that's deterministic
<ocaml678> makes sense, thanks
<Drup> while the ocaml parser is a big soup of tangled noodle, the lexer is reasonably readable.
tane has quit [Quit: Verlassend]
<Drup> (and probably showcase every quirks imaginable in an LALR language)
pyon has joined #ocaml
clog has quit [Ping timeout: 252 seconds]
_andre has quit [Ping timeout: 244 seconds]
_andre has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
<ocaml678> drup: will keep that in mind for future reference!
dhil has joined #ocaml
<Drup> ocaml678: are you using menhir ?
ocaml678 has quit [Ping timeout: 250 seconds]
agarwal1975 has joined #ocaml
clog has joined #ocaml
clog has quit [Ping timeout: 240 seconds]
pyon has quit [Ping timeout: 250 seconds]
copy` has joined #ocaml
pyon has joined #ocaml
pyon has quit [Client Quit]
darkf has quit [Read error: Connection reset by peer]
darkf has joined #ocaml
pierpa has quit [Ping timeout: 250 seconds]
nicholasf has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 258 seconds]
tennix has joined #ocaml
clog has joined #ocaml
silver_ has joined #ocaml
silver_ has quit [Max SendQ exceeded]
silver_ has joined #ocaml
silver_ has quit [Max SendQ exceeded]
al-damiri has joined #ocaml
silver_ has joined #ocaml
silver has quit [Ping timeout: 258 seconds]
th5 has joined #ocaml
shinnya has joined #ocaml
johnelse has quit [Quit: Lost terminal]
silver_ has quit [Quit: rakede]
silver_ has joined #ocaml
johnelse has joined #ocaml
silver_ has quit [Client Quit]
silver_ has joined #ocaml
silver_ is now known as silver
tennix has quit [Read error: Connection reset by peer]
djellemah has quit [Ping timeout: 260 seconds]
dxtr has quit [Ping timeout: 264 seconds]
dxtr has joined #ocaml
tennix has joined #ocaml
johnelse is now known as johnel_away
johnel_away is now known as johnelse
<ggole> Hmm, that paper on sequent calculus as an IL is an interesting read
<Drup> which one ?
dexterph has quit [Ping timeout: 250 seconds]
<ggole> research.microsoft.com/en-us/um/people/simonpj/papers/sequent-core/scfp_ext.pdf
<ggole> (From gasche's dump of preprints)
zpe has joined #ocaml
<Drup> heh, I did an internship on that subject
<Drup> (except it was a dependently typed sequent calculus, and it was as a backend for agda)
<ggole> Sounds like fun
<Drup> (we never really finished, but it was fun)
<ggole> I've played around with CPS a bit, it doesn't really seem like a nice IL
<Drup> well, ANF and CPS are equivalent. flambda is in ANF
zpe has quit [Ping timeout: 244 seconds]
<Drup> (and sequent calculus is pretty close to ANF, I don't remember the exact differences)
<Drup> (ANF being pretty close to "functional SSA" in spirit)
<ggole> My understanding is that CPS is ANF plus some join points
<Drup> I'm pretty sure you can transform one into the other. There might be details that I forgot
<ggole> Mmm.
<ggole> I suspect Week's criticism of CPS may apply to all 3
<ggole> Plus there's the usual (although minor) weakness of 'syntactic' IRs of placing all the arguments passed to a function all around a program instead of in one place, making it expensive and annoying to look at them all
MercurialAlchemi has joined #ocaml
<ggole> SSA gets that one right
<Drup> ah, no, that's not valid for the sequent calculus
<Drup> morally, it's a graph, just like SSA. You use a syntactic representation for convenience, but that's all
<Drup> that's precisely the point of using sequent calculus, substitution is fast
<ggole> Oh, hmm.
<ggole> A more graphical IR definitely seems like the way to go
<ggole> Hoisting and sinking in CPS is quite tedious
<Drup> yes, but not in sequent calculus
<Drup> (and I'm pretty sure, not in ANF either)
<ggole> Not in ANF? You still have scope, right?
<Drup> hum, yes, kinda, but that's not much of an issue
<Drup> (ANF is really similar to sequent calculus, it's a list of bindings ...)
<ggole> So you get the same thing where if you want to contify a function you have to sink it into the scope of the continuation (which may not be in scope of the original function, since it is recieved as an argument there)
<ggole> In a proper graph IR you'd just forward the argument and be done (in fact, it would be simple sparse copy propagation)
<Drup> huum, I don't remember enough to answer
<ggole> (The downside being that you have to have a scheduling pass, which may be quite interesting for a language with nested mutually recursive functions)
sepp2k has quit [Quit: Leaving.]
<companion_cube> sequent core looks funny
<ggole> Well, so does CPS
slash^ has joined #ocaml
<ggole> Although maybe not as funny, cut pairs are pretty strange.
<flux> hmm, hadn't noticed multicore is available as an opam switch from opam remote add ocamllabs -k git https://github.com/ocamllabs/opam-repo-dev
swistak35 has quit [Ping timeout: 250 seconds]
swistak35 has joined #ocaml
<companion_cube> I will look into sequent core, it might be a good format for writing symbolic interpreters
<companion_cube> (at a glance, I read that the current computation is always at the root of the term, which is very valuable)
<Drup> companion_cube: yes it is, especially since you can use unique names and substitution is still efficient
<companion_cube> I don't care about that :p
<ggole> Symbolic interpreters? As in an SMT solver sort of thing?
<Drup> for interpreters you don't care ?
<companion_cube> yeah
<companion_cube> Drup: for an interpreter I use De Bruijn indices.
<ggole> I have to play with that sometime.
<Drup> that's my point, you don't have to :D
<companion_cube> Drup: meh, I'll have to check that :p
<Drup> companion_cube: we had this debate already
<Drup> it was a long one
<companion_cube> ggole: if you want to write a SMT in OCaml, it happens that zozozo and I have a SAT solver suitable for that
<companion_cube> Drup: it was not about interpreters, but things like type checkers
<ggole> It'd be really nice to be able to use bounded model checking to verify Quickcheck style properties
<companion_cube> (De Bruijn indices are also useful for hashconsing, btw)
<companion_cube> ggole: :]]]]]]
<Drup> we also had the hasconsing debates
<companion_cube> I'm working on this
<companion_cube> and I don't recall that named variables are good for hashconsing
<Drup> (and for sufficiencly complicated logics, typechecker are interpreter for type expressions :>)
<Drup> (especially *cough* dependently typed languages)
<ggole> And also you could do things like fails? f (g _) _ and have it find values which lead to assert false or other bad things
<companion_cube> ggole: the issue is mutability
<companion_cube> (for OCaml)
<ggole> Which would be really nice for finding out how bad your understanding of your programs is
<ggole> Oh, aliasing?
<companion_cube> well, mutable state
<companion_cube> I mean, it's much harder to represent in a SMT solver
ocalm has joined #ocaml
<companion_cube> Drup: I'd be interested in a quick summary of what you recall from this discussion, because really, hasconsing without DB…
rand__ has quit [Ping timeout: 252 seconds]
<ggole> I just (yesterday) watched a presentation on using a solver for a small language with mutable variables
<Drup> why do you need hashconsing to begin with ? :)
<ggole> And the solution was pretty much conversion to SSA (well, predication, but that's the same thing)
<companion_cube> Drup: that's not the question :p
<Drup> actually, it is
<companion_cube> ah: for caching purpose
<ggole> Unless I'm missing something, it seems like that should work in the absence of aliasing
<companion_cube> auto-memoization if you prefer
<companion_cube> ggole: like a simple state monad, I guess so
<companion_cube> but it's a lot harder than purely functional
<Drup> because when we were talking about typechecking things like coq, the conclusion was that, with a representation in sequent calculus style, you don't need hashconsign anyway
<ggole> Uh, I'm not sure about the connection with monads there.
<companion_cube> yeah ,but coq doesn't need as much evaluation as the tool I'm writing :]
<companion_cube> ggole: monad for threading the state around
<ggole> Isn't the point of SSA/predication to (sort of) remove it
<companion_cube> I guess it's equivalent, never mind
<ggole> We might be talking past each other a bit here. :)
<companion_cube> do you have an URL, per chance?
<ggole> For the talk? Sure, hang on a sec.
<companion_cube> thanks
<ggole> I had some ideas for how to use something like this to demonstrate equivalence between a term and its instruction selection
<ggole> It'd be nice to have something to check correctness that isn't as manual as a unit test or as brain melting as a proof assistant.
ocalm has quit [Ping timeout: 240 seconds]
<companion_cube> there is quite a lot of work done between OCaml expressions and their compiled version, though
<ggole> Yes, you'd need to carry program fragments and their compilation side by side in some way.
<companion_cube> ouch :D
<ggole> It would probably suck to add that to a compiler which was not designed for it. :/
reynir is now known as rparent
<ggole> And optimisers really like to evaluate parts of the structure out of a program, so of course you can't rely on anything staying in place
rparent is now known as reynir
<companion_cube> exactly
johnelse is now known as johnel_away
johnel_away is now known as johnelse
ygrek has joined #ocaml
tennix has quit [Ping timeout: 250 seconds]
jeffmo has joined #ocaml
tmtwd has joined #ocaml
larhat1 has quit [Quit: Leaving.]
mpenet has quit [Remote host closed the connection]
johnf has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
<flux> will opam 2.0 bring self-updating?-)
rand__ has joined #ocaml
dexterph has joined #ocaml
ontologiae has joined #ocaml
tmtwd has quit [Ping timeout: 240 seconds]
sh0t has joined #ocaml
djellemah has joined #ocaml
Algebr` has joined #ocaml
two_wheels has quit [Quit: Textual IRC Client: www.textualapp.com]
ontologiae has quit [Ping timeout: 264 seconds]
two_wheels has joined #ocaml
djellemah_ has joined #ocaml
djellemah has quit [Ping timeout: 240 seconds]
dhil has quit [Ping timeout: 250 seconds]
jeffmo_ has joined #ocaml
jeffmo has quit [Ping timeout: 244 seconds]
jeffmo_ is now known as jeffmo
ygrek has quit [Ping timeout: 244 seconds]
orbifx has quit [Ping timeout: 250 seconds]
<Algebr`> why does travis still run on opam PRs even when removing packages? I guess for reverse dependencies?
djellemah has joined #ocaml
darkf has quit [Read error: Connection reset by peer]
darkf has joined #ocaml
strykerkkd has joined #ocaml
tvynr has joined #ocaml
<tvynr> Does anyone actually use .install files for OPAM packages? I searched the OPAM repo and came up with few examples. I like the idea of skipping "make install" (since manually specifying install and remove steps is sloppy), but I can't find a good example of using package-name.install files to install libraries from a project.
djellemah has quit [Quit: Leaving]
<tvynr> (I don't know much about OCaml's build chain; I was just hoping to be able to specify an .install with the appropriate subset of my _build directory and call it a day.)
<tvynr> So I suppose my question for the room is: do people use .install files or are they generally only used for patch-ups and special cases in practice?
<Algebr`> i think topkg uses .install?
djellemah__ has joined #ocaml
Algebr` has left #ocaml ["ERC (IRC client for Emacs 25.1.50.1)"]
johnelse has quit [Ping timeout: 240 seconds]
djellemah_ has quit [Ping timeout: 260 seconds]
<tvynr> Algebr`: topkg seems to use its own weird custom script for building. There's no install segment in the opam file, but there's no .install file either.
<tvynr> Thanks for the reference, tho.
<companion_cube> ggole: I guess you could unroll OCaml functions and check invariants with z3, indeed
* companion_cube watching the talk
Algebr` has joined #ocaml
<tvynr> I'm really just trying to write a little library package and I'm struggling to find the best way to do it. I'm reluctant to have to keep an .install file up to date with my source tree (if I create a new library in my _oasis file, it's error-prone to also have to write it into a .install file) but the "make install" route seems bad too (and the remove process doesn't let me keep my setup.ml to use -uninstall with it).
<tvynr> I'm sure the build process is designed the way it is for a reason but, to a newcomer, it's sort of hard to understand without dissecting the history of things like findlib. :-P
<Algebr`> tvynr: what's wrong with oasis?
<Algebr`> and then oasis2opam
<tvynr> Algebr`: Hm. I use oasis for this project. I tried oasis2opam once for a different project but ran into problems for reasons I don't recollect. I'll take a look at it; thanks.
<Algebr`> oasis2opam --local is what I use. Could also move over to topkg but haven't cause of hassle of learning a new thing
<tvynr> I just tried oasis2opam on my little working example project; I think it's pretty much what I want.
<tvynr> Thanks for the reference; this does the job.
<tvynr> :)
<tvynr> I inadvertently learned what I set out to learn by building this toy project too. So I take it that it'd be bad for my little pet project to have a library it calls "utils", huh?
<Algebr`> not really, make it a child package
<Algebr`> foo.utils
ygrek has joined #ocaml
<Algebr`> look for FindlibParent in opam, grep for it
<tvynr> Oh goodness. I think there's a whole dimension of this stuff that I never figured out.
<ggole> companion_cube: is there another approach?
<companion_cube> well, I have an alternative for pure functions, but it's WIP and may be published some day
<tvynr> Algebr`: Do you know of a project that uses OASIS and declares a child package? I'd love to learn from it.
<Algebr`> tvynr: its pretty straightforward, just bad docs
<Algebr`> tvynr: yea many, look though opam or one secon
thomasga has joined #ocaml
<tvynr> Algebr`: That's been my experience, yeah: straightforward once you find an example to copy and paste from. :-P I'm not sure what I'm looking for; is FindlibParent an OASIS field?
<thomasga> hey, is there any "right" way to add conditional dependencies to a META file?
<Algebr`> tvynr: this _oasis file should give you pretty much all you'll never for a while
<Algebr`> ever*
<tvynr> Excellent! Thank you so much for your help.
<tvynr> I think my build workflow is about to get much nicer.
<Algebr`> yay
<copy`> Can I safely remove `| e -> raise e` from `try … with | … | e -> raise e` or does it have some effect?
<asmanur> i guess at least you don't get the same backtrace information
<ggole> It nicely ruins your backtraces
<tvynr> Algebr`: One last question, if you don't mind: can a findlib child package have a child package (e.g. foo.bar.baz)? I'm hoping the answer is yes; this would help a lot with organizing our libraries. :-P
<Drup> thomasga: "exists_if" ?
<Algebr`> tvynr: I think so, never tried three layers of nesting
<Algebr`> but try and find out
<Drup> (about oasis, there is this tutorial too: http://ocaml.org/learn/tutorials/setting_up_with_oasis.html)
<tvynr> Okay. Thanks. :)
<tvynr> Drup: Yeah; that's how we got started. But then we immediately started doing crap like writing PPX extensions and life got interesting. :-P
<thomasga> @Drup: but the "exist_if" doesn't let you specify optional requirements, right?
<Drup> thomasga: just that the .cm[oax] exists, isn't that all that matter ?
<thomasga> but maybe adding sub-packages with "exist-_f"?
<Drup> the real condition for the lib to be built should be in the opam constraints/build system
<thomasga> let's say I want to do something like conduit: I have a library which depends on many things, which might or might not be installed
<Drup> once it's built, it doesn't matter how/why, it's there. ocamlfind can use it
shinnya has quit [Ping timeout: 244 seconds]
<thomasga> currently the META file of conduit has a lot of magic, as we change it depending on what we link at build time
<Algebr`> wow
<thomasga> and we use cppo+magic ocamlbuild runes to link with the right libraries
<Drup> thomasga: honestly, your question should be "how to remove the cppo from conduit", not "how to add more magic in the META file" :D
<thomasga> yes
<thomasga> if you have an answer to that, I take it :-)
<Drup> if we assume the only user of conduit is mirage, I have one, look at how the devices are made
<thomasga> an other exemple that I am currently working on: a portable FS event library: should be FSevents on OSX, inotify on Linux and polling on Windows (until we have something better)
<Drup> (the conduit devices)
<thomasga> well my question is not about conduit actually :-)
<Drup> I know ^^
<thomasga> :p
<thomasga> I will try to add some exist_if the the META file
<thomasga> I'm sure this will go well...
<Drup> but I really think what conduit is doing (a library which *dependencies* changes according to how it was compiled) is really evil
<thomasga> well, the goal of the lib is to hide that to the final user so it has to do it
<Drup> (exists_if is used in many libraries, all the oasis ones and jsoo, for example)
<thomasga> I agree that ti doesn't hide it very weel
<thomasga> but the goal is somewhat noble
<Drup> I'm not sure we really need to hide it like that, honestly. A set of various modules that provides combinators should be enough, especially if we assume the mirage tool is used. But let's put that debate aside.
<Drup> if you want to change the dependencies of a package, I don't think you have a choice
<Drup> you need to gen the META file at build time
<Drup> exists_if is here to enable/disable whole (sub)libraries
<thomasga> I'm sure I can turn that into a weapon of mass destruction
<tvynr> Algebr`: Just so you know, the naive thing didn't work. I'm not sure findlib supports three-level hierarchies. Whatever, though; I'm happy with two. :)
<tvynr> Algebr`: Thanks again for the help!
<Drup> tvynr: findlib supports any number of levels
<tvynr> Drup: Oh? That's good to hear.
<Drup> You need something of the form "FindlibParent: foo.bar"
<Drup> (in oasis)
<tvynr> So I wrote that into an OASIS file. It complained that "foo.bar" didn't exist.
<tvynr> Despite the fact that I wrote Library entries for "foo" and for "bar" above it.
<Drup> hum
<tvynr> Could be an OASIS problem, though.
<Drup> Please pastebin :)
<Algebr`> tvynr: sure thing
<tvynr> Okies. One sec.
orbifx has joined #ocaml
<Drup> thomasga: having fun topkging, I presume ?
<thomasga> it's not really related to topkg at that level
<tvynr> Drup: Here's the dummy _oasis file I made to play with it. http://pastebin.com/dME9H9j4
<Drup> that's true
<Drup> huum
<Drup> have you tried "FindlibParent: baz" ?
<tvynr> Drup: Mind, it was copied from another project and stripped back, so there's some unnecessary junk in there (e.g. Menhir).
<tvynr> Drup: Hm... just did.
<tvynr> Drup: It... sorta worked? I changed the _oasis file, ran oasis2opam, and then pinned the package in OPAM.
<tvynr> Drup: But now, if I "ocamlfind query foo", I get a result. Is that expected? I'd think I'd have to "ocamlfind query bar.baz.foo".
<Drup> can you pastebin the META file ?
<Drup> (you need to rerun "oasis setup")
<tvynr> So I'm on dynamic update.
<tvynr> But it's possible that the META file is junk lying around from a previous build or something.
<tvynr> I'm gonna purge stuff and try again.
<Drup> just compile once
<Drup> yeah, I can confirm, that works as expected
<tvynr> It worked for you?
<Drup> https://bpaste.net/show/9fe853ffefe8 here is the meta file
<tvynr> I got a complaint about a missing META file, but I think it's 'cause my dummy source directories were missing.
<tvynr> Yep; works for me now, too.
<tvynr> I must've had an out-of-date META file lying around.
<tvynr> Probably created it by accident while I was messing about with install commands. Thanks for the help!
orbifx has quit [Quit: WeeChat 1.5]
<tvynr> Honestly, if it weren't for the excellent community support, I'd be completely lost. :)
AlexRussia has quit [Ping timeout: 264 seconds]
<Algebr`> tbh having to ask people on IRC for such basic help is a sign of something is broke in OCaml doc and new people support.
<Drup> I agree, especially for oasis, the documentation is very insufficient :(
<tvynr> As one of those new people, I also agree. :-P I wish I had the level of confidence necessary to write some documentation. It'd be great if there were a wiki for this or something.
<Drup> tvynr: the ocaml.org website is appropriate
<Algebr`> ocaml.org is pretty good, however some tutorials literally just drop off in the middle
<tvynr> Ooo! It's in a GitHub?
<Algebr`> the tutorials?
<Algebr`> the tutorials are on the ocaml.org github, as markdown
<Algebr`> the code that generates the ocaml.org website is....a little tangled to say it diplomatically.
tvynr has quit [Ping timeout: 252 seconds]
tg has quit [Ping timeout: 264 seconds]
<thomasga> @Drup: is that what you had in mind? https://github.com/samoht/irmin-watcher/blob/master/pkg/META
tg has joined #ocaml
Algebr`` has joined #ocaml
<Drup> I guess ? I don't know the library enough to answer
<Drup> that's pretty much what oasis would emit, though
<Drup> (so I guess it's good enough :p)
johnelse has joined #ocaml
<Drup> oh wait, the main package depends on the two optional subpackages
<thomasga> well, oasis will not have a cppo invocation in the top-level package
<Drup> hum, not sure if that's going to work
<thomasga> yes, that's the trick :-)
<thomasga> the right sub-dependency is picked up with the exists_if
<thomasga> or *should be picked up*
<Drup> does it work ?
<thomasga> no idea :-)
<thomasga> it was a 2 minutes hack, so probably not
<thomasga> I will test it later
ggole has quit [Ping timeout: 244 seconds]
Algebr` has quit [Ping timeout: 250 seconds]
thomasga has quit [Quit: Leaving.]
tvynr has joined #ocaml
<tvynr> Hooray for fire alarms.
<tvynr> Algebr`, Drup: Thanks again for your help!
johnelse has quit [Ping timeout: 260 seconds]
soupault has joined #ocaml
<soupault> hello everyone!
octachron has joined #ocaml
<silver> hello
sh0t has quit [Ping timeout: 240 seconds]
tvynr has quit [Ping timeout: 240 seconds]
darkf has quit [Quit: Leaving]
orbifx has joined #ocaml
SilverKey has joined #ocaml
SilverKey has quit [Max SendQ exceeded]
SilverKey has joined #ocaml
SilverKey has quit [Max SendQ exceeded]
sh0t has joined #ocaml
SilverKey has joined #ocaml
soupault has quit [Remote host closed the connection]
soupault has joined #ocaml
shinnya has joined #ocaml
LiamGoodacre has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
rgrinberg has quit [Ping timeout: 265 seconds]
vinoski has quit [Ping timeout: 250 seconds]
vinoski has joined #ocaml
SilverKey has quit [Quit: Halted.]
Algebr`` has quit [Ping timeout: 240 seconds]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
ontologiae has joined #ocaml
_andre has quit [Quit: leaving]
tmtwd has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
octachron has quit [Quit: Leaving]
tvynr has joined #ocaml
ygrek_ has joined #ocaml
mj12` has quit [Ping timeout: 276 seconds]
ygrek has quit [Ping timeout: 252 seconds]
soupault has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 252 seconds]
soupault has joined #ocaml
rgrinberg has joined #ocaml
soupault has quit [Remote host closed the connection]
ygrek has joined #ocaml
soupault has joined #ocaml
soupault has quit [Remote host closed the connection]
sh0t has quit [Ping timeout: 258 seconds]
ygrek_ has quit [Ping timeout: 250 seconds]
ontologiae has quit [Ping timeout: 244 seconds]
tmtwd has quit [Ping timeout: 265 seconds]
<strykerkkd> hi guys, nowadays merlin doesn't work in Atom for some reason. i tried the nuclide and the merlin atom package, but didn't work
<strykerkkd> am i the only one?
sh0t has joined #ocaml
<strykerkkd> visual studio code has a really good ocaml extension, so it's not really an issue
zpe has joined #ocaml
kakadu has joined #ocaml
soupault has joined #ocaml
sh0t has quit [Ping timeout: 276 seconds]
zpe has quit [Ping timeout: 265 seconds]
<tvynr> strykerkkd: I routinely find that the Atom Merlin plugin craps out when my project fails to compile across multiple files. I'm refactoring right now, so I'm afraid I can't really provide a test.
<strykerkkd> tvynr: i remember that once it worked perfectly for me, but after an update it's just didn't work any more
<tvynr> strykerkkd: I wouldn't be surprised if it's broken in my environment. It always seems a bit touch and go. I hope it stays maintained; I love Merlin but I can't stand developing in emacs or vim.
<tvynr> I'd like to beg a piece of advice from anyone who's using ppx_deriving. I often find that I want to derive eg, ord, yojson, etc. for functorized data structures (e.g. Var_set). Of course, the ppx_deriving code expects to find a function "pp" inside of those modules and I have to use some trick or another to point the deriver to code elsewhere. How do other people deal with this?
johnelse has joined #ocaml
johnelse has quit [Ping timeout: 250 seconds]
sh0t has joined #ocaml
Simn has quit [Read error: Connection reset by peer]
<smondet> tvynr: well, if your functor expects `pp`, `to_yojson`, etc. functions, the natural path is to get them through the functor argument(s).
<tvynr> Right, but this isn't my functor. It's e.g. the functor Map.Make.
<tvynr> And the problem there is that I still can't provide a pretty-printer at that point, since Map.Make produces a map type which is polymorphic in its value.
<smondet> oh I see
<tvynr> I've bumped into this problem 'cause I have a variant with a map in one of its constructors and ppx_deriving_yojson doesn't let me override how that particular parameter is encoded. :(
<smondet> maybe it's fixable by creating your own augmented Map functor with some `include Map.Make(bblabl)`
<tvynr> I think it is. It's sorta vexing, tho, since it means I need to make different types for e.g. VarToVarMap and VarToPatternMap.
<Drup> Alternatively, Fmt.iter / Fmt.Iter_bindings should make creating such pp function easy
<tvynr> I suppose that's a consequence of needing to serialize the value, tho.
<tvynr> Drup: which library is that?
<smondet> strykerkkd: I stopped using Atom a month ago or so, but most Merlin problems were just fixed with `make clean; make` and/or setting the right path to the merlin executable (after `opam switch` merlin has to match exactly the ocaml compiler) (?)
<Drup> fmt
<Drup> :D
<tvynr> Drup: I don't know a Fmt module.
<tvynr> Ah. :)
pierpa has joined #ocaml
<tvynr> Drup: Unfortunately, this doesn't solve my issue with generating code for Yojson. I think this is a feature problem with ppx_deriving_yojson, though; it doesn't give you a way to name a codec replacement for parts of a type.
<tvynr> Thanks for the fmt reference, tho.
MercurialAlchemi has quit [Ping timeout: 250 seconds]
th5 has quit []
Algebr`` has joined #ocaml
kev has joined #ocaml
<strykerkkd> smondet: I kind of stopped using Atom, because VS Code just works better.
<strykerkkd> hmmm, after a test. seems like merlin works in atom, when typing , but it still doesn't show type hints
sh0t has quit [Ping timeout: 240 seconds]
sh0t has joined #ocaml
tvynr has quit [Ping timeout: 260 seconds]
AltGr has left #ocaml [#ocaml]
ontologiae has joined #ocaml
* kakadu is holding his breath and hears approaching of implicit question.
nicholasf has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
manizzle has joined #ocaml
groovy2shoes has quit [Ping timeout: 250 seconds]
rgrinberg has quit [Ping timeout: 276 seconds]
groovy2shoes has joined #ocaml
manizzler has joined #ocaml
manizzle has quit [Ping timeout: 240 seconds]
sh0t has quit [Ping timeout: 250 seconds]
ontologiae has quit [Ping timeout: 260 seconds]
SilverKey has joined #ocaml
rand__ has quit [Quit: leaving]
andy__ has joined #ocaml
<andy__> I have a function which will be parameterized by a large number of functions, large enough that I don't want to pass them in as parameters individually. Should I use A) a record of functions, B) an object, or C) a first-class module?
nicholasf has quit [Ping timeout: 244 seconds]
sh0t has joined #ocaml
jeffmo has quit [Quit: jeffmo]
nicholasf has joined #ocaml
johnelse has joined #ocaml
strykerkkd has quit [Quit: Leaving]
johnelse has quit [Ping timeout: 264 seconds]
profan has quit [Ping timeout: 276 seconds]
profan has joined #ocaml
nicholas_ has joined #ocaml
SpiceGuid has joined #ocaml
sillyotter has joined #ocaml
zpe has joined #ocaml
nicholasf has quit [Ping timeout: 264 seconds]
sillyotter has quit [Client Quit]
zpe has quit [Ping timeout: 258 seconds]
Denommus has joined #ocaml
<Denommus> hi
<Denommus> I'm trying to make a testing Android app in ocsigen
<Denommus> and it seems it uses index.html entirely, while ignoring my $(PROJECT).eliom file that actually has the program's logic
<Denommus> what am I missing?
<Denommus> it seems there are no tutorials
<Denommus> I just used the "mobile" template of eliom-distillery
rgrinberg has joined #ocaml
orbifx has quit [Ping timeout: 244 seconds]
kakadu has quit [Remote host closed the connection]
soupault has quit [Ping timeout: 244 seconds]
SilverKey has quit [Quit: Halted.]
d0nn1e has quit [Ping timeout: 244 seconds]
sh0t has quit [Ping timeout: 240 seconds]
d0nn1e has joined #ocaml
agarwal1975 has joined #ocaml
larhat has joined #ocaml
nicholas_ has quit [Ping timeout: 240 seconds]
johnelse has joined #ocaml
kev has quit [Ping timeout: 240 seconds]
nicholasf has joined #ocaml
johnelse has quit [Ping timeout: 258 seconds]
nicholas_ has joined #ocaml
sh0t has joined #ocaml
nicholasf has quit [Ping timeout: 240 seconds]
ygrek_ has joined #ocaml
<rgrinberg> Drup: Str doesn't support beginning/end only word boundaries right?
<rgrinberg> only \b for either one
ygrek has quit [Ping timeout: 240 seconds]
dexterph has quit [Ping timeout: 258 seconds]